Skip to content

WiX: version the installations of the toolchain, devtools, runtime #201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion platforms/Windows/devtools-amd64.wxs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
<?include version.wxi?>
<Package
Language="1033"
Manufacturer="swift.org"
Expand All @@ -18,7 +19,7 @@
<Directory Id="Library" Name="Library">
<Directory Id="Developer" Name="Developer">
<Directory Id="Toolchains" Name="Toolchains">
<Directory Id="xctoolchain" Name="unknown-Asserts-development.xctoolchain">
<Directory Id="xctoolchain" Name="$(var.ToolchainName)">
<Directory Id="_usr" Name="usr">
<Directory Id="_usr_bin" Name="bin">
</Directory>
Expand Down
3 changes: 2 additions & 1 deletion platforms/Windows/devtools-arm64.wxs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
<?include version.wxi?>
<Package
Language="1033"
Manufacturer="swift.org"
Expand All @@ -18,7 +19,7 @@
<Directory Id="Library" Name="Library">
<Directory Id="Developer" Name="Developer">
<Directory Id="Toolchains" Name="Toolchains">
<Directory Id="xctoolchain" Name="unknown-Asserts-development.xctoolchain">
<Directory Id="xctoolchain" Name="$(var.ToolchainName)">
<Directory Id="_usr" Name="usr">
<Directory Id="_usr_bin" Name="bin">
</Directory>
Expand Down
8 changes: 4 additions & 4 deletions platforms/Windows/runtime-amd64.wxs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
<?include version.wxi?>
<Package
Language="1033"
Manufacturer="swift.org"
Expand All @@ -13,8 +14,7 @@
<!-- Directory Structure -->
<StandardDirectory Id="ProgramFiles64Folder">
<Directory Id="INSTALLDIR" Name="Swift">
<!-- TODO(compnerd) use $(var.ProductVersion) -->
<Directory Id="_" Name="runtime-development">
<Directory Id="_" Name="$(var.RuntimeName)">
<Directory Id="_usr" Name="usr">
<Directory Id="_usr_bin" Name="bin">
</Directory>
Expand Down Expand Up @@ -90,9 +90,9 @@
</ComponentGroup>

<Component Id="EnvironmentVariables" Directory="INSTALLDIR" Guid="f249625e-aacd-4b17-a464-8f8df05ba5f3">
<Environment Id="Path" Action="set" Name="Path" Part="last" Permanent="no" System="yes" Value="[INSTALLDIR]runtime-development\usr\bin" />
<Environment Id="Path" Action="set" Name="Path" Part="last" Permanent="no" System="yes" Value="[INSTALLDIR]$(var.RuntimeName)\usr\bin" />
</Component>

<!-- Feature -->
<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">
<ComponentGroupRef Id="SwiftRuntime" />
Expand Down
6 changes: 3 additions & 3 deletions platforms/Windows/runtime-arm64.wxs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
<?include version.wxi?>
<Package
Language="1033"
Manufacturer="swift.org"
Expand All @@ -13,8 +14,7 @@
<!-- Directory Structure -->
<StandardDirectory Id="ProgramFiles64Folder">
<Directory Id="INSTALLDIR" Name="Swift">
<!-- TODO(compnerd) use $(var.ProductVersion) -->
<Directory Id="_" Name="runtime-development">
<Directory Id="_" Name="$(var.RuntimeName)">
<Directory Id="_usr" Name="usr">
<Directory Id="_usr_bin" Name="bin">
</Directory>
Expand Down Expand Up @@ -90,7 +90,7 @@
</ComponentGroup>

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

<!-- Feature -->
Expand Down
8 changes: 4 additions & 4 deletions platforms/Windows/runtime-x86.wxs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
<?include version.wxi?>
<Package
Language="1033"
Manufacturer="swift.org"
Expand All @@ -7,14 +8,13 @@
Version="$(var.ProductVersion)"
Scope="perMachine">
<SummaryInformation Description="Swift Runtime for Windows i686" />

