Skip to content

Commit b0971cc

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 b0971cc

File tree

8 files changed

+33
-37
lines changed

8 files changed

+33
-37
lines changed

platforms/Windows/devtools-amd64.wxs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
2+
<?include version.wxi?>
23
<Package
34
Language="1033"
45
Manufacturer="swift.org"
@@ -18,7 +19,7 @@
1819
<Directory Id="Library" Name="Library">
1920
<Directory Id="Developer" Name="Developer">
2021
<Directory Id="Toolchains" Name="Toolchains">
21-
<Directory Id="xctoolchain" Name="unknown-Asserts-development.xctoolchain">
22+
<Directory Id="xctoolchain" Name="$(var.ToolchainName)">
2223
<Directory Id="_usr" Name="usr">
2324
<Directory Id="_usr_bin" Name="bin">
2425
</Directory>

platforms/Windows/devtools-arm64.wxs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
2+
<?include version.wxi?>
23
<Package
34
Language="1033"
45
Manufacturer="swift.org"
@@ -18,7 +19,7 @@
1819
<Directory Id="Library" Name="Library">
1920
<Directory Id="Developer" Name="Developer">
2021
<Directory Id="Toolchains" Name="Toolchains">
21-
<Directory Id="xctoolchain" Name="unknown-Asserts-development.xctoolchain">
22+
<Directory Id="xctoolchain" Name="$(var.ToolchainName)">
2223
<Directory Id="_usr" Name="usr">
2324
<Directory Id="_usr_bin" Name="bin">
2425
</Directory>

platforms/Windows/runtime-amd64.wxs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
2+
<?include version.wxi?>
23
<Package
34
Language="1033"
45
Manufacturer="swift.org"
@@ -13,8 +14,7 @@
1314
<!-- Directory Structure -->
1415
<StandardDirectory Id="ProgramFiles64Folder">
1516
<Directory Id="INSTALLDIR" Name="Swift">
16-
<!-- TODO(compnerd) use $(var.ProductVersion) -->
17-
<Directory Id="_" Name="runtime-development">
17+
<Directory Id="_" Name="$(var.RuntimeName)">
1818
<Directory Id="_usr" Name="usr">
1919
<Directory Id="_usr_bin" Name="bin">
2020
</Directory>
@@ -90,9 +90,9 @@
9090
</ComponentGroup>
9191

9292
<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" />
93+
<Environment Id="Path" Action="set" Name="Path" Part="last" Permanent="no" System="yes" Value="[INSTALLDIR]$(var.RuntimeName)\usr\bin" />
9494
</Component>
95-
95+
9696
<!-- Feature -->
9797
<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">
9898
<ComponentGroupRef Id="SwiftRuntime" />

platforms/Windows/runtime-arm64.wxs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
2+
<?include version.wxi?>
23
<Package
34
Language="1033"
45
Manufacturer="swift.org"
@@ -13,8 +14,7 @@
1314
<!-- Directory Structure -->
1415
<StandardDirectory Id="ProgramFiles64Folder">
1516
<Directory Id="INSTALLDIR" Name="Swift">
16-
<!-- TODO(compnerd) use $(var.ProductVersion) -->
17-
<Directory Id="_" Name="runtime-development">
17+
<Directory Id="_" Name="$(var.RuntimeName)">
1818
<Directory Id="_usr" Name="usr">
1919
<Directory Id="_usr_bin" Name="bin">
2020
</Directory>
@@ -90,7 +90,7 @@
9090
</ComponentGroup>
9191

9292
<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" />
93+
<Environment Id="Path" Action="set" Name="Path" Part="last" Permanent="no" System="yes" Value="[INSTALLDIR]$(var.RuntimeName)\usr\bin" />
9494
</Component>
9595

9696
<!-- Feature -->

