Skip to content

Commit 2a30cde

Browse files
WiX: Migrate the Windows installer to WiX v4
Migrate the Windows installer to WiX v4.
1 parent 4ae403b commit 2a30cde

19 files changed

+672
-771
lines changed

platforms/Windows/devtools-amd64.wxs

+32-31
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,33 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
3-
<Product Id="*" Language="1033" Manufacturer="swift.org" Name="Swift Developer Tools for Windows x86_64" UpgradeCode="5778fa7a-f1a6-4133-b4e0-fc0d9caf4544" Version="$(var.ProductVersion)">
4-
<Package Comments="Copyright (c) 2021-2022 Swift Open Source Project" Compressed="yes" Description="Swift Developer Tools for Windows x86_64" InstallScope="perMachine" Manufacturer="swift.org" />
1+
<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 Developer Tools for Windows x86_64"
6+
UpgradeCode="5778fa7a-f1a6-4133-b4e0-fc0d9caf4544"
7+
Version="$(var.ProductVersion)"
8+
Scope="perMachine">
9+
<SummaryInformation Description="Swift Developer Tools for Windows x86_64" />
510

611
<Media Id="1" Cabinet="devtools.cab" EmbedCab="yes" />
712
<?ifdef INCLUDE_DEBUG_INFO ?>
813
<Media Id="2" Cabinet="PDBs.cab" EmbedCab="yes" />
914
<?endif?>
1015

1116
<!-- Directory Structure -->
12-
<Directory Id="TARGETDIR" Name="SourceDir">
13-
<Directory Id="INSTALLDIR">
14-
<Directory Id="Developer" Name="Developer">
15-
<Directory Id="Toolchains" Name="Toolchains">
16-
<Directory Id="xctoolchain" Name="unknown-Asserts-development.xctoolchain">
17-
<Directory Id="_usr" Name="usr">
18-
<Directory Id="_usr_bin" Name="bin">
19-
</Directory>
20-
<Directory Id="_usr_lib" Name="lib">
21-
<!-- FIXME(compnerd) should we include the SPM import libraries? -->
22-
<Directory Id="_usr_lib_swift" Name="swift">
23-
<Directory Id="_usr_lib_swift_pm" Name="pm">
24-
<Directory Id="_usr_lib_swift_pm_ManifestAPI" Name="ManifestAPI">
25-
</Directory>
26-
<Directory Id="_usr_lib_swift_pm_PluginAPI" Name="PluginAPI">
27-
</Directory>
17+
<Directory Id="INSTALLDIR">
18+
<Directory Id="Developer" Name="Developer">
19+
<Directory Id="Toolchains" Name="Toolchains">
20+
<Directory Id="xctoolchain" Name="unknown-Asserts-development.xctoolchain">
21+
<Directory Id="_usr" Name="usr">
22+
<Directory Id="_usr_bin" Name="bin">
23+
</Directory>
24+
<Directory Id="_usr_lib" Name="lib">
25+
<!-- FIXME(compnerd) should we include the SPM import libraries? -->
26+
<Directory Id="_usr_lib_swift" Name="swift">
27+
<Directory Id="_usr_lib_swift_pm" Name="pm">
28+
<Directory Id="_usr_lib_swift_pm_ManifestAPI" Name="ManifestAPI">
29+
</Directory>
30+
<Directory Id="_usr_lib_swift_pm_PluginAPI" Name="PluginAPI">
2831
</Directory>
2932
</Directory>
3033
</Directory>
@@ -35,9 +38,7 @@
3538
</Directory>
3639
</Directory>
3740

38-
<SetDirectory Id="INSTALLDIR" Value="[WindowsVolume]Library">
39-
NOT INSTALLDIR
40-
</SetDirectory>
41+
<SetDirectory Id="INSTALLDIR" Value="[WindowsVolume]Library" Condition="NOT INSTALLDIR" />
4142

4243
<!-- Components -->
4344
<ComponentGroup Id="SwiftCollections">
@@ -222,15 +223,15 @@
222223
</ComponentGroup>
223224
<?endif?>
224225

