Skip to content

Commit 8a32452

Browse files
committed
WiX: add some more control over the MSI chain
This adds the ability to include "optional" MSIs to the chain. Optional MSIs are currently always installed as we do not have the UI for feature selection in the boot-strapper, but can be subsequently removed from the "Add Remove Programs" control panel. This will enable the distribution of the x86 SDK and runtime.
1 parent 5dbe835 commit 8a32452

File tree

2 files changed

+20
-7
lines changed

2 files changed

+20
-7
lines changed

platforms/Windows/installer.wixproj

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@
1414
<PropertyGroup>
1515
<ProductVersion Condition=" '$(ProductVersion)' == '' ">0.0.0</ProductVersion>
1616
<ProductVersion>$(ProductVersion)</ProductVersion>
17+
18+
<RequiredChain Condition=" '$(RequiredChain)' == '' ">icu.msi;runtime.msi;toolchain.msi;devtools.msi;sdk.msi</RequiredChain>
19+
<RequiredChain>$(RequiredChain)</RequiredChain>
20+
21+
<OptionalChain>$(OptionalChain)</OptionalChain>
1722
</PropertyGroup>
1823

1924
<PropertyGroup>
@@ -25,7 +30,7 @@
2530
<Import Project="$(WixTargetsPath)" />
2631

2732
<PropertyGroup>
28-
<DefineConstants>ProductVersion=$(ProductVersion);MSI_LOCATION=$(MSI_LOCATION);</DefineConstants>
33+
<DefineConstants>ProductVersion=$(ProductVersion);RequiredChain=$(RequiredChain);OptionalChain=$(OptionalChain);MSI_LOCATION=$(MSI_LOCATION);</DefineConstants>
2934
</PropertyGroup>
3035

3136
<ItemGroup>

platforms/Windows/installer.wxs

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,26 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">
3-
<Bundle Name="Swift" Version="$(var.ProductVersion)" Manufacturer="swift.org" UpgradeCode="8c75f32a-7bdf-4c61-abf6-c7e1c4b8fbf6">
3+
<Bundle Name="Swift Developer Package for Windows x86_64" Version="$(var.ProductVersion)" Manufacturer="swift.org" UpgradeCode="8c75f32a-7bdf-4c61-abf6-c7e1c4b8fbf6">
44
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.HyperlinkLicense">
55
<bal:WixStandardBootstrapperApplication LicenseUrl="" LogoFile="Resources/swift.png" SuppressOptionsUI="yes" SuppressRepair="no" />
66
</BootstrapperApplicationRef>
77

88
<Chain>
9-
<MsiPackage SourceFile="$(var.MSI_LOCATION)\toolchain.msi" Compressed="yes">
9+
<?if $(var.RequiredChain) != "" ?>
10+
<?foreach MSI in $(var.RequiredChain) ?>
11+
<MsiPackage SourceFile="$(var.MSI_LOCATION)\$(var.MSI)" Compressed="yes">
1012
<MsiProperty Name="INSTALL_DEBUGINFO" Value="[INSTALL_DEBUGINFO]" />
1113
</MsiPackage>
12-
<MsiPackage SourceFile="$(var.MSI_LOCATION)\sdk.msi" Compressed="yes" />
13-
<MsiPackage SourceFile="$(var.MSI_LOCATION)\devtools.msi" Compressed="yes" />
14-
<MsiPackage SourceFile="$(var.MSI_LOCATION)\runtime.msi" Compressed="yes" />
15-
<MsiPackage SourceFile="$(var.MSI_LOCATION)\icu.msi" Compressed="yes" />
14+
<?endforeach?>
15+
<?endif?>
16+
17+
<?if $(var.OptionalChain) != "" ?>
18+
<?foreach MSI in $(var.OptionalChain) ?>
19+
<MsiPackage SourceFile="$(var.MSI_LOCATION)\$(var.MSI)" Compressed="yes" Visible="yes">
20+
<MsiProperty Name="INSTALL_DEBUGINFO" Value="[INSTALL_DEBUGINFO]" />
21+
</MsiPackage>
22+
<?endforeach?>
23+
<?endif?>
1624
</Chain>
1725
</Bundle>
1826
</Wix>

0 commit comments

Comments
 (0)