Skip to content

Commit f580f02

Browse files
committed
WiX: version the installations of the toolchain, devtools, runtime
These packages are meant to be parallel installed with different releases except in the case of development releases. Wire up the package version information into the path.
1 parent ffecb08 commit f580f02

7 files changed

+50
-36
lines changed

platforms/Windows/devtools-amd64.wxs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@
1818
<Directory Id="Library" Name="Library">
1919
<Directory Id="Developer" Name="Developer">
2020
<Directory Id="Toolchains" Name="Toolchains">
21-
<Directory Id="xctoolchain" Name="unknown-Asserts-development.xctoolchain">
21+
<?if $(var.ProductVersion) = "0.0.0"?>
22+
<?define ToolchainName = "unknown-Asserts-development.xctoolchain"?>
23+
<?else?>
24+
<?define ToolchainName = "unknown-Asserts-$(var.ProductVersion).xctoolchain"?>
25+
<?endif?>
26+
<Directory Id="xctoolchain" Name="$(var.ToolchainName)">
2227
<Directory Id="_usr" Name="usr">
2328
<Directory Id="_usr_bin" Name="bin">
2429
</Directory>

platforms/Windows/devtools-arm64.wxs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,12 @@
1818
<Directory Id="Library" Name="Library">
1919
<Directory Id="Developer" Name="Developer">
2020
<Directory Id="Toolchains" Name="Toolchains">
21-
<Directory Id="xctoolchain" Name="unknown-Asserts-development.xctoolchain">
21+
<?if $(var.ProductVersion) = "0.0.0"?>
22+
<?define ToolchainName = "unknown-Asserts-development.xctoolchain"?>
23+
<?else?>
24+
<?define ToolchainName = "unknown-Asserts-$(var.ProductVersion).xctoolchain"?>
25+
<?endif?>
26+
<Directory Id="xctoolchain" Name="$(var.ToolchainName)">
2227
<Directory Id="_usr" Name="usr">
2328
<Directory Id="_usr_bin" Name="bin">
2429
</Directory>

platforms/Windows/runtime-amd64.wxs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,12 @@
1313
<!-- Directory Structure -->
1414
<StandardDirectory Id="ProgramFiles64Folder">
1515
<Directory Id="INSTALLDIR" Name="Swift">
16-
<!-- TODO(compnerd) use $(var.ProductVersion) -->
17-
<Directory Id="_" Name="runtime-development">
16+
<?if $(var.ProductVersion) = "0.0.0"?>
17+
<?define RuntimeName = "runtime-development"?>
18+
<?else?>
19+
<?define RuntimeName = "runtime-$(var.ProductVersion)"?>
20+
<?endif?>
21+
<Directory Id="_" Name="$(var.RuntimeName)">
1822
<Directory Id="_usr" Name="usr">
1923
<Directory Id="_usr_bin" Name="bin">
2024
</Directory>
@@ -90,9 +94,9 @@
9094
</ComponentGroup>
9195

9296
<Component Id="EnvironmentVariables" Directory="INSTALLDIR" Guid="f249625e-aacd-4b17-a464-8f8df05ba5f3">
93-
<Environment Id="Path" Action="set" Name="Path" Part="last" Permanent="no" System="yes" Value="[INSTALLDIR]runtime-development\usr\bin" />
97+
<Environment Id="Path" Action="set" Name="Path" Part="last" Permanent="no" System="yes" Value="[INSTALLDIR]$(var.RuntimeName)\usr\bin" />
9498
</Component>
95-
99+
96100
<!-- Feature -->
97101
<Feature Id="WinX64SwiftRuntime" AllowAbsent="no" AllowAdvertise="yes" ConfigurableDirectory="INSTALLDIR" Description="Swift Runtime for Windows x86_64" Level="1" Title="Swift Runtime for Windows x86_64">
98102
<ComponentGroupRef Id="SwiftRuntime" />

