Skip to content

Commit 7b311d7

Browse files
committed
WiX: add bound runtime MSMs
Build bound variants for both shared and static runtime merge modules, so redistributables cover the full linkage x SxS layout x architecture matrix. The bound layout places each DLL in a basename directory for private SxS binding, while the unbound layout keeps the existing flat runtime directory. Separate module GUIDs and intermediate paths keep the variants distinct.
1 parent f4fe3a2 commit 7b311d7

11 files changed

Lines changed: 128 additions & 34 deletions

File tree

platforms/Windows/Directory.Build.props

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
<PropertyGroup>
1010
<ProductArchitecture Condition=" '$(ProductArchitecture)' == '' ">amd64</ProductArchitecture>
1111
<ProductVersion Condition=" '$(ProductVersion)' == '' ">0.0.0</ProductVersion>
12+
<MergeModuleStyle Condition=" '$(MergeModuleStyle)' == '' and ( '$(MSBuildProjectName)' == 'rtl.shared.msm' or '$(MSBuildProjectName)' == 'rtl.static.msm' ) ">bound</MergeModuleStyle>
13+
<RuntimeLibraryLayout Condition=" '$(RuntimeLibraryLayout)' == '' and '$(MergeModuleStyle)' == 'bound' ">bound</RuntimeLibraryLayout>
14+
<RuntimeLibraryLayout Condition=" '$(RuntimeLibraryLayout)' == '' ">unbound</RuntimeLibraryLayout>
1215
</PropertyGroup>
1316

1417
<PropertyGroup>
@@ -88,6 +91,8 @@
8891
WindowsRuntimeARM64=$(WindowsRuntimeARM64);
8992
WindowsRuntimeX64=$(WindowsRuntimeX64);
9093
WindowsRuntimeX86=$(WindowsRuntimeX86);
94+
MergeModuleStyle=$(MergeModuleStyle);
95+
RuntimeLibraryLayout=$(RuntimeLibraryLayout);
9196
</DefineConstants>
9297
</PropertyGroup>
9398

platforms/Windows/platforms/windows/windows.wixproj

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,23 @@
2727
</ItemGroup>
2828

2929
<ItemGroup Condition=" $(WindowsArchitectures.Contains('i686')) ">
30-
<ProjectReference Include="..\..\rtl\shared\msm\rtl.shared.msm.wixproj" Properties="Platform=x86;ProductArchitecture=x86" BindName="rtl.shared.unbound.x86.msm" />
31-
<ProjectReference Include="..\..\rtl\static\msm\rtl.static.msm.wixproj" Properties="Platform=x86;ProductArchitecture=x86" BindName="rtl.static.unbound.x86.msm" />
30+
<ProjectReference Include="..\..\rtl\shared\msm\rtl.shared.msm.wixproj" Properties="Platform=x86;ProductArchitecture=x86;MergeModuleStyle=bound" BindName="rtl.shared.bound.x86.msm" />
31+
<ProjectReference Include="..\..\rtl\shared\msm\rtl.shared.msm.wixproj" Properties="Platform=x86;ProductArchitecture=x86;MergeModuleStyle=unbound" BindName="rtl.shared.unbound.x86.msm" />
32+
<ProjectReference Include="..\..\rtl\static\msm\rtl.static.msm.wixproj" Properties="Platform=x86;ProductArchitecture=x86;MergeModuleStyle=bound" BindName="rtl.static.bound.x86.msm" />
33+
<ProjectReference Include="..\..\rtl\static\msm\rtl.static.msm.wixproj" Properties="Platform=x86;ProductArchitecture=x86;MergeModuleStyle=unbound" BindName="rtl.static.unbound.x86.msm" />
3234
</ItemGroup>
3335

