From e8b830dff214cf1f80ef51adbe08324cd1a8c755 Mon Sep 17 00:00:00 2001 From: Charles Zablit Date: Fri, 31 Oct 2025 17:56:58 +0000 Subject: [PATCH 1/2] [windows] add an option to install Embeddable Python 3.10.1 in the toolchain installer --- platforms/Windows/Directory.Build.props | 1 + .../Windows/SideBySideUpgradeStrategy.props | 2 + platforms/Windows/bundle/installer.wixproj | 1 + platforms/Windows/bundle/installer.wxs | 8 + platforms/Windows/bundle/theme.xml | 7 +- platforms/Windows/python/python.wixproj | 5 + platforms/Windows/python/python.wxs | 140 ++++++++++++++++++ platforms/Windows/readme.md | 7 +- platforms/Windows/shared/shared.wxs | 1 + platforms/Windows/shared/swift.en-us.wxl | 1 + 10 files changed, 168 insertions(+), 5 deletions(-) create mode 100644 platforms/Windows/python/python.wixproj create mode 100644 platforms/Windows/python/python.wxs diff --git a/platforms/Windows/Directory.Build.props b/platforms/Windows/Directory.Build.props index a59bce70..06e16b51 100644 --- a/platforms/Windows/Directory.Build.props +++ b/platforms/Windows/Directory.Build.props @@ -81,6 +81,7 @@ ArePackageCabsEmbedded=$(ArePackageCabsEmbedded); BaseReleaseDownloadUrl=$(BaseReleaseDownloadUrl); ImageRoot=$(ImageRoot); + PythonVersion=$(PythonVersion); WindowsRuntimeARM64=$(WindowsRuntimeARM64); WindowsRuntimeX64=$(WindowsRuntimeX64); WindowsRuntimeX86=$(WindowsRuntimeX86); diff --git a/platforms/Windows/SideBySideUpgradeStrategy.props b/platforms/Windows/SideBySideUpgradeStrategy.props index ae79f273..5320ae94 100644 --- a/platforms/Windows/SideBySideUpgradeStrategy.props +++ b/platforms/Windows/SideBySideUpgradeStrategy.props @@ -24,6 +24,7 @@ {BEA8C6DC-F73E-445B-9486-2333D1CF2886} {313B9C1F-D5B5-4FED-B7E0-138F1EE6B26A} {01AFF1CF-A025-41B6-BCBC-728D794353FD} + {5FC42BA9-ABF5-4CCD-B93B-BDFED936BA37} @@ -61,6 +62,7 @@ RtlUpgradeCode=$(RtlUpgradeCode); AndroidPlatformUpgradeCode=$(AndroidPlatformUpgradeCode); WindowsPlatformUpgradeCode=$(WindowsPlatformUpgradeCode); + PythonUpgradeCode=$(PythonUpgradeCode); diff --git a/platforms/Windows/bundle/installer.wixproj b/platforms/Windows/bundle/installer.wixproj index b62f1e58..8737d9d2 100644 --- a/platforms/Windows/bundle/installer.wixproj +++ b/platforms/Windows/bundle/installer.wixproj @@ -21,6 +21,7 @@ + diff --git a/platforms/Windows/bundle/installer.wxs b/platforms/Windows/bundle/installer.wxs index 717a719b..e833e565 100644 --- a/platforms/Windows/bundle/installer.wxs +++ b/platforms/Windows/bundle/installer.wxs @@ -31,6 +31,7 @@ + @@ -101,6 +102,13 @@ + + + + Segoe UI Segoe UI - - - + + + @@ -59,6 +59,7 @@ #(loc.Bld_ProductName) #(loc.Cli_ProductName) #(loc.Dbg_ProductName) + #(loc.EmbeddedPython_ProductName) #(loc.Ide_ProductName) #(loc.Rtl_ProductName) #(loc.Plt_ProductName_Windows) diff --git a/platforms/Windows/python/python.wixproj b/platforms/Windows/python/python.wixproj new file mode 100644 index 00000000..0ffd3fdb --- /dev/null +++ b/platforms/Windows/python/python.wixproj @@ -0,0 +1,5 @@ + + + python + + diff --git a/platforms/Windows/python/python.wxs b/platforms/Windows/python/python.wxs new file mode 100644 index 00000000..b4b8fefc --- /dev/null +++ b/platforms/Windows/python/python.wxs @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/platforms/Windows/readme.md b/platforms/Windows/readme.md index 80e8bd4f..b90ef55c 100644 --- a/platforms/Windows/readme.md +++ b/platforms/Windows/readme.md @@ -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. | @@ -149,6 +150,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) | | WindowsArchitectures | Semicolon delimited list of architectures the Windows platform supports (aarch64;i686;x86_64) | @@ -165,10 +167,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 ``` @@ -216,7 +219,7 @@ Note that these GUIDs are substituted at bind time so they skip the normal valid | Property | Description | | -------- | ----------- | -| BldUpgradeCode, CliUpgradeCode, DbgUpgradeCode, IdeUpgradeCode, 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`. | +| BldUpgradeCode, CliUpgradeCode, DbgUpgradeCode, IdeUpgradeCode, 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. | diff --git a/platforms/Windows/shared/shared.wxs b/platforms/Windows/shared/shared.wxs index b1dd1330..296f1eb2 100644 --- a/platforms/Windows/shared/shared.wxs +++ b/platforms/Windows/shared/shared.wxs @@ -52,6 +52,7 @@ + diff --git a/platforms/Windows/shared/swift.en-us.wxl b/platforms/Windows/shared/swift.en-us.wxl index 7b6517ea..c8cb713f 100644 --- a/platforms/Windows/shared/swift.en-us.wxl +++ b/platforms/Windows/shared/swift.en-us.wxl @@ -5,6 +5,7 @@ + From 9bfd4e3aef7879d897ce07d3de50e74096c11c18 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Thu, 20 Nov 2025 12:33:22 -0800 Subject: [PATCH 2/2] WiX: clean up the python packaging Restructure the python installation to mimic the Unix style layout that we use throughout the components. Specifically, migrate the .exe and .dll files into a `/usr/bin` subdirectory under the installation and move the license into the package itself. --- platforms/Windows/python/python.wxs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/platforms/Windows/python/python.wxs b/platforms/Windows/python/python.wxs index b4b8fefc..e2e52f08 100644 --- a/platforms/Windows/python/python.wxs +++ b/platforms/Windows/python/python.wxs @@ -21,10 +21,16 @@ - + + + + + + + - + @@ -124,17 +130,14 @@ - - - + - - \ No newline at end of file +