platforms/Windows/runtime-x86.wxs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
2+
<?include version.wxi?>
23
<Package
34
Language="1033"
45
Manufacturer="swift.org"
@@ -7,14 +8,13 @@
78
Version="$(var.ProductVersion)"
89
Scope="perMachine">
910
<SummaryInformation Description="Swift Runtime for Windows i686" />
10-
11+
1112
<Media Id="1" Cabinet="runtime.cab" EmbedCab="yes" />
1213

1314
<!-- Directory Structure -->
1415
<StandardDirectory Id="ProgramFilesFolder">
1516
<Directory Id="INSTALLDIR" Name="Swift">
16-
<!-- TODO(compnerd) use $(var.ProductVersion) -->
17-
<Directory Id="_" Name="runtime-development">
17+
<Directory Id="_" Name="$(var.RuntimeName)">
1818
<Directory Id="_usr" Name="usr">
1919
<Directory Id="_usr_bin" Name="bin">
2020
</Directory>
@@ -90,7 +90,7 @@
9090
</ComponentGroup>
9191

9292
<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" />
93+
<Environment Id="Path" Action="set" Name="Path" Part="last" Permanent="no" System="yes" Value="[INSTALLDIR]$(var.RuntimeName)\usr\bin" />
9494
</Component>
9595

9696
<!-- Feature -->

platforms/Windows/toolchain-amd64.wxs

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
2+
<?include version.wxi?>
23
<Package
34
Language="1033"
45
Manufacturer="swift.org"
@@ -26,17 +27,8 @@
2627
<Directory Id="Library" Name="Library">
2728
<Directory Id="Developer" Name="Developer">
2829
<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">
30+
<!-- TODO(compnerd) We should setup a `unknown-Asserts-current.xctoolchain` symlink -->
31+
<Directory Id="xctoolchain" Name="$(var.ToolchainName)">
4032
<Directory Id="_usr" Name="usr">
4133
<Directory Id="_usr_bin" Name="bin">
4234
</Directory>
@@ -544,7 +536,7 @@
544536

545537
<Component Id="EnvironmentVariables" Directory="INSTALLDIR" Guid="d01ea5b8-0f8a-4388-9b61-1186efddfc39">
546538
<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" />
539+
<Environment Id="Path" Action="set" Name="Path" Part="last" Permanent="no" System="yes" Value="[INSTALLDIR]Library\Developer\Toolchains\$(var.ToolchainName)\usr\bin" />
548540
</Component>
549541

550542
<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: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
2+
<?include version.wxs?>
23
<Package
34
Language="1033"
45
Manufacturer="swift.org"
@@ -26,17 +27,8 @@
2627
<Directory Id="Library" Name="Library">
2728
<Directory Id="Developer" Name="Developer">
2829
<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">
30+
<!-- TODO(compnerd) We should setup a `unknown-Asserts-current.xctoolchain` symlink -->
31+
<Directory Id="xctoolchain" Name="$(var.ToolchainName)">
4032
<Directory Id="_usr" Name="usr">
4133
<Directory Id="_usr_bin" Name="bin">
4234
</Directory>
@@ -544,7 +536,7 @@
544536

545537
<Component Id="EnvironmentVariables" Directory="INSTALLDIR" Guid="d01ea5b8-0f8a-4388-9b61-1186efddfc39">
546538
<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" />
539+
<Environment Id="Path" Action="set" Name="Path" Part="last" Permanent="no" System="yes" Value="[INSTALLDIR]Library\Developer\Toolchains\$(var.ToolchainName)\usr\bin" />
548540
</Component>
549541

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

platforms/Windows/version.wxi

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version='1.0' encoding='utf-8'?>
2+
3+
<?if $(var.ProductVersion) = "0.0.0"?>
4+
<?define RuntimeName = "runtime-development"?>
5+
<?define ToolchainName = "unknown-Asserts-development.xctoolchain"?>
6+
<?else?>
7+
<?define RuntimeName = "runtime-$(var.ProductVersion)"?>
8+
<?define ToolchainName = "unknown-Asserts-$(var.ProductVersion).xctoolchain"?>
9+
<?endif?>
10+

0 commit comments

Comments
 (0)