Skip to content
Open
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
1 change: 1 addition & 0 deletions platforms/Windows/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
ArePackageCabsEmbedded=$(ArePackageCabsEmbedded);
BaseReleaseDownloadUrl=$(BaseReleaseDownloadUrl);
ImageRoot=$(ImageRoot);
PythonVersion=$(PythonVersion);
WindowsRuntimeARM64=$(WindowsRuntimeARM64);
WindowsRuntimeX64=$(WindowsRuntimeX64);
WindowsRuntimeX86=$(WindowsRuntimeX86);
Expand Down
2 changes: 2 additions & 0 deletions platforms/Windows/SideBySideUpgradeStrategy.props
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
<ExperimentalRTLUpgradeCode>{F9BA01C7-0C7C-4898-90BD-9D6BB308F0B3}</ExperimentalRTLUpgradeCode>
<AndroidPlatformUpgradeCode>{313B9C1F-D5B5-4FED-B7E0-138F1EE6B26A}</AndroidPlatformUpgradeCode>
<WindowsPlatformUpgradeCode>{01AFF1CF-A025-41B6-BCBC-728D794353FD}</WindowsPlatformUpgradeCode>
<PythonUpgradeCode>{5FC42BA9-ABF5-4CCD-B93B-BDFED936BA37}</PythonUpgradeCode>
</PropertyGroup>

<PropertyGroup Condition="'$(MajorMinorProductVersion)' == '0.0'">
Expand Down Expand Up @@ -71,6 +72,7 @@
ExperimentalRTLUpgradeCode=$(ExperimentalRTLUpgradeCode);
AndroidPlatformUpgradeCode=$(AndroidPlatformUpgradeCode);
WindowsPlatformUpgradeCode=$(WindowsPlatformUpgradeCode);
PythonUpgradeCode=$(PythonUpgradeCode);
</DefineConstants>
</PropertyGroup>
</Project>
1 change: 1 addition & 0 deletions platforms/Windows/bundle/installer.wixproj
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<ProjectReference Include="..\cli\asserts\cli.asserts.wixproj" BindName="cli.asserts" />
<ProjectReference Include="..\dbg\asserts\dbg.asserts.wixproj" BindName="dbg.asserts" />
<ProjectReference Include="..\ide\asserts\ide.asserts.wixproj" BindName="ide.asserts" />
<ProjectReference Include="..\python\python.wixproj" BindName="python" />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm half tempted to say that dep\python\python.wixproj is ideal.

</ItemGroup>

<ItemGroup Condition=" $(ToolchainVariants.Contains('noasserts')) ">
Expand Down
8 changes: 8 additions & 0 deletions platforms/Windows/bundle/installer.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
<Variable Name="OptionsInstallBLD" Value="1" />
<Variable Name="OptionsInstallCLI" bal:Overridable="yes" Persisted="yes" Value="1" />
<Variable Name="OptionsInstallDBG" bal:Overridable="yes" Persisted="yes" Value="1" />
<Variable Name="OptionsInstallPy" bal:Overridable="yes" Persisted="yes" Value="1" />
<Variable Name="OptionsInstallIDE" bal:Overridable="yes" Persisted="yes" Value="1" />
<Variable Name="OptionsInstallRTL" Value="1" />

Expand Down Expand Up @@ -134,6 +135,13 @@
</MsiPackage>
<?endif?>

<MsiPackage
SourceFile="!(bindpath.python)\python.msi"
InstallCondition="OptionsInstallPy = 1 and OptionsInstallDBG = 1"
DownloadUrl="$(BaseReleaseDownloadUrl)/{2}">
<MsiProperty Name="INSTALLROOT" Value="[InstallRoot]" />
</MsiPackage>

<MsiPackage
SourceFile="!(bindpath.ide.asserts)\ide.asserts.msi"
InstallCondition="OptionsInstallIDE = 1 and OptionsInstallAssertsToolchain = 1"
Expand Down
40 changes: 20 additions & 20 deletions platforms/Windows/bundle/theme.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
<Font Id="2" Height="-18" Weight="500" Foreground="graytext">Segoe UI</Font>
<Font Id="3" Height="-12" Weight="500" Foreground="windowtext" Background="window">Segoe UI</Font>