3436
<ItemGroup Condition=" $(WindowsArchitectures.Contains('x86_64')) ">
35-
<ProjectReference Include="..\..\rtl\shared\msm\rtl.shared.msm.wixproj" Properties="Platform=x86;ProductArchitecture=amd64" BindName="rtl.shared.unbound.amd64.msm" />
36-
<ProjectReference Include="..\..\rtl\static\msm\rtl.static.msm.wixproj" Properties="Platform=x86;ProductArchitecture=amd64" BindName="rtl.static.unbound.amd64.msm" />
37+
<ProjectReference Include="..\..\rtl\shared\msm\rtl.shared.msm.wixproj" Properties="Platform=x86;ProductArchitecture=amd64;MergeModuleStyle=bound" BindName="rtl.shared.bound.amd64.msm" />
38+
<ProjectReference Include="..\..\rtl\shared\msm\rtl.shared.msm.wixproj" Properties="Platform=x86;ProductArchitecture=amd64;MergeModuleStyle=unbound" BindName="rtl.shared.unbound.amd64.msm" />
39+
<ProjectReference Include="..\..\rtl\static\msm\rtl.static.msm.wixproj" Properties="Platform=x86;ProductArchitecture=amd64;MergeModuleStyle=bound" BindName="rtl.static.bound.amd64.msm" />
40+
<ProjectReference Include="..\..\rtl\static\msm\rtl.static.msm.wixproj" Properties="Platform=x86;ProductArchitecture=amd64;MergeModuleStyle=unbound" BindName="rtl.static.unbound.amd64.msm" />
3741
</ItemGroup>
3842

3943
<ItemGroup Condition=" $(WindowsArchitectures.Contains('aarch64')) ">
40-
<ProjectReference Include="..\..\rtl\shared\msm\rtl.shared.msm.wixproj" Properties="Platform=x86;ProductArchitecture=arm64" BindName="rtl.shared.unbound.arm64.msm" />
41-
<ProjectReference Include="..\..\rtl\static\msm\rtl.static.msm.wixproj" Properties="Platform=x86;ProductArchitecture=arm64" BindName="rtl.static.unbound.arm64.msm" />
44+
<ProjectReference Include="..\..\rtl\shared\msm\rtl.shared.msm.wixproj" Properties="Platform=x86;ProductArchitecture=arm64;MergeModuleStyle=bound" BindName="rtl.shared.bound.arm64.msm" />
45+
<ProjectReference Include="..\..\rtl\shared\msm\rtl.shared.msm.wixproj" Properties="Platform=x86;ProductArchitecture=arm64;MergeModuleStyle=unbound" BindName="rtl.shared.unbound.arm64.msm" />
46+
<ProjectReference Include="..\..\rtl\static\msm\rtl.static.msm.wixproj" Properties="Platform=x86;ProductArchitecture=arm64;MergeModuleStyle=bound" BindName="rtl.static.bound.arm64.msm" />
47+
<ProjectReference Include="..\..\rtl\static\msm\rtl.static.msm.wixproj" Properties="Platform=x86;ProductArchitecture=arm64;MergeModuleStyle=unbound" BindName="rtl.static.unbound.arm64.msm" />
4248
</ItemGroup>
4349
</Project>

platforms/Windows/platforms/windows/windows.wxs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1744,30 +1744,54 @@
17441744

17451745
<!-- Redistributables -->
17461746
<?if $(IncludeARM64) == True?>
1747+
<Component Id="rtl.shared.bound.arm64.msm" Directory="RedistVersion" Condition="INSTALLARM64REDIST" DiskId="2">
1748+
<File Source="!(bindpath.rtl.shared.bound.arm64.msm)\rtl.shared.bound.arm64.msm" />
1749+
</Component>
1750+
17471751
<Component Id="rtl.shared.unbound.arm64.msm" Directory="RedistVersion" Condition="INSTALLARM64REDIST" DiskId="2">
17481752
<File Source="!(bindpath.rtl.shared.unbound.arm64.msm)\rtl.shared.unbound.arm64.msm" />
17491753
</Component>
17501754

