Skip to content

Commit 73052f4

Browse files
committed
WiX: restructure the toolchain MSI
This restructures the MSIs into a slightly more granular set of MSIs. It reduces the size of the single MSI making the installer proceed a bit more uniformly. bld: Build Tools (binutils, compilers, linker, assembler) cli: Command Line Tools (clang-format, clang-tidy, swift-api-digester, swift-symbolgraph-extract, swift-package-manager) dbg: Debugging Tools (lldb, repl) ide: IDE Integration Tools (clangd, lldb-vscode, sourcekitd, SourceKit-LSP) In the future, this also provides a logical location for DocC (cli), swift-inspect (dbg), and swift-format (cli). Take the opportunity to use the higher compression by default on all the MSIs. This also removes `swift-build-tool` and `swift-build-sdk-interfaces` until we have a need for them. Simultaneously, we are taking advantage of the WiX 4.0 feature to create a dual-purpose MSI. Unfortunately, burn does not support dual-purpose builds and this implicitly migrates the toolchain to a per-user install currently. However, this is desirable as it will likely provide a space free install path along with removing the need for administrator rights.
1 parent 8db2538 commit 73052f4

File tree

11 files changed

+1010
-940
lines changed

11 files changed

+1010
-940
lines changed

platforms/Windows/toolchain.wixproj renamed to platforms/Windows/bld.wixproj

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,28 @@
2020

2121
<PropertyGroup>
2222
<DefineConstants>ProductArchitecture=$(ProductArchitecture);ProductVersion=$(ProductVersion);DEVTOOLS_ROOT=$(DEVTOOLS_ROOT);TOOLCHAIN_ROOT=$(TOOLCHAIN_ROOT);TOOLCHAIN_ROOT_USR_LIB_CLANG=$(TOOLCHAIN_ROOT)\usr\lib\clang</DefineConstants>
23-
<InstallerPlatform Condition=" '$(ProductArchitecture)' == 'amd64' ">x64</InstallerPlatform>
24-
<InstallerPlatform Condition=" '$(ProductArchitecture)' == 'arm64' ">arm64</InstallerPlatform>
2523
</PropertyGroup>
2624

2725
<PropertyGroup>
2826
<HarvestNoLogo>true</HarvestNoLogo>
2927
<HarvestGenerateGuidsNow>true</HarvestGenerateGuidsNow>
3028
</PropertyGroup>
3129

30+
<PropertyGroup Condition=" '$(ProductArchitecture)' == 'amd64' ">
31+
<InstallerPlatform>x64</InstallerPlatform>
32+
</PropertyGroup>
33+
<PropertyGroup Condition=" '$(ProductArchitecture)' == 'arm64' ">
34+
<InstallerPlatform>arm64</InstallerPlatform>
35+
<InstallerVersion>500</InstallerVersion>
36+
</PropertyGroup>
37+
<PropertyGroup Condition=" '$(ProductArchitecture)' == 'arm' ">
38+
<InstallerPlatform>arm</InstallerPlatform>
39+
<InstallerVersion>500</InstallerVersion>
40+
</PropertyGroup>
41+
<PropertyGroup Condition=" '$(ProductArchitecture)' == 'x86' ">
42+
<InstallerPlatform>x86</InstallerPlatform>
43+
</PropertyGroup>
44+
3245
<ItemGroup>
3346
<PackageReference Include="WixToolset.UI.wixext" Version="4.0.0" />
3447
<PackageReference Include="WixToolset.Heat" Version="4.0.0" />
@@ -44,6 +57,6 @@
4457
<SuppressRootDirectory>true</SuppressRootDirectory>
4558
</HarvestDirectory>
4659

47-
<Compile Include="toolchain.wxs" />
60+
<Compile Include="bld.wxs" />
4861
</ItemGroup>
4962
</Project>

platforms/Windows/bld.wxs

Lines changed: 389 additions & 0 deletions
Large diffs are not rendered by default.