<Window Width="630" Height="500" HexStyle="100a0000" FontId="0" Caption="#(loc.Caption)">
<ImageControl X="0" Y="0" Width="181" Height="500" ImageFile="swift_side.png"/>
<Window Width="630" Height="530" HexStyle="100a0000" FontId="0" Caption="#(loc.Caption)">
<ImageControl X="0" Y="0" Width="181" Height="530" ImageFile="swift_side.png"/>
<Label X="192" Y="11" Width="-11" Height="32" FontId="1" DisablePrefix="yes">#(loc.Title)</Label>

<Page Name="Help">
Expand Down Expand Up @@ -59,24 +59,24 @@
<Checkbox Name="OptionsInstallBLD" X="192" Y="111" Width="-11" Height="17" TabStop="yes" FontId="3" EnableCondition="0">#(loc.Bld_ProductName)</Checkbox>
<Checkbox Name="OptionsInstallCLI" X="192" Y="129" Width="-11" Height="17" TabStop="yes" FontId="3">#(loc.Cli_ProductName)</Checkbox>
<Checkbox Name="OptionsInstallDBG" X="192" Y="147" Width="-11" Height="17" TabStop="yes" FontId="3">#(loc.Dbg_ProductName)</Checkbox>
<Checkbox Name="OptionsInstallIDE" X="192" Y="165" Width="-11" Height="17" TabStop="yes" FontId="3">#(loc.Ide_ProductName)</Checkbox>
<Checkbox Name="OptionsInstallRTL" X="192" Y="183" Width="-11" Height="17" TabStop="yes" FontId="3" EnableCondition="0">#(loc.Rtl_ProductName)</Checkbox>
<Checkbox Name="OptionsInstallWindowsPlatform" X="192" Y="201" Width="-11" Height="17" TabStop="yes" FontId="3">#(loc.Plt_ProductName_Windows)</Checkbox>
<Checkbox Name="OptionsInstallWindowsSDKAMD64" X="210" Y="219" Width="-11" Height="17" TabStop="yes" FontId="3" EnableCondition="OptionsInstallWindowsPlatform">#(loc.Sdk_ProductName_Windows_amd64)</Checkbox>
<Checkbox Name="OptionsInstallWindowsRedistAMD64" X="228" Y="237" Width="-11" Height="17" TabStop="yes" FontId="3" EnableCondition="OptionsInstallWindowsPlatform AND OptionsInstallWindowsSDKAMD64">#(loc.Redist_amd64)</Checkbox>
<Checkbox Name="OptionsInstallWindowsSDKARM64" X="210" Y="255" Width="-11" Height="17" TabStop="yes" FontId="3" EnableCondition="OptionsInstallWindowsPlatform">#(loc.Sdk_ProductName_Windows_arm64)</Checkbox>
<Checkbox Name="OptionsInstallWindowsRedistARM64" X="228" Y="273" Width="-11" Height="17" TabStop="yes" FontId="3" EnableCondition="OptionsInstallWindowsPlatform AND OptionsInstallWindowsSDKARM64">#(loc.Redist_arm64)</Checkbox>
<Checkbox Name="OptionsInstallWindowsSDKX86" X="210" Y="291" Width="-11" Height="17" TabStop="yes" FontId="3" EnableCondition="OptionsInstallWindowsPlatform">#(loc.Sdk_ProductName_Windows_x86)</Checkbox>
<Checkbox Name="OptionsInstallWindowsRedistX86" X="228" Y="309" Width="-11" Height="17" TabStop="yes" FontId="3" EnableCondition="OptionsInstallWindowsPlatform AND OptionsInstallWindowsSDKX86">#(loc.Redist_x86)</Checkbox>
<Checkbox Name="OptionsInstallAndroidPlatform" X="192" Y="327" Width="-11" Height="17" TabStop="yes" FontId="3">#(loc.Plt_ProductName_Android)</Checkbox>
<Checkbox Name="OptionsInstallAndroidSDKARM64" X="210" Y="345" Width="-11" Height="17" TabStop="yes" FontId="3" EnableCondition="OptionsInstallAndroidPlatform">#(loc.Sdk_ProductName_Android_arm64)</Checkbox>
<Checkbox Name="OptionsInstallAndroidSDKAMD64" X="210" Y="363" Width="-11" Height="17" TabStop="yes" FontId="3" EnableCondition="OptionsInstallAndroidPlatform">#(loc.Sdk_ProductName_Android_amd64)</Checkbox>
<Checkbox Name="OptionsInstallAndroidSDKARM" X="210" Y="381" Width="-11" Height="17" TabStop="yes" FontId="3" EnableCondition="OptionsInstallAndroidPlatform">#(loc.Sdk_ProductName_Android_armv7)</Checkbox>
<Checkbox Name="OptionsInstallAndroidSDKX86" X="210" Y="399" Width="-11" Height="17" TabStop="yes" FontId="3" EnableCondition="OptionsInstallAndroidPlatform">#(loc.Sdk_ProductName_Android_x86)</Checkbox>
<Checkbox Name="OptionsInstallToolchain" X="192" Y="417" Width="-11" Height="17" TabStop="yes" FontId="3" EnableCondition="0">#(loc.Toolchain_ProductName)</Checkbox>
<Checkbox Name="OptionsInstallAssertsToolchain" X="210" Y="435" Width="-11" Height="17" TabStop="yes" FontId="3" EnableCondition="OptionsIncludeNoAsserts and OptionsInstallNoAssertsToolchain">#(loc.Asserts_Toolchain_ProductName)</Checkbox>
<Checkbox Name="OptionsInstallNoAssertsToolchain" X="210" Y="453" Width="-11" Height="17" TabStop="yes" FontId="3" EnableCondition="OptionsIncludeNoAsserts and OptionsInstallAssertsToolchain">#(loc.NoAsserts_Toolchain_ProductName)</Checkbox>