1755+
<Component Id="rtl.static.bound.arm64.msm" Directory="RedistVersion" Condition="INSTALLARM64REDIST" DiskId="2">
1756+
<File Source="!(bindpath.rtl.static.bound.arm64.msm)\rtl.static.bound.arm64.msm" />
1757+
</Component>
1758+
17511759
<Component Id="rtl.static.unbound.arm64.msm" Directory="RedistVersion" Condition="INSTALLARM64REDIST" DiskId="2">
17521760
<File Source="!(bindpath.rtl.static.unbound.arm64.msm)\rtl.static.unbound.arm64.msm" />
17531761
</Component>
17541762
<?endif?>
17551763

17561764
<?if $(IncludeX64) == True?>
1765+
<Component Id="rtl.shared.bound.amd64.msm" Directory="RedistVersion" Condition="INSTALLAMD64REDIST" DiskId="3">
1766+
<File Source="!(bindpath.rtl.shared.bound.amd64.msm)\rtl.shared.bound.amd64.msm" />
1767+
</Component>
1768+
17571769
<Component Id="rtl.shared.unbound.amd64.msm" Directory="RedistVersion" Condition="INSTALLAMD64REDIST" DiskId="3">
17581770
<File Source="!(bindpath.rtl.shared.unbound.amd64.msm)\rtl.shared.unbound.amd64.msm" />
17591771
</Component>
17601772

1773+
<Component Id="rtl.static.bound.amd64.msm" Directory="RedistVersion" Condition="INSTALLAMD64REDIST" DiskId="3">
1774+
<File Source="!(bindpath.rtl.static.bound.amd64.msm)\rtl.static.bound.amd64.msm" />
1775+
</Component>
1776+
17611777
<Component Id="rtl.static.unbound.amd64.msm" Directory="RedistVersion" Condition="INSTALLAMD64REDIST" DiskId="3">
17621778
<File Source="!(bindpath.rtl.static.unbound.amd64.msm)\rtl.static.unbound.amd64.msm" />
17631779
</Component>
17641780
<?endif?>
17651781

17661782
<?if $(IncludeX86) == True?>
1783+
<Component Id="rtl.shared.bound.x86.msm" Directory="RedistVersion" Condition="INSTALLX86REDIST" DiskId="4">
1784+
<File Source="!(bindpath.rtl.shared.bound.x86.msm)\rtl.shared.bound.x86.msm" />
1785+
</Component>
1786+
17671787
<Component Id="rtl.shared.unbound.x86.msm" Directory="RedistVersion" Condition="INSTALLX86REDIST" DiskId="4">
17681788
<File Source="!(bindpath.rtl.shared.unbound.x86.msm)\rtl.shared.unbound.x86.msm" />
17691789
</Component>
17701790

1791+
<Component Id="rtl.static.bound.x86.msm" Directory="RedistVersion" Condition="INSTALLX86REDIST" DiskId="4">
1792+
<File Source="!(bindpath.rtl.static.bound.x86.msm)\rtl.static.bound.x86.msm" />
1793+
</Component>
1794+
17711795
<Component Id="rtl.static.unbound.x86.msm" Directory="RedistVersion" Condition="INSTALLX86REDIST" DiskId="4">
17721796
<File Source="!(bindpath.rtl.static.unbound.x86.msm)\rtl.static.unbound.x86.msm" />
17731797
</Component>
@@ -1851,7 +1875,9 @@
18511875
<ComponentGroupRef Id="Registrar.arm64" />
18521876

18531877
<!-- Redistributable -->
1878+
<ComponentRef Id="rtl.shared.bound.arm64.msm" />
18541879
<ComponentRef Id="rtl.shared.unbound.arm64.msm" />
1880+
<ComponentRef Id="rtl.static.bound.arm64.msm" />
18551881
<ComponentRef Id="rtl.static.unbound.arm64.msm" />
18561882
</Feature>
18571883
<?endif?>
@@ -1871,7 +1897,9 @@
18711897
<ComponentGroupRef Id="Registrar.x64" />
18721898

18731899
<!-- Redistributable -->
1900+
<ComponentRef Id="rtl.shared.bound.amd64.msm" />
18741901
<ComponentRef Id="rtl.shared.unbound.amd64.msm" />
1902+
<ComponentRef Id="rtl.static.bound.amd64.msm" />
18751903
<ComponentRef Id="rtl.static.unbound.amd64.msm" />
18761904
</Feature>
18771905
<?endif?>
@@ -1891,7 +1919,9 @@
18911919
<ComponentGroupRef Id="Registrar.x86" />
18921920