platforms/Windows/cli.wixproj

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<Project Sdk="WixToolset.Sdk/4.0.0">
2+
<PropertyGroup>
3+
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
4+
</PropertyGroup>
5+
6+
<PropertyGroup>
7+
<ProductArchitecture Condition=" '$(ProductArchitecture)' == '' ">amd64</ProductArchitecture>
8+
<ProductArchitecture>$(ProductArchitecture)</ProductArchitecture>
9+
10+
<ProductVersion Condition=" '$(ProductVersion)' == '' ">0.0.0</ProductVersion>
11+
<ProductVersion>$(ProductVersion)</ProductVersion>
12+
</PropertyGroup>
13+
14+
<PropertyGroup>
15+
<OutputPath>build\</OutputPath>
16+
<IntermediateOutputPath>build\obj\</IntermediateOutputPath>
17+
</PropertyGroup>
18+
19+
<Import Project="WiXCodeSigning.targets" />
20+
21+
<PropertyGroup>
22+
<DefineConstants>ProductArchitecture=$(ProductArchitecture);ProductVersion=$(ProductVersion);DEVTOOLS_ROOT=$(DEVTOOLS_ROOT);TOOLCHAIN_ROOT=$(TOOLCHAIN_ROOT);</DefineConstants>
23+
</PropertyGroup>
24+
25+
<PropertyGroup Condition=" '$(ProductArchitecture)' == 'amd64' ">
26+
<InstallerPlatform>x64</InstallerPlatform>
27+
</PropertyGroup>
28+
<PropertyGroup Condition=" '$(ProductArchitecture)' == 'arm64' ">
29+
<InstallerPlatform>arm64</InstallerPlatform>
30+
<InstallerVersion>500</InstallerVersion>
31+
</PropertyGroup>
32+
<PropertyGroup Condition=" '$(ProductArchitecture)' == 'arm' ">
33+
<InstallerPlatform>arm</InstallerPlatform>
34+
<InstallerVersion>500</InstallerVersion>
35+
</PropertyGroup>
36+
<PropertyGroup Condition=" '$(ProductArchitecture)' == 'x86' ">
37+
<InstallerPlatform>x86</InstallerPlatform>
38+
</PropertyGroup>
39+
40+
<ItemGroup>
41+
<PackageReference Include="WixToolset.UI.wixext" Version="4.0.0" />
42+
</ItemGroup>
43+
44+
<ItemGroup>
45+
<Compile Include="cli.wxs" />
46+
</ItemGroup>
47+
</Project>

platforms/Windows/cli.wxs

Lines changed: 275 additions & 0 deletions
Large diffs are not rendered by default.

platforms/Windows/devtools.wixproj renamed to platforms/Windows/dbg.wixproj

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,29 @@
1919
<Import Project="WiXCodeSigning.targets" />
2020

2121
<PropertyGroup>
22-
<DefineConstants>ProductArchitecture=$(ProductArchitecture);ProductVersion=$(ProductVersion);DEVTOOLS_ROOT=$(DEVTOOLS_ROOT);</DefineConstants>
23-
<InstallerPlatform Condition=" '$(ProductArchitecture)' == 'amd64' ">x64</InstallerPlatform>
24-
<InstallerPlatform Condition=" '$(ProductArchitecture)' == 'arm64' ">arm64</InstallerPlatform>
22+
<DefineConstants>ProductArchitecture=$(ProductArchitecture);ProductVersion=$(ProductVersion);DEVTOOLS_ROOT=$(DEVTOOLS_ROOT);TOOLCHAIN_ROOT=$(TOOLCHAIN_ROOT)</DefineConstants>
23+
</PropertyGroup>
24+
25+
<PropertyGroup Condition=" '$(ProductArchitecture)' == 'amd64' ">
26+
<InstallerPlatform>x64</InstallerPlatform>
27+
</PropertyGroup>
28+
<PropertyGroup Condition=" '$(ProductArchitecture)' == 'arm64' ">
29+
<InstallerPlatform>arm64</InstallerPlatform>
30+
<InstallerVersion>500</InstallerVersion>
31+
</PropertyGroup>
32+
<PropertyGroup Condition=" '$(ProductArchitecture)' == 'arm' ">
33+
<InstallerPlatform>arm</InstallerPlatform>
34+
<InstallerVersion>500</InstallerVersion>
35+
</PropertyGroup>
36+
<PropertyGroup Condition=" '$(ProductArchitecture)' == 'x86' ">
37+
<InstallerPlatform>x86</InstallerPlatform>
2538
</PropertyGroup>
2639

2740
<ItemGroup>
2841
<PackageReference Include="WixToolset.UI.wixext" Version="4.0.0" />
2942
</ItemGroup>
3043

3144
<ItemGroup>
32-
<Compile Include="devtools.wxs" />
45+
<Compile Include="dbg.wxs" />
3346
</ItemGroup>
3447
</Project>