platforms/Windows/runtime-arm64.wxs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,12 @@
1313
<!-- Directory Structure -->
1414
<StandardDirectory Id="ProgramFiles64Folder">
1515
<Directory Id="INSTALLDIR" Name="Swift">
16-
<!-- TODO(compnerd) use $(var.ProductVersion) -->
17-
<Directory Id="_" Name="runtime-development">
16+
<?if $(var.ProductVersion) = "0.0.0"?>
17+
<?define RuntimeName = "runtime-development"?>
18+
<?else?>
19+
<?define RuntimeName = "runtime-$(var.ProductVersion)"?>
20+
<?endif?>
21+
<Directory Id="_" Name="$(var.RuntimeName)">
1822
<Directory Id="_usr" Name="usr">
1923
<Directory Id="_usr_bin" Name="bin">
2024
</Directory>
@@ -90,7 +94,7 @@
9094
</ComponentGroup>
9195

9296
<Component Id="EnvironmentVariables" Directory="INSTALLDIR" Guid="8681d813-eb32-46f9-8b1c-f622b38b5eaf">
93-
<Environment Id="Path" Action="set" Name="Path" Part="last" Permanent="no" System="yes" Value="[INSTALLDIR]runtime-development\usr\bin" />
97+
<Environment Id="Path" Action="set" Name="Path" Part="last" Permanent="no" System="yes" Value="[INSTALLDIR]$(var.RuntimeName)\usr\bin" />
9498
</Component>
9599

96100
<!-- Feature -->

platforms/Windows/runtime-x86.wxs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,12 @@
1313
<!-- Directory Structure -->
1414
<StandardDirectory Id="ProgramFilesFolder">
1515
<Directory Id="INSTALLDIR" Name="Swift">
16-
<!-- TODO(compnerd) use $(var.ProductVersion) -->
17-
<Directory Id="_" Name="runtime-development">
16+
<?if $(var.ProductVersion) = "0.0.0"?>
17+
<?define RuntimeName = "runtime-development"?>
18+
<?else?>
19+
<?define RuntimeName = "runtime-$(var.ProductVersion)"?>
20+
<?endif?>
21+
<Directory Id="_" Name="$(var.RuntimeName)">
1822
<Directory Id="_usr" Name="usr">
1923
<Directory Id="_usr_bin" Name="bin">
2024
</Directory>
@@ -90,7 +94,7 @@
9094
</ComponentGroup>
9195

9296
<Component Id="EnvironmentVariables" Directory="INSTALLDIR" Guid="3b4386ac-3341-407d-b946-6e670f4a83f6">
93-
<Environment Id="Path" Action="set" Name="Path" Part="last" Permanent="no" System="yes" Value="[INSTALLDIR]runtime-development\usr\bin" />
97+
<Environment Id="Path" Action="set" Name="Path" Part="last" Permanent="no" System="yes" Value="[INSTALLDIR]$(var.RuntimeName)\usr\bin" />
9498
</Component>
9599

96100
<!-- Feature -->

platforms/Windows/toolchain-amd64.wxs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,13 @@
2626
<Directory Id="Library" Name="Library">
2727
<Directory Id="Developer" Name="Developer">
2828
<Directory Id="Toolchains" Name="Toolchains">
29-
<!-- TODO(compnerd):
30-
This really should be
31-
unknown-Asserts-$(var.ProductVersion).xctoolchain,
32-
though before changing, we should setup a
33-
`unknown-Asserts-current.xctoolchain`
34-
symlink. Additionally, beware that the environment chagnes
35-
below will need to be updated to reflect this change. Ideally,
36-
we would have as part of this a tool to select the different
37-
toolchain versions.
38-
-->
39-
<Directory Id="xctoolchain" Name="unknown-Asserts-development.xctoolchain">
29+
<!-- TODO(compnerd) We should setup a `unknown-Asserts-current.xctoolchain` symlink -->
30+
<?if $(var.ProductVersion) = "0.0.0"?>
31+
<?define ToolchainName = "unknown-Asserts-development.xctoolchain"?>
32+
<?else?>
33+
<?define ToolchainName = "unknown-Asserts-$(var.ProductVersion).xctoolchain"?>
34+
<?endif?>
35+
<Directory Id="xctoolchain" Name="$(var.ToolchainName)">
4036
<Directory Id="_usr" Name="usr">
4137
<Directory Id="_usr_bin" Name="bin">
4238
</Directory>
@@ -544,7 +540,7 @@
544540

