Skip to content

Commit 6ebb8d7

Browse files
committed
WiX: expose runtime MSM layouts in bundle UI
Expose the redistributable merge modules as layout-level bundle options instead of one per linkage/layout combination. The BA tree now shows SxS for bound MSMs and flat for unbound MSMs under each Windows SDK architecture. Default SxS to selected and flat to unselected, and forward each layout choice to both shared and static MSM components in the Windows platform MSI.
1 parent 7b311d7 commit 6ebb8d7

5 files changed

Lines changed: 46 additions & 32 deletions

File tree

platforms/Windows/bundle/baf/baf.cc

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,21 @@ constexpr SdkTreeItem kSDKTreeItems[] = {
130130
L"BAFAvailWindowsPlatform", 0},
131131
{L"[Sdk_ProductName_Windows_amd64]", L"OptionsInstallWindowsSDKAMD64",
132132
L"BAFAvailWindowsAMD64", 1},
133-
{L"[Redist_amd64]", L"OptionsInstallWindowsRedistAMD64",
133+
{L"[Redist_bound]", L"OptionsInstallWindowsRedistBoundAMD64",
134+
L"BAFAvailWindowsAMD64", 2},
135+
{L"[Redist_unbound]", L"OptionsInstallWindowsRedistUnboundAMD64",
134136
L"BAFAvailWindowsAMD64", 2},
135137
{L"[Sdk_ProductName_Windows_arm64]", L"OptionsInstallWindowsSDKARM64",
136138
L"BAFAvailWindowsARM64", 1},
137-
{L"[Redist_arm64]", L"OptionsInstallWindowsRedistARM64",
139+
{L"[Redist_bound]", L"OptionsInstallWindowsRedistBoundARM64",
140+
L"BAFAvailWindowsARM64", 2},
141+
{L"[Redist_unbound]", L"OptionsInstallWindowsRedistUnboundARM64",
138142
L"BAFAvailWindowsARM64", 2},
139143
{L"[Sdk_ProductName_Windows_x86]", L"OptionsInstallWindowsSDKX86",
140144
L"BAFAvailWindowsX86", 1},
141-
{L"[Redist_x86]", L"OptionsInstallWindowsRedistX86",
145+
{L"[Redist_bound]", L"OptionsInstallWindowsRedistBoundX86",
146+
L"BAFAvailWindowsX86", 2},
147+
{L"[Redist_unbound]", L"OptionsInstallWindowsRedistUnboundX86",
142148
L"BAFAvailWindowsX86", 2},
143149
{L"[Plt_ProductName_Android]", L"OptionsInstallAndroidPlatform",
144150
L"BAFAvailAndroidPlatform", 0},

platforms/Windows/bundle/installer.wxs

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,8 @@
6565
<Variable Name="Sdk_ProductName_Windows_amd64" Value="!(loc.Sdk_ProductName_Windows_amd64)" Type="string" Hidden="yes" />
6666
<Variable Name="Sdk_ProductName_Windows_arm64" Value="!(loc.Sdk_ProductName_Windows_arm64)" Type="string" Hidden="yes" />
6767
<Variable Name="Sdk_ProductName_Windows_x86" Value="!(loc.Sdk_ProductName_Windows_x86)" Type="string" Hidden="yes" />
68-
<Variable Name="Redist_amd64" Value="!(loc.Redist)" Type="string" Hidden="yes" />
69-
<Variable Name="Redist_arm64" Value="!(loc.Redist)" Type="string" Hidden="yes" />
70-
<Variable Name="Redist_x86" Value="!(loc.Redist)" Type="string" Hidden="yes" />
68+
<Variable Name="Redist_bound" Value="!(loc.Redist_bound)" Type="string" Hidden="yes" />
69+
<Variable Name="Redist_unbound" Value="!(loc.Redist_unbound)" Type="string" Hidden="yes" />
7170
<Variable Name="Plt_ProductName_Android" Value="!(loc.Plt_ProductName_Android)" Type="string" Hidden="yes" />
7271
<Variable Name="Sdk_ProductName_Android_arm64" Value="!(loc.Sdk_ProductName_Android_arm64)" Type="string" Hidden="yes" />
7372
<Variable Name="Sdk_ProductName_Android_amd64" Value="!(loc.Sdk_ProductName_Android_amd64)" Type="string" Hidden="yes" />
@@ -159,13 +158,16 @@
159158
<Variable Name="OptionsInstallWindowsPlatform" bal:Overridable="yes" Persisted="yes" Value="1" />
160159

161160
<Variable Name="OptionsInstallWindowsSDKX86" bal:Overridable="yes" Persisted="yes" Value="1" />
162-
<Variable Name="OptionsInstallWindowsRedistX86" bal:Overridable="yes" Persisted="yes" Value="1" />
161+
<Variable Name="OptionsInstallWindowsRedistBoundX86" bal:Overridable="yes" Persisted="yes" Value="1" />
162+
<Variable Name="OptionsInstallWindowsRedistUnboundX86" bal:Overridable="yes" Persisted="yes" Value="0" />
163163

164164
<Variable Name="OptionsInstallWindowsSDKAMD64" bal:Overridable="yes" Persisted="yes" Value="1" />
165-
<Variable Name="OptionsInstallWindowsRedistAMD64" bal:Overridable="yes" Persisted="yes" Value="1" />
165+
<Variable Name="OptionsInstallWindowsRedistBoundAMD64" bal:Overridable="yes" Persisted="yes" Value="1" />
166+
<Variable Name="OptionsInstallWindowsRedistUnboundAMD64" bal:Overridable="yes" Persisted="yes" Value="0" />
166167

167168
<Variable Name="OptionsInstallWindowsSDKARM64" bal:Overridable="yes" Persisted="yes" Value="1" />
168-
<Variable Name="OptionsInstallWindowsRedistARM64" bal:Overridable="yes" Persisted="yes" Value="1" />
169+
<Variable Name="OptionsInstallWindowsRedistBoundARM64" bal:Overridable="yes" Persisted="yes" Value="1" />
170+
<Variable Name="OptionsInstallWindowsRedistUnboundARM64" bal:Overridable="yes" Persisted="yes" Value="0" />
169171

170172
<Variable Name="OptionsInstallAndroidPlatform" bal:Overridable="yes" Persisted="yes" Value="1" />
171173

@@ -313,13 +315,16 @@
313315
<MsiProperty Name="INSTALLROOT" Value="[InstallRoot]" />
314316

315317
<MsiProperty Name="INSTALLARM64SDK" Value="[OptionsInstallWindowsSDKARM64]" />
316-
<MsiProperty Name="INSTALLARM64REDIST" Value="[OptionsInstallWindowsRedistARM64]" />
318+
<MsiProperty Name="INSTALLARM64REDISTBOUND" Value="[OptionsInstallWindowsRedistBoundARM64]" />
319+
<MsiProperty Name="INSTALLARM64REDISTUNBOUND" Value="[OptionsInstallWindowsRedistUnboundARM64]" />
317320

318321
<MsiProperty Name="INSTALLAMD64SDK" Value="[OptionsInstallWindowsSDKAMD64]" />
319-
<MsiProperty Name="INSTALLAMD64REDIST" Value="[OptionsInstallWindowsRedistAMD64]" />
322+
<MsiProperty Name="INSTALLAMD64REDISTBOUND" Value="[OptionsInstallWindowsRedistBoundAMD64]" />
323+
<MsiProperty Name="INSTALLAMD64REDISTUNBOUND" Value="[OptionsInstallWindowsRedistUnboundAMD64]" />
320324

321325
<MsiProperty Name="INSTALLX86SDK" Value="[OptionsInstallWindowsSDKX86]" />
322-
<MsiProperty Name="INSTALLX86REDIST" Value="[OptionsInstallWindowsRedistX86]" />
326+
<MsiProperty Name="INSTALLX86REDISTBOUND" Value="[OptionsInstallWindowsRedistBoundX86]" />
327+
<MsiProperty Name="INSTALLX86REDISTUNBOUND" Value="[OptionsInstallWindowsRedistUnboundX86]" />
323328
</MsiPackage>
324329
<?endif?>
325330
</Chain>

platforms/Windows/platforms/windows/windows.wxs

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,14 @@
99
Scope="$(PackageScope)">
1010

1111
<Property Id="INSTALLARM64SDK" Value="1" />
12-
<Property Id="INSTALLARM64REDIST" Value="1" />
12+
<Property Id="INSTALLARM64REDISTBOUND" Value="1" />
13+
<Property Id="INSTALLARM64REDISTUNBOUND" Value="0" />
1314
<Property Id="INSTALLAMD64SDK" Value="1" />
14-
<Property Id="INSTALLAMD64REDIST" Value="1" />
15+
<Property Id="INSTALLAMD64REDISTBOUND" Value="1" />
16+
<Property Id="INSTALLAMD64REDISTUNBOUND" Value="0" />
1517
<Property Id="INSTALLX86SDK" Value="1" />
16-
<Property Id="INSTALLX86REDIST" Value="1" />
18+
<Property Id="INSTALLX86REDISTBOUND" Value="1" />
19+
<Property Id="INSTALLX86REDISTUNBOUND" Value="0" />
1720

1821
<Media Id="1" Cabinet="windows.cab" EmbedCab="$(ArePackageCabsEmbedded)" />
1922
<?if $(IncludeARM64) == True?>
@@ -1744,55 +1747,55 @@
17441747

17451748
<!-- Redistributables -->
17461749
<?if $(IncludeARM64) == True?>
1747-
<Component Id="rtl.shared.bound.arm64.msm" Directory="RedistVersion" Condition="INSTALLARM64REDIST" DiskId="2">
1750+
<Component Id="rtl.shared.bound.arm64.msm" Directory="RedistVersion" Condition="INSTALLARM64REDISTBOUND" DiskId="2">
17481751
<File Source="!(bindpath.rtl.shared.bound.arm64.msm)\rtl.shared.bound.arm64.msm" />
17491752
</Component>
17501753

1751-
<Component Id="rtl.shared.unbound.arm64.msm" Directory="RedistVersion" Condition="INSTALLARM64REDIST" DiskId="2">
1754+
<Component Id="rtl.shared.unbound.arm64.msm" Directory="RedistVersion" Condition="INSTALLARM64REDISTUNBOUND" DiskId="2">
17521755
<File Source="!(bindpath.rtl.shared.unbound.arm64.msm)\rtl.shared.unbound.arm64.msm" />
17531756
</Component>
17541757

1755-
<Component Id="rtl.static.bound.arm64.msm" Directory="RedistVersion" Condition="INSTALLARM64REDIST" DiskId="2">
1758+
<Component Id="rtl.static.bound.arm64.msm" Directory="RedistVersion" Condition="INSTALLARM64REDISTBOUND" DiskId="2">
17561759
<File Source="!(bindpath.rtl.static.bound.arm64.msm)\rtl.static.bound.arm64.msm" />
17571760
</Component>
17581761

1759-
<Component Id="rtl.static.unbound.arm64.msm" Directory="RedistVersion" Condition="INSTALLARM64REDIST" DiskId="2">
1762+
<Component Id="rtl.static.unbound.arm64.msm" Directory="RedistVersion" Condition="INSTALLARM64REDISTUNBOUND" DiskId="2">
17601763
<File Source="!(bindpath.rtl.static.unbound.arm64.msm)\rtl.static.unbound.arm64.msm" />
17611764
</Component>
17621765
<?endif?>
17631766

17641767
<?if $(IncludeX64) == True?>
1765-
<Component Id="rtl.shared.bound.amd64.msm" Directory="RedistVersion" Condition="INSTALLAMD64REDIST" DiskId="3">
1768+
<Component Id="rtl.shared.bound.amd64.msm" Directory="RedistVersion" Condition="INSTALLAMD64REDISTBOUND" DiskId="3">
17661769
<File Source="!(bindpath.rtl.shared.bound.amd64.msm)\rtl.shared.bound.amd64.msm" />
17671770
</Component>
17681771

1769-
<Component Id="rtl.shared.unbound.amd64.msm" Directory="RedistVersion" Condition="INSTALLAMD64REDIST" DiskId="3">
1772+
<Component Id="rtl.shared.unbound.amd64.msm" Directory="RedistVersion" Condition="INSTALLAMD64REDISTUNBOUND" DiskId="3">
17701773
<File Source="!(bindpath.rtl.shared.unbound.amd64.msm)\rtl.shared.unbound.amd64.msm" />
17711774
</Component>
17721775

1773-
<Component Id="rtl.static.bound.amd64.msm" Directory="RedistVersion" Condition="INSTALLAMD64REDIST" DiskId="3">
1776+
<Component Id="rtl.static.bound.amd64.msm" Directory="RedistVersion" Condition="INSTALLAMD64REDISTBOUND" DiskId="3">
17741777
<File Source="!(bindpath.rtl.static.bound.amd64.msm)\rtl.static.bound.amd64.msm" />
17751778
</Component>
17761779

1777-
<Component Id="rtl.static.unbound.amd64.msm" Directory="RedistVersion" Condition="INSTALLAMD64REDIST" DiskId="3">
1780+
<Component Id="rtl.static.unbound.amd64.msm" Directory="RedistVersion" Condition="INSTALLAMD64REDISTUNBOUND" DiskId="3">
17781781
<File Source="!(bindpath.rtl.static.unbound.amd64.msm)\rtl.static.unbound.amd64.msm" />
17791782
</Component>
17801783
<?endif?>
17811784

17821785
<?if $(IncludeX86) == True?>
1783-
<Component Id="rtl.shared.bound.x86.msm" Directory="RedistVersion" Condition="INSTALLX86REDIST" DiskId="4">
1786+
<Component Id="rtl.shared.bound.x86.msm" Directory="RedistVersion" Condition="INSTALLX86REDISTBOUND" DiskId="4">
17841787
<File Source="!(bindpath.rtl.shared.bound.x86.msm)\rtl.shared.bound.x86.msm" />
17851788
</Component>
17861789

1787-
<Component Id="rtl.shared.unbound.x86.msm" Directory="RedistVersion" Condition="INSTALLX86REDIST" DiskId="4">
1790+
<Component Id="rtl.shared.unbound.x86.msm" Directory="RedistVersion" Condition="INSTALLX86REDISTUNBOUND" DiskId="4">
17881791
<File Source="!(bindpath.rtl.shared.unbound.x86.msm)\rtl.shared.unbound.x86.msm" />
17891792
</Component>
17901793

1791-
<Component Id="rtl.static.bound.x86.msm" Directory="RedistVersion" Condition="INSTALLX86REDIST" DiskId="4">
1794+
<Component Id="rtl.static.bound.x86.msm" Directory="RedistVersion" Condition="INSTALLX86REDISTBOUND" DiskId="4">
17921795
<File Source="!(bindpath.rtl.static.bound.x86.msm)\rtl.static.bound.x86.msm" />
17931796
</Component>
17941797

1795-
<Component Id="rtl.static.unbound.x86.msm" Directory="RedistVersion" Condition="INSTALLX86REDIST" DiskId="4">
1798+
<Component Id="rtl.static.unbound.x86.msm" Directory="RedistVersion" Condition="INSTALLX86REDISTUNBOUND" DiskId="4">
17961799
<File Source="!(bindpath.rtl.static.unbound.x86.msm)\rtl.static.unbound.x86.msm" />
17971800
</Component>
17981801
<?endif?>

platforms/Windows/readme.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,11 @@ The bundle authoring (in `installer.wxs`) drives optional install directory and
4545
| OptionsInstallAssertsToolchain | Controls whether the Assert variant of the toolchain is installed. |
4646
| OptionsInstallNoAssertsToolchain | Controls whether the NoAssert variant of the toolchain is installed. |
4747
| OptionsInstallWindowsPlatform | Controls whether the Windows platform will be installed. |
48-
| OptionsInstallWindowsSDKX86 | Controls whether the Windows X86 SDK will be installed. |
49-
| OptionsInstallWindowsRedistAMD64 | Controls whether the Windows AMD64 Redistributable MSM will be installed. |
5048
| OptionsInstallWindowsSDKAMD64 | Controls whether the Windows AMD64 SDK will be installed. |
51-
| OptionsInstallWindowsRedistARM64 | Controls whether the Windows ARM64 Redistributable MSM will be installed. |
49+
| OptionsInstallWindowsSDKARM64 | Controls whether the Windows ARM64 SDK will be installed. |
5250
| OptionsInstallWindowsSDKX86 | Controls whether the Windows X86 SDK will be installed. |
53-
| OptionsInstallWindowsRedistX86 | Controls whether the Windows X86 Redistributable MSM will be installed. |
51+
| OptionsInstallWindowsRedistBound{AMD64,ARM64,X86} | Controls whether the matching SxS redistributable MSMs will be installed. |
52+
| OptionsInstallWindowsRedistUnbound{AMD64,ARM64,X86} | Controls whether the matching flat redistributable MSMs will be installed. |
5453

5554
Those variables are tied to controls in the bundle theme (`installer\theme.xml`) on the Options page. For example, the install directory is an `Editbox` control that takes the `InstallRoot` name to tie itself to the `InstallRoot` variable in `installer.wxs`:
5655

platforms/Windows/shared/swift.en-us.wxl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@
6161
<String Id="OptionsDefaultToolchainLabel" Value="Default Variant" />
6262
<String Id="OptionsDefaultAsserts" Value="Asserts" />
6363
<String Id="OptionsDefaultNoAsserts" Value="No Asserts" />
64-
<String Id="Redist" Value="Redistributable" />
64+
<String Id="Redist_bound" Value="Redistributable (SxS)" />
65+
<String Id="Redist_unbound" Value="Redistributable (flat)" />
6566

6667
<String Id="SwiftSourceFileDescription" Value="Swift Source File" />
6768
<String Id="SwiftModuleFileDescription" Value="Swift Interface Definition (binary)" />

0 commit comments

Comments
 (0)