Skip to content

Commit d109c11

Browse files
committed
WiX: simplify the swift-format package definition
- 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 d109c11

File tree

3 files changed

+13
-72
lines changed

3 files changed

+13
-72
lines changed

platforms/Windows/swift-format-amd64.wxs

Lines changed: 0 additions & 54 deletions
This file was deleted.

platforms/Windows/swift-format.wixproj

Lines changed: 1 addition & 1 deletion
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>

platforms/Windows/swift-format-arm64.wxs renamed to platforms/Windows/swift-format.wxs

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,38 @@
22
<Package
33
Language="1033"
44
Manufacturer="swift.org"
5-
Name="Swift Code Formatter for Windows aarch64"
5+
Name="Swift Code Formatter"
66
UpgradeCode="45f1ae7a-4d90-414d-80b3-a5a45898b212"
77
Version="$(var.ProductVersion)"
88
Scope="perMachine">
9-
<SummaryInformation Description="Swift Code Formatter for Windows aarch64" />
9+
<SummaryInformation Description="Swift Code Formatter" />
1010

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

14-
<!-- Directory Structure -->
1514
<!-- WindowsVolume is not a StandardDirectory value, but rather a standard property. See https://github.com/wixtoolset/issues/issues/7314 -->
1615
<SetDirectory Id="WINDOWSVOLUME" Value="[WindowsVolume]" />
16+
1717
<Directory ComponentGuidGenerationSeed="ab1b7ca9-b240-44c7-be8b-3cf1e34ad747" Id="WINDOWSVOLUME">
1818
<Directory Id="INSTALLDIR">
1919
<Directory Id="Library" Name="Library">
2020
<Directory Id="Developer" Name="Developer">
2121
<Directory Id="Tools" Name="Tools">
22+
<Component Id="swift_format.exe">
23+
<File Id="swift_format.exe" Source="$(var.SWIFT_FORMAT_BUILD)\swift-format.exe" Checksum="yes" />
24+
</Component>
2225
</Directory>
2326
</Directory>
2427
</Directory>
28+
29+
<Component Id="EnvironmentVariables" Guid="c1a01e55-3353-4eca-8b58-9960e57a3758">
30+
<Environment Id="Path" Action="set" Name="Path" Part="last" Permanent="no" System="yes" Value="[INSTALLDIR]Library\Developer\Tools" />
31+
</Component>
2532
</Directory>
2633
</Directory>
2734

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" />
35+
<Feature Id="SwiftFormat" AllowAbsent="no" AllowAdvertise="yes" ConfigurableDirectory="INSTALLDIR" Description="Swift Code Formatter" Level="1" Title="Swift Code Formatter">
36+
<ComponentRef Id="swift_format.exe" />
4137
<ComponentRef Id="EnvironmentVariables" />
4238
</Feature>
4339

@@ -49,6 +45,5 @@
4945
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR"></Property>
5046
<WixVariable Id="WixUIDialogBmp" Value="Resources\swift_dialog.png" />
5147
<WixVariable Id="WixUIBannerBmp" Value="Resources\swift_banner.png" />
52-
5348
</Package>
5449
</Wix>

0 commit comments

Comments
 (0)