18931921
<!-- Redistributable -->
1922+
<ComponentRef Id="rtl.shared.bound.x86.msm" />
18941923
<ComponentRef Id="rtl.shared.unbound.x86.msm" />
1924+
<ComponentRef Id="rtl.static.bound.x86.msm" />
18951925
<ComponentRef Id="rtl.static.unbound.x86.msm" />
18961926
</Feature>
18971927
<?endif?>

platforms/Windows/readme.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,9 @@ Redistributable merge-module names are a matrix of linkage, SxS layout, and arch
355355

356356
| Linkage | SxS layout | x86 | amd64 | arm64 |
357357
| ------- | ---------- | --- | ----- | ----- |
358+
| shared | bound | `rtl.shared.bound.x86.msm` | `rtl.shared.bound.amd64.msm` | `rtl.shared.bound.arm64.msm` |
358359
| shared | unbound | `rtl.shared.unbound.x86.msm` | `rtl.shared.unbound.amd64.msm` | `rtl.shared.unbound.arm64.msm` |
360+
| static | bound | `rtl.static.bound.x86.msm` | `rtl.static.bound.amd64.msm` | `rtl.static.bound.arm64.msm` |
359361
| static | unbound | `rtl.static.unbound.x86.msm` | `rtl.static.unbound.amd64.msm` | `rtl.static.unbound.arm64.msm` |
360362

361-
The `shared` modules install the full shared runtime. The `static` modules install the stable static-link support DLLs, `BlocksRuntime.dll` and `dispatch.dll`. The `unbound` layout installs DLLs directly in the runtime directory.
363+
The `shared` modules install the full shared runtime. The `static` modules install the stable static-link support DLLs, `BlocksRuntime.dll` and `dispatch.dll`. The `bound` layout installs each DLL under a basename directory, for example `swiftCore\swiftCore.dll`, so applications can use private SxS binding by name. The `unbound` layout installs DLLs directly in the runtime directory.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<Project Sdk="WixToolset.Sdk/7.0.0">
22
<PropertyGroup>
3-
<OutputName>rtl.shared.$(ProductArchitecture)</OutputName>
3+
<OutputName>rtl.shared.$(RuntimeLibraryLayout).$(ProductArchitecture)</OutputName>
44
<OutputType>Library</OutputType>
55
<BindFiles>true</BindFiles>
6+
<RuntimeLibraryConsumer Condition=" '$(RuntimeLibraryConsumer)' == '' ">standalone</RuntimeLibraryConsumer>
7+
<IntermediateOutputPath>$(BaseIntermediateOutputPath)$(RuntimeLibraryConsumer)\$(ProductArchitecture)\$(RuntimeLibraryLayout)\$(Configuration)\</IntermediateOutputPath>
68
</PropertyGroup>
79
</Project>

platforms/Windows/rtl/shared/lib/rtl.shared.lib.wxs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,25 @@
1313
<?define LibexecDirectoryComponentGuidGenerationSeed = "FCAC627D-44EC-4745-B81B-E12CE8F80951" ?>
1414
<?define RuntimeRoot = $(WindowsRuntimeX86)?>
1515
<?endif?>
16-
<Directory Id="RUNTIMEDIR_$(ProductArchitecture)" ComponentGuidGenerationSeed="$(RuntimeDirectoryComponentGuidGenerationSeed)" />
16+
<Directory Id="RUNTIMEDIR_$(ProductArchitecture)" ComponentGuidGenerationSeed="$(RuntimeDirectoryComponentGuidGenerationSeed)">
17+
<?if $(RuntimeLibraryLayout) == bound ?>
18+
<?foreach RuntimeLibrary in $(RuntimeLibraries)?>
19+
<Directory Id="RL_$(RuntimeLibrary)" Name="$(RuntimeLibrary)" />
20+
<?endforeach?>
21+
<?endif?>
22+
</Directory>
1723
<Directory Id="LIBEXECDIR_$(ProductArchitecture)" ComponentGuidGenerationSeed="$(LibexecDirectoryComponentGuidGenerationSeed)" />
1824