545541
<Component Id="EnvironmentVariables" Directory="INSTALLDIR" Guid="d01ea5b8-0f8a-4388-9b61-1186efddfc39">
546542
<Environment Id="DeveloperDir" Action="set" Name="DEVELOPER_DIR" Part="all" Permanent="no" System="yes" Value="[INSTALLDIR]Library\Developer" />
547-
<Environment Id="Path" Action="set" Name="Path" Part="last" Permanent="no" System="yes" Value="[INSTALLDIR]Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin" />
543+
<Environment Id="Path" Action="set" Name="Path" Part="last" Permanent="no" System="yes" Value="[INSTALLDIR]Library\Developer\Toolchains\$(var.ToolchainName)\usr\bin" />
548544
</Component>
549545

550546
<Feature Id="Toolchain" AllowAbsent="no" AllowAdvertise="yes" ConfigurableDirectory="INSTALLDIR" Description="Swift Toolchain for Windows x86_64" Level="1" Title="Swift Toolchain for Windows x86_64">

platforms/Windows/toolchain-arm64.wxs

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,13 @@
2626
<Directory Id="Library" Name="Library">
2727
<Directory Id="Developer" Name="Developer">
2828
<Directory Id="Toolchains" Name="Toolchains">
29-
<!-- TODO(compnerd):
30-
This really should be
31-
unknown-Asserts-$(var.ProductVersion).xctoolchain,
32-
though before changing, we should setup a
33-
`unknown-Asserts-current.xctoolchain`
34-
symlink. Additionally, beware that the environment chagnes
35-
below will need to be updated to reflect this change. Ideally,
36-
we would have as part of this a tool to select the different
37-
toolchain versions.
38-
-->
39-
<Directory Id="xctoolchain" Name="unknown-Asserts-development.xctoolchain">
29+
<!-- TODO(compnerd) We should setup a `unknown-Asserts-current.xctoolchain` symlink -->
30+
<?if $(var.ProductVersion) = "0.0.0"?>
31+
<?define ToolchainName = "unknown-Asserts-development.xctoolchain"?>
32+
<?else?>
33+
<?define ToolchainName = "unknown-Asserts-$(var.ProductVersion).xctoolchain"?>
34+
<?endif?>
35+
<Directory Id="xctoolchain" Name="$(var.ToolchainName)">
4036
<Directory Id="_usr" Name="usr">
4137
<Directory Id="_usr_bin" Name="bin">
4238
</Directory>
@@ -544,7 +540,7 @@
544540

545541
<Component Id="EnvironmentVariables" Directory="INSTALLDIR" Guid="d01ea5b8-0f8a-4388-9b61-1186efddfc39">
546542
<Environment Id="DeveloperDir" Action="set" Name="DEVELOPER_DIR" Part="all" Permanent="no" System="yes" Value="[INSTALLDIR]Library\Developer" />
547-
<Environment Id="Path" Action="set" Name="Path" Part="last" Permanent="no" System="yes" Value="[INSTALLDIR]Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin" />
543+
<Environment Id="Path" Action="set" Name="Path" Part="last" Permanent="no" System="yes" Value="[INSTALLDIR]Library\Developer\Toolchains\$(var.ToolchainName)\usr\bin" />
548544
</Component>
549545

550546
<Feature Id="Toolchain" AllowAbsent="no" AllowAdvertise="yes" ConfigurableDirectory="INSTALLDIR" Description="Swift Toolchain for Windows aarch64" Level="1" Title="Swift Toolchain for Windows aarch64">

0 commit comments

Comments
 (0)