225-
<Feature Id="DeveloperTools" Absent="disallow" AllowAdvertise="yes" ConfigurableDirectory="INSTALLDIR" Description="Swift Developer Tools for Windows x86_64" Level="1" Title="Swift Developer Tools (Windows x86_64)">
226+
<Feature Id="DeveloperTools" AllowAbsent="no" AllowAdvertise="yes" ConfigurableDirectory="INSTALLDIR" Description="Swift Developer Tools for Windows x86_64" Level="1" Title="Swift Developer Tools (Windows x86_64)">
226227
<ComponentGroupRef Id="SwiftCollections" />
227228
<ComponentGroupRef Id="SwiftSystem" />
228229
<ComponentGroupRef Id="SwiftPackageManager" />
229230
<ComponentGroupRef Id="SourceKitLSP" />
230231

231232
<?ifdef INCLUDE_DEBUG_INFO ?>
232-
<Feature Id="DebugInfo" Absent="allow" AllowAdvertise="yes" Description="Debug Information for Swift Developer Tools for Windows x86_64" Level="0" Title="Debug Info">
233-
<Condition Level="1">INSTALL_DEBUGINFO</Condition>
233+
<Feature Id="DebugInfo" AllowAbsent="yes" AllowAdvertise="yes" Description="Debug Information for Swift Developer Tools for Windows x86_64" Level="0" Title="Debug Info">
234+
<Level Value="1" Condition="INSTALL_DEBUGINFO" />
234235
<ComponentGroupRef Id="SwiftCollectionsDebugInfo" />
235236
<ComponentGroupRef Id="SwiftSystemDebugInfo" />
236237
<ComponentGroupRef Id="SwiftPackageManagerDebugInfo" />
@@ -240,13 +241,13 @@
240241
</Feature>
241242

242243
<UI>
243-
<UIRef Id="WixUI_InstallDir" />
244-
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg" Order="2">1</Publish>
245-
<Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">1</Publish>
244+
<ui:WixUI Id="WixUI_InstallDir" />
245+
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg" Order="2" />
246+
<Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2" />
246247
</UI>
247-
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" ></Property>
248+
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR"></Property>
248249
<WixVariable Id="WixUIDialogBmp" Value="Resources\swift_dialog.png" />
249250
<WixVariable Id="WixUIBannerBmp" Value="Resources\swift_banner.png" />
250251

251-
</Product>
252+
</Package>
252253
</Wix>

platforms/Windows/devtools-arm64.wxs

+32-31
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,33 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
3-
<Product Id="*" Language="1033" Manufacturer="swift.org" Name="Swift Developer Tools for Windows aarch64" UpgradeCode="" Version="$(var.ProductVersion)">
4-
<Package Comments="Copyright (c) 2021-2022 Swift Open Source Project" Compressed="yes" Description="Swift Developer Tools for Windows aarch64" InstallScope="perMachine" Manufacturer="swift.org" />
1+
<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 Developer Tools for Windows aarch64"
6+
UpgradeCode=""
7+
Version="$(var.ProductVersion)"
8+
Scope="perMachine">
9+
<SummaryInformation Description="Swift Developer Tools for Windows aarch64" />
510

611
<Media Id="1" Cabinet="devtools.cab" EmbedCab="yes" />
712
<?ifdef INCLUDE_DEBUG_INFO ?>
813
<Media Id="2" Cabinet="PDBs.cab" EmbedCab="yes" />
914
<?endif?>
1015

1116
<!-- Directory Structure -->
12-
<Directory Id="TARGETDIR" Name="SourceDir">
13-
<Directory Id="INSTALLDIR">
14-
<Directory Id="Developer" Name="Developer">
15-
<Directory Id="Toolchains" Name="Toolchains">
16-
<Directory Id="xctoolchain" Name="unknown-Asserts-development.xctoolchain">
17-
<Directory Id="_usr" Name="usr">
18-
<Directory Id="_usr_bin" Name="bin">
19-
</Directory>
20-
<Directory Id="_usr_lib" Name="lib">
21-
<!-- FIXME(compnerd) should we include the SPM import libraries? -->
22-
<Directory Id="_usr_lib_swift" Name="swift">
23-
<Directory Id="_usr_lib_swift_pm" Name="pm">
24-
<Directory Id="_usr_lib_swift_pm_ManifestAPI" Name="ManifestAPI">
25-
</Directory>
26-
<Directory Id="_usr_lib_swift_pm_PluginAPI" Name="PluginAPI">
27-
</Directory>
17+
<Directory Id="INSTALLDIR">
18+
<Directory Id="Developer" Name="Developer">
19+
<Directory Id="Toolchains" Name="Toolchains">
20+
<Directory Id="xctoolchain" Name="unknown-Asserts-development.xctoolchain">
21+
<Directory Id="_usr" Name="usr">
22+
<Directory Id="_usr_bin" Name="bin">
23+
</Directory>
24+
<Directory Id="_usr_lib" Name="lib">
25+
<!-- FIXME(compnerd) should we include the SPM import libraries? -->
26+
<Directory Id="_usr_lib_swift" Name="swift">
27+
<Directory Id="_usr_lib_swift_pm" Name="pm">
28+
<Directory Id="_usr_lib_swift_pm_ManifestAPI" Name="ManifestAPI">
29+
</Directory>
30+
<Directory Id="_usr_lib_swift_pm_PluginAPI" Name="PluginAPI">
2831
</Directory>
2932
</Directory>
3033
</Directory>
@@ -35,9 +38,7 @@
3538
</Directory>
3639
</Directory>
3740