platforms/Windows/dbg.wxs

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
2+
<?include version.wxi?>
3+
<Package
4+
Language="1033"
5+
Manufacturer="swift.org"
6+
Name="Swift Debugging Tools"
7+
UpgradeCode="91d382af-1e92-44dc-a4ad-aee91c1b5160"
8+
Version="$(var.ProductVersion)"
9+
Scope="perUserOrMachine">
10+
<SummaryInformation Description="Swift Debugging Tools" />
11+
12+
<Media Id="1" Cabinet="dbg.cab" EmbedCab="yes" CompressionLevel="high" />
13+
14+
<StandardDirectory Id="ProgramFiles64Folder">
15+
<Directory Id="INSTALLDIR" Name="Swift">
16+
<Directory Id="Toolchains" Name="Toolchains">
17+
<Directory Id="xctoolchain" Name="$(var.ProductVersion)+Asserts">
18+
<Directory Id="_usr" Name="usr">
19+
<Directory Id="_usr_bin" Name="bin">
20+
</Directory>
21+
<Directory Id="_usr_lib" Name="lib">
22+
<Directory Id="_usr_lib_site_packages" Name="site-packages">
23+
<Directory Id="_usr_lib_site_packages_lldb" Name="lldb">
24+
<Directory Id="_usr_lib_site_packages_lldb_formatters" Name="formatters">
25+
<Directory Id="_usr_lib_site_packages_lldb_formatters_cpp" Name="cpp">
26+
</Directory>
27+
</Directory>
28+
<Directory Id="_usr_lib_site_packages_lldb_utils" Name="utils">
29+
</Directory>
30+
</Directory>
31+
</Directory>
32+
</Directory>
33+
</Directory>
34+
</Directory>
35+
</Directory>
36+
</Directory>
37+
</StandardDirectory>
38+
39+
<ComponentGroup Id="lldb">
40+
<Component Directory="_usr_bin" Id="lldb.exe">
41+
<File Id="lldb.exe" Source="$(var.TOOLCHAIN_ROOT)\usr\bin\lldb.exe" Checksum="yes" KeyPath="yes" />
42+
</Component>
43+
44+
<Component Directory="_usr_bin" Id="liblldb.dll">
45+
<File Id="liblldb.dll" Source="$(var.TOOLCHAIN_ROOT)\usr\bin\liblldb.dll" Checksum="yes" KeyPath="yes" />
46+
</Component>
47+
48+
<Component Directory="_usr_lib" Id="liblldb.lib">
49+
<File Id="liblldb.lib" Source="$(var.TOOLCHAIN_ROOT)\usr\lib\liblldb.lib" Checksum="yes" KeyPath="yes" />
50+
</Component>
51+
52+
<Component Directory="_usr_lib_site_packages_lldb" Id="__init__.py_c31e016e2f8b4fba9eebd73d5009e919">
53+
<File Id="___init__.py_c31e016e2f8b4fba9eebd73d5009e919" Source="$(var.TOOLCHAIN_ROOT)\usr\lib\site-packages\lldb\__init__.py" Checksum="yes" KeyPath="yes" />
54+
</Component>
55+
<Component Directory="_usr_lib_site_packages_lldb" Id="_lldb.py">
56+
<File Id="_lldb.pyd" Source="$(var.TOOLCHAIN_ROOT)\usr\lib\site-packages\lldb\_lldb.pyd" Checksum="yes" KeyPath="yes" />
57+
</Component>
58+
<Component Directory="_usr_lib_site_packages_lldb" Id="embedded_interpreter.py">
59+
<File Id="embedded_interpreter.py" Source="$(var.TOOLCHAIN_ROOT)\usr\lib\site-packages\lldb\embedded_interpreter.py" Checksum="yes" KeyPath="yes" />
60+
</Component>
61+
<Component Directory="_usr_lib_site_packages_lldb" Id="lldb_argdumper.exe">
62+
<File Id="lldb_argdumper.exe" Source="$(var.TOOLCHAIN_ROOT)\usr\lib\site-packages\lldb\lldb-argdumper.exe" Checksum="yes" KeyPath="yes" />
63+
</Component>
64+
65+
<Component Directory="_usr_lib_site_packages_lldb_formatters" Id="logger.py">
66+
<File Id="logger.py" Source="$(var.TOOLCHAIN_ROOT)\usr\lib\site-packages\lldb\formatters\Logger.py" Checksum="yes" KeyPath="yes" />
67+
</Component>
68+
<Component Directory="_usr_lib_site_packages_lldb_formatters" Id="__init__.py_6124a6ee9e584275b153b0e1ddb4a2b2">
69+
<File Id="___init__.py_6124a6ee9e584275b153b0e1ddb4a2b2" Source="$(var.TOOLCHAIN_ROOT)\usr\lib\site-packages\lldb\formatters\__init__.py" Checksum="yes" KeyPath="yes" />
70+
</Component>
71+
<Component Directory="_usr_lib_site_packages_lldb_formatters" Id="attrib_fromdict.py">
72+
<File Id="attrib_fromdict.py" Source="$(var.TOOLCHAIN_ROOT)\usr\lib\site-packages\lldb\formatters\attrib_fromdict.py" Checksum="yes" KeyPath="yes" />
73+
</Component>
74+
<Component Directory="_usr_lib_site_packages_lldb_formatters" Id="cache.py">
75+
<File Id="cache.py" Source="$(var.TOOLCHAIN_ROOT)\usr\lib\site-packages\lldb\formatters\cache.py" Checksum="yes" KeyPath="yes" />
76+
</Component>
77+
<Component Directory="_usr_lib_site_packages_lldb_formatters" Id="metrics.py">
78+
<File Id="metrics.py" Source="$(var.TOOLCHAIN_ROOT)\usr\lib\site-packages\lldb\formatters\metrics.py" Checksum="yes" KeyPath="yes" />
79+
</Component>
80+
<Component Directory="_usr_lib_site_packages_lldb_formatters" Id="synth.py">
81+
<File Id="synth.py" Source="$(var.TOOLCHAIN_ROOT)\usr\lib\site-packages\lldb\formatters\synth.py" Checksum="yes" KeyPath="yes" />
82+
</Component>
83+
84+
<Component Directory="_usr_lib_site_packages_lldb_formatters_cpp" Id="__init__.py_1bd1d2dc68b7417b83484f6183339af2">
85+
<File Id="___init__.py_1bd1d2dc68b7417b83484f6183339af2" Source="$(var.TOOLCHAIN_ROOT)\usr\lib\site-packages\lldb\formatters\cpp\__init__.py" Checksum="yes" KeyPath="yes" />
86+
</Component>
87+
<Component Directory="_usr_lib_site_packages_lldb_formatters_cpp" Id="gnu_libstdcpp.py">
88+
<File Id="gnu_libstdcpp.py" Source="$(var.TOOLCHAIN_ROOT)\usr\lib\site-packages\lldb\formatters\cpp\gnu_libstdcpp.py" Checksum="yes" KeyPath="yes" />
89+
</Component>
90+
<Component Directory="_usr_lib_site_packages_lldb_formatters_cpp" Id="libcxx.py">
91+
<File Id="libcxx.py" Source="$(var.TOOLCHAIN_ROOT)\usr\lib\site-packages\lldb\formatters\cpp\libcxx.py" Checksum="yes" KeyPath="yes" />
92+
</Component>
93+
94+
<Component Directory="_usr_lib_site_packages_lldb_utils" Id="__init__.py_52ef75ed702f4acc8272e6b2f8aa5392">
95+
<File Id="___init__.py_52ef75ed702f4acc8272e6b2f8aa5392" Source="$(var.TOOLCHAIN_ROOT)\usr\lib\site-packages\lldb\utils\__init__.py" Checksum="yes" KeyPath="yes" />
96+
</Component>
97+
<Component Directory="_usr_lib_site_packages_lldb_utils" Id="in_call_stack.py">
98+
<File Id="in_call_stack.py" Source="$(var.TOOLCHAIN_ROOT)\usr\lib\site-packages\lldb\utils\in_call_stack.py" Checksum="yes" KeyPath="yes" />
99+
</Component>
100+
<Component Directory="_usr_lib_site_packages_lldb_utils" Id="symbolication.py">
101+
<File Id="symbolication.py" Source="$(var.TOOLCHAIN_ROOT)\usr\lib\site-packages\lldb\utils\symbolication.py" Checksum="yes" KeyPath="yes" />
102+
</Component>
103+
</ComponentGroup>
104+
105+
<ComponentGroup Id="lldb_server">
106+
<Component Directory="_usr_bin" Id="lldb_server.exe">
107+
<File Id="lldb_server.exe" Source="$(var.TOOLCHAIN_ROOT)\usr\bin\lldb-server.exe" Checksum="yes" KeyPath="yes" />
108+
</Component>
109+
</ComponentGroup>
110+
111+
<ComponentGroup Id="swift_repl">
112+
<Component Directory="_usr_bin" Id="repl_swift.exe">
113+
<File Id="repl_swift.exe" Source="$(var.TOOLCHAIN_ROOT)\usr\bin\repl_swift.exe" Checksum="yes" KeyPath="yes" />
114+
</Component>
115+
</ComponentGroup>
116+
117+
<Feature Id="DebuggingTools" AllowAbsent="no" AllowAdvertise="yes" ConfigurableDirectory="INSTALLDIR" Description="Swift Debugging Tools" Level="1" Title="Swift Debugging Tools">
118+
<ComponentGroupRef Id="lldb" />
119+
<ComponentGroupRef Id="lldb_server" />
120+
121+
<ComponentGroupRef Id="swift_repl" />
122+
</Feature>
123+
124+
<UI>
125+
<ui:WixUI Id="WixUI_InstallDir" />
126+
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="InstallDirDlg" Order="2" />
127+
<Publish Dialog="InstallDirDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="2" />
128+
</UI>
129+
130+
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR"></Property>
131+
132+
<WixVariable Id="WixUIDialogBmp" Value="Resources\swift_dialog.png" />
133+
<WixVariable Id="WixUIBannerBmp" Value="Resources\swift_banner.png" />
134+
</Package>
135+
</Wix>

0 commit comments

Comments
 (0)