Skip to content

Commit 33f517a

Browse files
authored
WiX: simplify the swift-format package definition (swiftlang#202)
- Use durable GUID generation for auto-generation of the GUID. - Combine the platform definitions into a singular source to avoid drift. This avoids having to keep the variants in sync and provides an easier upgrade path. This is the first step towards enabling a non-admin experience for users.
1 parent ffecb08 commit 33f517a

File tree

3 files changed

+15
-78
lines changed

3 files changed

+15
-78
lines changed

platforms/Windows/swift-format-amd64.wxs

-54
This file was deleted.

platforms/Windows/swift-format.wixproj

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@
2727
</ItemGroup>
2828

2929
<ItemGroup>
30-
<Compile Include="swift-format-$(ProductArchitecture).wxs" />
30+
<Compile Include="swift-format.wxs" />
3131
</ItemGroup>
3232
</Project>
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,33 @@
11
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
2-
<Package
3-
Language="1033"
4-
Manufacturer="swift.org"
5-
Name="Swift Code Formatter for Windows aarch64"
6-
UpgradeCode="45f1ae7a-4d90-414d-80b3-a5a45898b212"
7-
Version="$(var.ProductVersion)"
8-
Scope="perMachine">
9-
<SummaryInformation Description="Swift Code Formatter for Windows aarch64" />
2+
<Package Language="1033" Manufacturer="swift.org" Name="Swift Code Formatter" UpgradeCode="45f1ae7a-4d90-414d-80b3-a5a45898b212" Version="$(var.ProductVersion)" Scope="perMachine">
3+
<SummaryInformation Description="Swift Code Formatter" />
104

115
<!-- NOTE(compnerd) use pre-3.0 schema for better compatibility. -->
126
<Media Id="1" Cabinet="SwiftFormat.cab" EmbedCab="yes" />
137

14-
<!-- Directory Structure -->
158
<!-- WindowsVolume is not a StandardDirectory value, but rather a standard property. See https://github.com/wixtoolset/issues/issues/7314 -->
169
<SetDirectory Id="WINDOWSVOLUME" Value="[WindowsVolume]" />
10+
1711
<Directory ComponentGuidGenerationSeed="ab1b7ca9-b240-44c7-be8b-3cf1e34ad747" Id="WINDOWSVOLUME">
1812
<Directory Id="INSTALLDIR">
1913
<Directory Id="Library" Name="Library">
2014
<Directory Id="Developer" Name="Developer">
2115
<Directory Id="Tools" Name="Tools">
16+
<Component Id="swift_format.exe">
17+
<File Id="swift_format.exe" Source="$(var.SWIFT_FORMAT_BUILD)\swift-format.exe" Checksum="yes" />
18+
</Component>
2219
</Directory>
2320
</Directory>
2421
</Directory>
22+
23+
<Component Id="EnvironmentVariables" Guid="c1a01e55-3353-4eca-8b58-9960e57a3758">
24+
<Environment Id="Path" Action="set" Name="Path" Part="last" Permanent="no" System="yes" Value="[INSTALLDIR]Library\Developer\Tools" />
25+
</Component>
2526
</Directory>
2627
</Directory>
2728

28-
<!-- Components -->
29-
<ComponentGroup Id="SwiftFormat">
30-
<Component Id="swift_format.exe" Directory="Tools" Guid="1e6c84e1-6cf4-4e34-90f6-eb76c278f7e2">
31-
<File Id="swift_format.exe" Source="$(var.SWIFT_FORMAT_BUILD)\swift-format.exe" Checksum="yes" />
32-
</Component>
33-
</ComponentGroup>
34-
35-
<Component Id="EnvironmentVariables" Directory="INSTALLDIR" Guid="c1a01e55-3353-4eca-8b58-9960e57a3758">
36-
<Environment Id="Path" Action="set" Name="Path" Part="last" Permanent="no" System="yes" Value="[INSTALLDIR]Library\Developer\Tools" />
37-
</Component>
38-
39-
<Feature Id="SwiftFormat" AllowAbsent="no" AllowAdvertise="yes" ConfigurableDirectory="INSTALLDIR" Description="Swift Code Formatter for Windows aarch64" Level="1" Title="Swift Code Formatter (Windows aarch64)">
40-
<ComponentGroupRef Id="SwiftFormat" />
29+
<Feature Id="SwiftFormat" AllowAbsent="no" AllowAdvertise="yes" ConfigurableDirectory="INSTALLDIR" Description="Swift Code Formatter" Level="1" Title="Swift Code Formatter">
30+
<ComponentRef Id="swift_format.exe" />
4131
<ComponentRef Id="EnvironmentVariables" />
4232
</Feature>
4333

@@ -46,9 +36,10 @@
4636
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg" Order="2" />
4737
<Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2" />
4838
</UI>
39+
4940
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR"></Property>
41+
5042
<WixVariable Id="WixUIDialogBmp" Value="Resources\swift_dialog.png" />
5143
<WixVariable Id="WixUIBannerBmp" Value="Resources\swift_banner.png" />
52-
5344
</Package>
5445
</Wix>

0 commit comments

Comments
 (0)