1925
<?foreach RuntimeLibrary in $(RuntimeLibraries)?>
20-
<ComponentGroup Id="RuntimeLibrary_$(RuntimeLibrary)_$(ProductArchitecture)" Directory="RUNTIMEDIR_$(ProductArchitecture)">
21-
<File Source="$(RuntimeRoot)\usr\bin\$(RuntimeLibrary).dll" />
22-
</ComponentGroup>
26+
<?if $(RuntimeLibraryLayout) == bound ?>
27+
<ComponentGroup Id="RuntimeLibrary_$(RuntimeLibrary)_$(ProductArchitecture)" Directory="RL_$(RuntimeLibrary)">
28+
<File Source="$(RuntimeRoot)\usr\bin\$(RuntimeLibrary).dll" />
29+
</ComponentGroup>
30+
<?else?>
31+
<ComponentGroup Id="RuntimeLibrary_$(RuntimeLibrary)_$(ProductArchitecture)" Directory="RUNTIMEDIR_$(ProductArchitecture)">
32+
<File Source="$(RuntimeRoot)\usr\bin\$(RuntimeLibrary).dll" />
33+
</ComponentGroup>
34+
<?endif?>
2335
<?endforeach?>
2436

2537
<ComponentGroup Id="plutil_$(ProductArchitecture)" Directory="RUNTIMEDIR_$(ProductArchitecture)">

platforms/Windows/rtl/shared/msi/rtl.shared.msi.wixproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@
88
</PropertyGroup>
99

1010
<ItemGroup Condition=" '$(ProductArchitecture)' == 'amd64' ">
11-
<ProjectReference Include="..\lib\rtl.shared.lib.wixproj" Properties="ProductArchitecture=amd64;Platform=x64" />
11+
<ProjectReference Include="..\lib\rtl.shared.lib.wixproj" Properties="ProductArchitecture=amd64;Platform=x64;RuntimeLibraryConsumer=msi" />
1212
</ItemGroup>
1313

1414
<ItemGroup Condition=" '$(ProductArchitecture)' == 'arm64' ">
15-
<ProjectReference Include="..\lib\rtl.shared.lib.wixproj" Properties="ProductArchitecture=arm64;Platform=arm64" />
15+
<ProjectReference Include="..\lib\rtl.shared.lib.wixproj" Properties="ProductArchitecture=arm64;Platform=arm64;RuntimeLibraryConsumer=msi" />
1616
</ItemGroup>
1717

1818
<ItemGroup Condition=" '$(ProductArchitecture)' == 'x86' ">
19-
<ProjectReference Include="..\lib\rtl.shared.lib.wixproj" Properties="ProductArchitecture=x86;Platform=x86" />
19+
<ProjectReference Include="..\lib\rtl.shared.lib.wixproj" Properties="ProductArchitecture=x86;Platform=x86;RuntimeLibraryConsumer=msi" />
2020
</ItemGroup>
2121
</Project>
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
<Project Sdk="WixToolset.Sdk/7.0.0">
22
<PropertyGroup>
33
<OutputType>Module</OutputType>
4-
<OutputName>rtl.shared.unbound.$(ProductArchitecture)</OutputName>
4+
<OutputName>rtl.shared.$(MergeModuleStyle).$(ProductArchitecture)</OutputName>
5+
<IntermediateOutputPath>$(BaseIntermediateOutputPath)$(ProductArchitecture)\$(MergeModuleStyle)\$(Configuration)\</IntermediateOutputPath>
56
</PropertyGroup>
67

78
<ItemGroup Condition=" '$(ProductArchitecture)' == 'amd64' ">
8-
<ProjectReference Include="..\lib\rtl.shared.lib.wixproj" Properties="ProductArchitecture=amd64;Platform=x64" />
9+
<ProjectReference Include="..\lib\rtl.shared.lib.wixproj" Properties="ProductArchitecture=amd64;Platform=x64;RuntimeLibraryLayout=$(RuntimeLibraryLayout);RuntimeLibraryConsumer=msm" />
910
</ItemGroup>
1011