<Checkbox Name="OptionsInstallPy" X="210" Y="165" Width="-11" Height="17" TabStop="yes" FontId="3" EnableCondition="OptionsInstallDBG">#(loc.EmbeddedPython_ProductName)</Checkbox>
<Checkbox Name="OptionsInstallIDE" X="192" Y="183" Width="-11" Height="17" TabStop="yes" FontId="3">#(loc.Ide_ProductName)</Checkbox>
<Checkbox Name="OptionsInstallRTL" X="192" Y="201" Width="-11" Height="17" TabStop="yes" FontId="3" EnableCondition="0">#(loc.Rtl_ProductName)</Checkbox>
<Checkbox Name="OptionsInstallWindowsPlatform" X="192" Y="219" Width="-11" Height="17" TabStop="yes" FontId="3">#(loc.Plt_ProductName_Windows)</Checkbox>
<Checkbox Name="OptionsInstallWindowsSDKAMD64" X="210" Y="237" Width="-11" Height="17" TabStop="yes" FontId="3" EnableCondition="OptionsInstallWindowsPlatform">#(loc.Sdk_ProductName_Windows_amd64)</Checkbox>
<Checkbox Name="OptionsInstallWindowsRedistAMD64" X="228" Y="255" Width="-11" Height="17" TabStop="yes" FontId="3" EnableCondition="OptionsInstallWindowsPlatform AND OptionsInstallWindowsSDKAMD64">#(loc.Redist_amd64)</Checkbox>
<Checkbox Name="OptionsInstallWindowsSDKARM64" X="210" Y="273" Width="-11" Height="17" TabStop="yes" FontId="3" EnableCondition="OptionsInstallWindowsPlatform">#(loc.Sdk_ProductName_Windows_arm64)</Checkbox>
<Checkbox Name="OptionsInstallWindowsRedistARM64" X="228" Y="291" Width="-11" Height="17" TabStop="yes" FontId="3" EnableCondition="OptionsInstallWindowsPlatform AND OptionsInstallWindowsSDKARM64">#(loc.Redist_arm64)</Checkbox>
<Checkbox Name="OptionsInstallWindowsSDKX86" X="210" Y="309" Width="-11" Height="17" TabStop="yes" FontId="3" EnableCondition="OptionsInstallWindowsPlatform">#(loc.Sdk_ProductName_Windows_x86)</Checkbox>
<Checkbox Name="OptionsInstallWindowsRedistX86" X="228" Y="327" Width="-11" Height="17" TabStop="yes" FontId="3" EnableCondition="OptionsInstallWindowsPlatform AND OptionsInstallWindowsSDKX86">#(loc.Redist_x86)</Checkbox>
<Checkbox Name="OptionsInstallAndroidPlatform" X="192" Y="345" Width="-11" Height="17" TabStop="yes" FontId="3">#(loc.Plt_ProductName_Android)</Checkbox>
<Checkbox Name="OptionsInstallAndroidSDKARM64" X="210" Y="363" Width="-11" Height="17" TabStop="yes" FontId="3" EnableCondition="OptionsInstallAndroidPlatform">#(loc.Sdk_ProductName_Android_arm64)</Checkbox>
<Checkbox Name="OptionsInstallAndroidSDKAMD64" X="210" Y="381" Width="-11" Height="17" TabStop="yes" FontId="3" EnableCondition="OptionsInstallAndroidPlatform">#(loc.Sdk_ProductName_Android_amd64)</Checkbox>
<Checkbox Name="OptionsInstallAndroidSDKARM" X="210" Y="399" Width="-11" Height="17" TabStop="yes" FontId="3" EnableCondition="OptionsInstallAndroidPlatform">#(loc.Sdk_ProductName_Android_armv7)</Checkbox>
<Checkbox Name="OptionsInstallAndroidSDKX86" X="210" Y="417" Width="-11" Height="17" TabStop="yes" FontId="3" EnableCondition="OptionsInstallAndroidPlatform">#(loc.Sdk_ProductName_Android_x86)</Checkbox>
<Checkbox Name="OptionsInstallToolchain" X="192" Y="435" Width="-11" Height="17" TabStop="yes" FontId="3" EnableCondition="0">#(loc.Toolchain_ProductName)</Checkbox>
<Checkbox Name="OptionsInstallAssertsToolchain" X="210" Y="453" Width="-11" Height="17" TabStop="yes" FontId="3" EnableCondition="OptionsIncludeNoAsserts and OptionsInstallNoAssertsToolchain">#(loc.Asserts_Toolchain_ProductName)</Checkbox>
<Checkbox Name="OptionsInstallNoAssertsToolchain" X="210" Y="471" Width="-11" Height="17" TabStop="yes" FontId="3" EnableCondition="OptionsIncludeNoAsserts and OptionsInstallAssertsToolchain">#(loc.NoAsserts_Toolchain_ProductName)</Checkbox>
<Button Name="OptionsOkButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
<Text>#(loc.OptionsOkButton)</Text>
<ChangePageAction Page="Install" />
Expand Down
5 changes: 5 additions & 0 deletions platforms/Windows/python/python.wixproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<Project Sdk="WixToolset.Sdk/4.0.5">
<PropertyGroup>
<OutputName>python</OutputName>
</PropertyGroup>
</Project>
132 changes: 132 additions & 0 deletions platforms/Windows/python/python.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,132 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<?define PythonRoot = "$(ImageRoot)\Python-$(PythonVersion)"?>
<?if $(ProductArchitecture) = "arm64"?>
<?define ArchSuffix = "-arm64"?>
<?else?>
<?define ArchSuffix = ""?>
<?endif?>
<?define VariantProductName = !(loc.IdeAsserts_ProductName)?>