38-
<SetDirectory Id="INSTALLDIR" Value="[WindowsVolume]Library">
39-
NOT INSTALLDIR
40-
</SetDirectory>
41+
<SetDirectory Id="INSTALLDIR" Value="[WindowsVolume]Library" Condition="NOT INSTALLDIR" />
4142

4243
<!-- Components -->
4344
<ComponentGroup Id="SwiftCollections">
@@ -222,15 +223,15 @@
222223
</ComponentGroup>
223224
<?endif?>
224225

225-
<Feature Id="DeveloperTools" Absent="disallow" AllowAdvertise="yes" ConfigurableDirectory="INSTALLDIR" Description="Swift Developer Tools for Windows aarch64" Level="1" Title="Swift Developer Tools (Windows aarch64)">
226+
<Feature Id="DeveloperTools" AllowAbsent="no" AllowAdvertise="yes" ConfigurableDirectory="INSTALLDIR" Description="Swift Developer Tools for Windows aarch64" Level="1" Title="Swift Developer Tools (Windows aarch64)">
226227
<ComponentGroupRef Id="SwiftCollections" />
227228
<ComponentGroupRef Id="SwiftSystem" />
228229
<ComponentGroupRef Id="SwiftPackageManager" />
229230
<ComponentGroupRef Id="SourceKitLSP" />
230231

231232
<?ifdef INCLUDE_DEBUG_INFO ?>
232-
<Feature Id="DebugInfo" Absent="allow" AllowAdvertise="yes" Description="Debug Information for Swift Developer Tools for Windows aarch64" Level="0" Title="Debug Info">
233-
<Condition Level="1">INSTALL_DEBUGINFO</Condition>
233+
<Feature Id="DebugInfo" AllowAbsent="yes" AllowAdvertise="yes" Description="Debug Information for Swift Developer Tools for Windows aarch64" Level="0" Title="Debug Info">
234+
<Level Value="1" Condition="INSTALL_DEBUGINFO" />
234235
<ComponentGroupRef Id="SwiftCollectionsDebugInfo" />
235236
<ComponentGroupRef Id="SwiftSystemDebugInfo" />
236237
<ComponentGroupRef Id="SwiftPackageManagerDebugInfo" />
@@ -240,13 +241,13 @@
240241
</Feature>
241242

242243
<UI>
243-
<UIRef Id="WixUI_InstallDir" />
244-
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg" Order="2">1</Publish>
245-
<Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2">1</Publish>
244+
<ui:WixUI Id="WixUI_InstallDir" />
245+
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg" Order="2" />
246+
<Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2" />
246247
</UI>
247-
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" ></Property>
248+
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR"></Property>
248249
<WixVariable Id="WixUIDialogBmp" Value="Resources\swift_dialog.png" />
249250
<WixVariable Id="WixUIBannerBmp" Value="Resources\swift_banner.png" />
250251

251-
</Product>
252+
</Package>
252253
</Wix>

platforms/Windows/devtools.wixproj

+5-19
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTarget="Build">
1+
<Project Sdk="WixToolset.Sdk/4.0.0-rc.4">
32
<PropertyGroup>
4-
<OutputName>devtools</OutputName>
5-
<OutputType>Package</OutputType>
6-
<ProjectGuid>0a266072-af7c-43f2-b192-dd86995c2e82</ProjectGuid>
7-
<SchemaVersion>2.0</SchemaVersion>
3+
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
84
</PropertyGroup>
95