<Media Id="1" Cabinet="runtime.cab" EmbedCab="yes" />

<!-- Directory Structure -->
<StandardDirectory Id="ProgramFilesFolder">
<Directory Id="INSTALLDIR" Name="Swift">
<!-- TODO(compnerd) use $(var.ProductVersion) -->
<Directory Id="_" Name="runtime-development">
<Directory Id="_" Name="$(var.RuntimeName)">
<Directory Id="_usr" Name="usr">
<Directory Id="_usr_bin" Name="bin">
</Directory>
Expand Down Expand Up @@ -90,7 +90,7 @@
</ComponentGroup>

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

<!-- Feature -->
Expand Down
16 changes: 4 additions & 12 deletions platforms/Windows/toolchain-amd64.wxs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
<?include version.wxi?>
<Package
Language="1033"
Manufacturer="swift.org"
Expand Down Expand Up @@ -26,17 +27,8 @@
<Directory Id="Library" Name="Library">
<Directory Id="Developer" Name="Developer">
<Directory Id="Toolchains" Name="Toolchains">
<!-- TODO(compnerd):
This really should be
unknown-Asserts-$(var.ProductVersion).xctoolchain,
though before changing, we should setup a
`unknown-Asserts-current.xctoolchain`
symlink. Additionally, beware that the environment chagnes
below will need to be updated to reflect this change. Ideally,
we would have as part of this a tool to select the different
toolchain versions.
-->
<Directory Id="xctoolchain" Name="unknown-Asserts-development.xctoolchain">
<!-- TODO(compnerd) We should setup a `unknown-Asserts-current.xctoolchain` symlink -->
<Directory Id="xctoolchain" Name="$(var.ToolchainName)">
<Directory Id="_usr" Name="usr">
<Directory Id="_usr_bin" Name="bin">
</Directory>
Expand Down Expand Up @@ -544,7 +536,7 @@

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

<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">
Expand Down
16 changes: 4 additions & 12 deletions platforms/Windows/toolchain-arm64.wxs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">
<?include version.wxs?>
<Package
Language="1033"
Manufacturer="swift.org"
Expand Down Expand Up @@ -26,17 +27,8 @@
<Directory Id="Library" Name="Library">
<Directory Id="Developer" Name="Developer">
<Directory Id="Toolchains" Name="Toolchains">
<!-- TODO(compnerd):
This really should be
unknown-Asserts-$(var.ProductVersion).xctoolchain,
though before changing, we should setup a
`unknown-Asserts-current.xctoolchain`
symlink. Additionally, beware that the environment chagnes
below will need to be updated to reflect this change. Ideally,
we would have as part of this a tool to select the different
toolchain versions.
-->
<Directory Id="xctoolchain" Name="unknown-Asserts-development.xctoolchain">
<!-- TODO(compnerd) We should setup a `unknown-Asserts-current.xctoolchain` symlink -->
<Directory Id="xctoolchain" Name="$(var.ToolchainName)">
<Directory Id="_usr" Name="usr">
<Directory Id="_usr_bin" Name="bin">
</Directory>
Expand Down Expand Up @@ -544,7 +536,7 @@

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

<Feature Id="Toolchain" AllowAbsent="no" AllowAdvertise="yes" ConfigurableDirectory="INSTALLDIR" Description="Swift Toolchain for Windows aarch64" Level="1" Title="Swift Toolchain for Windows aarch64">
Expand Down
11 changes: 11 additions & 0 deletions platforms/Windows/version.wxi
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version='1.0' encoding='utf-8'?>

<Include>
<?if $(var.ProductVersion) = "0.0.0"?>
<?define RuntimeName = "runtime-development"?>
<?define ToolchainName = "unknown-Asserts-development.xctoolchain"?>
<?else?>
<?define RuntimeName = "runtime-$(var.ProductVersion)"?>
<?define ToolchainName = "unknown-Asserts-$(var.ProductVersion).xctoolchain"?>
<?endif?>
</Include>