<Package
Language="1033"
Manufacturer="!(loc.ManufacturerName)"
Name="!(loc.EmbeddedPython_ProductName)"
UpgradeCode="$(PythonUpgradeCode)"
Version="$(NonSemVerProductVersion)"
Scope="$(PackageScope)">

<Media Id="1" Cabinet="python.cab" EmbedCab="$(ArePackageCabsEmbedded)" />

<WixVariable Id="SideBySidePackageUpgradeCode" Value="$(PythonUpgradeCode)" />
<FeatureGroupRef Id="SideBySideUpgradeStrategy" />

<ComponentGroup Id="EmbeddedPython" Directory="python">
<Component>
<File Source="$(PythonRoot)\libcrypto-1_1$(ArchSuffix).dll" />
</Component>
<Component>
<File Source="$(PythonRoot)\libffi-7.dll" />
</Component>
<Component>
<File Source="$(PythonRoot)\libssl-1_1$(ArchSuffix).dll" />
</Component>
<Component>
<File Source="$(PythonRoot)\LICENSE.txt" />
</Component>
<Component>
<File Source="$(PythonRoot)\pyexpat.pyd" />
</Component>
<Component>
<File Source="$(PythonRoot)\python.cat" />
</Component>
<Component>
<File Source="$(PythonRoot)\python.exe" />
</Component>
<Component>
<File Source="$(PythonRoot)\python3.dll" />
</Component>
<Component>
<File Source="$(PythonRoot)\python310.dll" />
</Component>
<Component>
<File Source="$(PythonRoot)\python310.zip" />
</Component>
<Component>
<File Source="$(PythonRoot)\python310._pth" />
</Component>
<Component>
<File Source="$(PythonRoot)\pythonw.exe" />
</Component>
<Component>
<File Source="$(PythonRoot)\select.pyd" />
</Component>
<Component>
<File Source="$(PythonRoot)\sqlite3.dll" />
</Component>
<Component>
<File Source="$(PythonRoot)\unicodedata.pyd" />
</Component>
<Component>
<File Source="$(PythonRoot)\vcruntime140.dll" />
</Component>
<Component>
<File Source="$(PythonRoot)\vcruntime140_1.dll" />
</Component>
<Component>
<File Source="$(PythonRoot)\winsound.pyd" />
</Component>
<Component>
<File Source="$(PythonRoot)\_asyncio.pyd" />
</Component>
<Component>
<File Source="$(PythonRoot)\_bz2.pyd" />
</Component>
<Component>
<File Source="$(PythonRoot)\_ctypes.pyd" />
</Component>
<Component>
<File Source="$(PythonRoot)\_decimal.pyd" />
</Component>
<Component>
<File Source="$(PythonRoot)\_elementtree.pyd" />
</Component>
<Component>
<File Source="$(PythonRoot)\_hashlib.pyd" />
</Component>
<Component>
<File Source="$(PythonRoot)\_lzma.pyd" />
</Component>
<Component>
<File Source="$(PythonRoot)\_msi.pyd" />
</Component>
<Component>
<File Source="$(PythonRoot)\_multiprocessing.pyd" />
</Component>
<Component>
<File Source="$(PythonRoot)\_overlapped.pyd" />
</Component>
<Component>
<File Source="$(PythonRoot)\_queue.pyd" />
</Component>
<Component>
<File Source="$(PythonRoot)\_socket.pyd" />
</Component>
<Component>
<File Source="$(PythonRoot)\_sqlite3.pyd" />
</Component>
<Component>
<File Source="$(PythonRoot)\_ssl.pyd" />
</Component>
<Component>
<File Source="$(PythonRoot)\_uuid.pyd" />
</Component>
<Component>
<File Source="$(PythonRoot)\_zoneinfo.pyd" />
</Component>
</ComponentGroup>