106
<PropertyGroup>
@@ -18,15 +14,8 @@
1814
<PropertyGroup>
1915
<OutputPath>build\</OutputPath>
2016
<IntermediateOutputPath>build\obj\</IntermediateOutputPath>
21-
<DefineSolutionProperties>false</DefineSolutionProperties>
2217
</PropertyGroup>
2318

24-
<Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' " />
25-
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets') " />
26-
<Target Name="EnsureWiXToolsetInstalled" Condition="">
27-
<Error Text="The WiX Toolset v3.11 (or newer) build tools must be installed to build this project. To download the WiX Toolset, see https://wixtoolset.org/releases/." />
28-
</Target>
29-
3019
<Import Project="WiXCodeSigning.targets" />
3120

3221
<PropertyGroup>
@@ -41,13 +30,10 @@
4130
</PropertyGroup>
4231

4332
<ItemGroup>
44-
<WixExtension Include="WixUIExtension">
45-
<HintPath>$(WixExtDir)\WixUIExtension.dll</HintPath>
46-
<Name>WixUIExtension</Name>
47-
</WixExtension>
33+
<PackageReference Include="WixToolset.UI.wixext" Version="4.0.0-rc.4" />
4834
</ItemGroup>
49-
35+
5036
<ItemGroup>
5137
<Compile Include="devtools-$(ProductArchitecture).wxs" />
5238
</ItemGroup>
53-
</Project>
39+
</Project>

platforms/Windows/installer.wixproj

+3-16
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Build">
1+
<Project Sdk="WixToolset.Sdk/4.0.0-rc.4">
32
<PropertyGroup>
4-
<OutputName>installer</OutputName>
3+
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
54
<OutputType>Bundle</OutputType>
6-
<ProjectGuid>8ae3ad4d-2df4-42b7-890e-decdd5cead0b</ProjectGuid>
7-
<SchemaVersion>2.0</SchemaVersion>
85
</PropertyGroup>
96

107
<PropertyGroup>
@@ -21,26 +18,16 @@
2118
<PropertyGroup>
2219
<OutputPath>build\</OutputPath>
2320
<IntermediateOutputPath>build\obj\</IntermediateOutputPath>
24-
<DefineSolutionProperties>false</DefineSolutionProperties>
2521
</PropertyGroup>
2622

27-
<Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' " />
28-
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets') " />
29-
<Target Name="EnsureWiXToolsetInstalled" Condition="">
30-
<Error Text="The WiX Toolset v3.11 (or newer) build tools must be installed to build this project. To download the WiX Toolset, see https://wixtoolset.org/releases/." />
31-
</Target>
32-
3323
<Import Project="WiXCodeSigning.targets" />
3424

3525
<PropertyGroup>
3626
<DefineConstants>ProductVersion=$(ProductVersion);RequiredChain=$(RequiredChain);OptionalChain=$(OptionalChain);MSI_LOCATION=$(MSI_LOCATION);</DefineConstants>
3727
</PropertyGroup>
3828

3929
<ItemGroup>
40-
<WixExtension Include="WixBalExtension">
41-
<HintPath>$(WixExtDir)\WixBalExtension.dll</HintPath>
42-
<Name>WixBalExtension</Name>
43-
</WixExtension>
30+
<PackageReference Include="WixToolset.Bal.wixext" Version="4.0.0-rc.4" />
4431
</ItemGroup>
4532

4633
<ItemGroup>

platforms/Windows/installer.wxs

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">
1+
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:bal="http://wixtoolset.org/schemas/v4/wxs/bal">
32
<Bundle Name="Swift Developer Package for Windows x86_64" Version="$(var.ProductVersion)" Manufacturer="swift.org" UpgradeCode="8c75f32a-7bdf-4c61-abf6-c7e1c4b8fbf6">
4-
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.HyperlinkLicense">
5-
<bal:WixStandardBootstrapperApplication LicenseUrl="" LogoFile="Resources/swift.png" SuppressOptionsUI="yes" SuppressRepair="no" />
6-
</BootstrapperApplicationRef>
3+
<BootstrapperApplication>
4+
<bal:WixStandardBootstrapperApplication LicenseUrl="" LogoFile="Resources/swift.png" SuppressOptionsUI="yes" SuppressRepair="no" Theme="hyperlinkLicense" />
5+
</BootstrapperApplication>
76

87
<Chain>
98
<?if $(var.RequiredChain) != "" ?>

0 commit comments

Comments
 (0)