1112
<ItemGroup Condition=" '$(ProductArchitecture)' == 'arm64' ">
12-
<ProjectReference Include="..\lib\rtl.shared.lib.wixproj" Properties="ProductArchitecture=arm64;Platform=arm64" />
13+
<ProjectReference Include="..\lib\rtl.shared.lib.wixproj" Properties="ProductArchitecture=arm64;Platform=arm64;RuntimeLibraryLayout=$(RuntimeLibraryLayout);RuntimeLibraryConsumer=msm" />
1314
</ItemGroup>
1415

1516
<ItemGroup Condition=" '$(ProductArchitecture)' == 'x86' ">
16-
<ProjectReference Include="..\lib\rtl.shared.lib.wixproj" Properties="ProductArchitecture=x86;Platform=x86" />
17+
<ProjectReference Include="..\lib\rtl.shared.lib.wixproj" Properties="ProductArchitecture=x86;Platform=x86;RuntimeLibraryLayout=$(RuntimeLibraryLayout);RuntimeLibraryConsumer=msm" />
1718
</ItemGroup>
1819
</Project>

platforms/Windows/rtl/shared/msm/rtl.shared.msm.wxs

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,21 @@
11
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
22

3-
<?if $(sys.BUILDARCH) == x64 ?>
4-
<?define ModuleId = "18546442-4BD6-4B39-B030-7B4F46CF07F8" ?>
5-
<?elseif $(sys.BUILDARCH) == arm64 ?>
6-
<?define ModuleId = "41013040-0B93-4BA0-8544-9437366AD3CF" ?>
7-
<?elseif $(sys.BUILDARCH) == x86 ?>
8-
<?define ModuleId = "B4250F08-F3A0-4A7A-A27D-24CC473D5F16" ?>
3+
<?if $(MergeModuleStyle) == unbound ?>
4+
<?if $(sys.BUILDARCH) == x64 ?>
5+
<?define ModuleId = "18546442-4BD6-4B39-B030-7B4F46CF07F8" ?>
6+
<?elseif $(sys.BUILDARCH) == arm64 ?>
7+
<?define ModuleId = "41013040-0B93-4BA0-8544-9437366AD3CF" ?>
8+
<?elseif $(sys.BUILDARCH) == x86 ?>
9+
<?define ModuleId = "B4250F08-F3A0-4A7A-A27D-24CC473D5F16" ?>
10+
<?endif?>
11+
<?else?>
12+
<?if $(sys.BUILDARCH) == x64 ?>
13+
<?define ModuleId = "36C641BB-E16D-5029-BF71-D0007BF6B754" ?>
14+
<?elseif $(sys.BUILDARCH) == arm64 ?>
15+
<?define ModuleId = "D6D19072-8406-589D-BB68-294D03A83629" ?>
16+
<?elseif $(sys.BUILDARCH) == x86 ?>
17+
<?define ModuleId = "BB062D97-E8C3-5BBA-9E25-3C369DBF55FE" ?>
18+
<?endif?>
919
<?endif?>
1020

1121
<Module Guid="$(ModuleId)" Id="swift_runtime" Language="0" Version="$(NonSemVerProductVersion)">
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<Project Sdk="WixToolset.Sdk/7.0.0">
22
<PropertyGroup>
33
<OutputType>Module</OutputType>
4-
<OutputName>rtl.static.unbound.$(ProductArchitecture)</OutputName>
4+
<OutputName>rtl.static.$(MergeModuleStyle).$(ProductArchitecture)</OutputName>
5+
<IntermediateOutputPath>$(BaseIntermediateOutputPath)$(ProductArchitecture)\$(MergeModuleStyle)\$(Configuration)\</IntermediateOutputPath>
56
</PropertyGroup>
67
</Project>

0 commit comments

Comments
 (0)