<Feature Id="EmbeddedPython" AllowAbsent="no" Title="$(VariantProductName)">
<ComponentGroupRef Id="EmbeddedPython" />
</Feature>
</Package>
</Wix>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing newline.

7 changes: 5 additions & 2 deletions platforms/Windows/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ The bundle authoring (in `installer.wxs`) drives optional install directory and
| InstallRoot | A formatted string variable that specifies the installation root directory. The default value specified in `installer.wxs` should match the equivalent `INSTALLROOT` authoring in `shared.wxs`. The bundle variable is passed to each `MsiPackage` so overwrites the default directory authored in the MSI packages -- but keeping them in sync avoids the confusion if the default directory should change. |
| OptionsInstallCLI | Controls whether command-line tools will be installed. |
| OptionsInstallDBG | Controls whether debugging tools will be installed. |
| OptionsInstallPy | Controls whether embeddable Python will be installed. |
| OptionsInstallIDE | Controls whether IDE integration tools will be installed. |
| OptionsInstallUtilties | Controls whether additional utilities will be installed. |
| OptionsInstallAndroidPlatform | Controls whether the Android platform will be installed. |
Expand Down Expand Up @@ -177,6 +178,7 @@ To support the three architecture flavors of the SDK and RTL MSI packages, you n
| MSBuild property | Description |
| ---------------- | ----------- |
| ImageRoot | Path to the root of the installed Swift image to package |
| PythonVersion | Version of the Embeddable Python to package |
| Platforms | Semicolon delimited list of platforms to package (android;windows) |
| AndroidArchitectures | Semicolon delimited list of architectures the Android platform supports (aarch54;armv7;i686;x86_64) |
| ToolchainVariants | Semicolon delimited list of toolchain variants to package (assert;noassert) |
Expand All @@ -194,10 +196,11 @@ msbuild %SourceRoot%\swift-installer-scripts\platforms\Windows\bundle\installer.
-p:Configuration=Release ^
-p:BaseOutputPath=%PackageRoot%\online\ ^
-p:ImageRoot=%ImageRoot%\Program Files\Swift ^
-p:PythonVersion=3.10.1 ^
-p:Platforms="android;windows" ^
-p:AndroidArchitectures="aarch64;armv7;i686;x86_64" ^
-p:WindowsArchitectures="aarch64;i686;x86_64" ^
-p:WindowsRuntimeARM64=%ImageRoot%\Prograam Files (Arm64)\Swift\Runtimes\0.0.0 ^
-p:WindowsRuntimeARM64=%ImageRoot%\Program Files (Arm64)\Swift\Runtimes\0.0.0 ^
-p:WindowsRuntimeX64=%ImageRoot%\Program Files\Swift\Runtimes\0.0.0 ^
-p:WindowsRuntimeX86=%ImageRoot%\Program Files (x86)\Swift\Runtimes\0.0.0
```
Expand Down Expand Up @@ -245,7 +248,7 @@ Note that these GUIDs are substituted at bind time so they skip the normal valid

| Property | Description |
| -------- | ----------- |
| BldAssertsUpgradeCode, BldNoAssertsUpgradeCode, CliAssertsUpgradeCode, CliNoAssertsUpgradeCode, DbgAssertsUpgradeCode, DbgNoAssertsUpgradeCode, IdeUpgradeCode, IdeNoUpgradeCode, RtlUpgradeCode, WindowsSDKUpgradeCode, AndroidSDKUpgradeCode | Upgrade codes for individual packages. Packages keep the same upgrade codes "forever" because MSI lets you specify version ranges for upgrades, which you can find in `shared/shared.wxs`. |
| BldAssertsUpgradeCode, BldNoAssertsUpgradeCode, CliAssertsUpgradeCode, CliNoAssertsUpgradeCode, DbgAssertsUpgradeCode, DbgNoAssertsUpgradeCode, IdeUpgradeCode, IdeNoUpgradeCode, RtlUpgradeCode, WindowsSDKUpgradeCode, AndroidSDKUpgradeCode, PythonUpgradeCode | Upgrade codes for individual packages. Packages keep the same upgrade codes "forever" because MSI lets you specify version ranges for upgrades, which you can find in `shared/shared.wxs`. |
| BundleUpgradeCode | Upgrade codes for the bundle. Bundles don't support upgrade version ranges, so the bundle upgrade code must change for every minor version _and_ stay the same for the entire lifetime of that minor version (e.g., v5.10.0 through v5.10.9999). You can keep the history of upgrade codes using a condition like `Condition="'$(MajorMinorProductVersion)' == '5.10'` or just replace BundleUpgradeCode when forking to a new minor version. |


Expand Down
Loading