Skip to content

Commit 91159fc

Browse files
[windows] add Python 3.10.1 to the installer
1 parent f159aa2 commit 91159fc

File tree

9 files changed

+189
-2
lines changed

9 files changed

+189
-2
lines changed

platforms/Windows/SideBySideUpgradeStrategy.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
<RtlUpgradeCode>{BEA8C6DC-F73E-445B-9486-2333D1CF2886}</RtlUpgradeCode>
2525
<AndroidPlatformUpgradeCode>{313B9C1F-D5B5-4FED-B7E0-138F1EE6B26A}</AndroidPlatformUpgradeCode>
2626
<WindowsPlatformUpgradeCode>{01AFF1CF-A025-41B6-BCBC-728D794353FD}</WindowsPlatformUpgradeCode>
27+
<PythonUpgradeCode>{5FC42BA9-ABF5-4CCD-B93B-BDFED936BA37}</PythonUpgradeCode>
2728
</PropertyGroup>
2829

2930
<PropertyGroup Condition="'$(MajorMinorProductVersion)' == '0.0'">
@@ -61,6 +62,7 @@
6162
RtlUpgradeCode=$(RtlUpgradeCode);
6263
AndroidPlatformUpgradeCode=$(AndroidPlatformUpgradeCode);
6364
WindowsPlatformUpgradeCode=$(WindowsPlatformUpgradeCode);
65+
PythonUpgradeCode=$(PythonUpgradeCode);
6466
</DefineConstants>
6567
</PropertyGroup>
6668
</Project>

platforms/Windows/bundle/installer.wixproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
<ProjectReference Include="..\cli\asserts\cli.asserts.wixproj" BindName="cli.asserts" />
2121
<ProjectReference Include="..\dbg\asserts\dbg.asserts.wixproj" BindName="dbg.asserts" />
2222
<ProjectReference Include="..\ide\asserts\ide.asserts.wixproj" BindName="ide.asserts" />
23+
<ProjectReference Include="..\python\asserts\python.wixproj" BindName="python" />
2324
<ProjectReference Include="..\rtl\msi\rtlmsi.wixproj" BindName="rtl" />
2425
</ItemGroup>
2526

platforms/Windows/bundle/installer.wxs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,13 @@
101101
<MsiProperty Name="INSTALLROOT" Value="[InstallRoot]" />
102102
</MsiPackage>
103103

104+
<MsiPackage
105+
SourceFile="!(bindpath.python)\python.msi"
106+
InstallCondition="OptionsInstallEmbeddedPython = 1"
107+
DownloadUrl="$(BaseReleaseDownloadUrl)/{2}">
108+
<MsiProperty Name="INSTALLROOT" Value="[InstallRoot]" />
109+
</MsiPackage>
110+
104111
<MsiPackage
105112
SourceFile="!(bindpath.ide.asserts)\ide.asserts.msi"
106113
InstallCondition="OptionsInstallIDE = 1"

platforms/Windows/bundle/theme.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
<Checkbox Name="OptionsInstallAndroidSDKAMD64" X="210" Y="363" Width="-11" Height="17" TabStop="yes" FontId="3" EnableCondition="OptionsInstallAndroidPlatform">#(loc.Sdk_ProductName_Android_amd64)</Checkbox>
7474
<Checkbox Name="OptionsInstallAndroidSDKARM" X="210" Y="381" Width="-11" Height="17" TabStop="yes" FontId="3" EnableCondition="OptionsInstallAndroidPlatform">#(loc.Sdk_ProductName_Android_armv7)</Checkbox>
7575
<Checkbox Name="OptionsInstallAndroidSDKX86" X="210" Y="399" Width="-11" Height="17" TabStop="yes" FontId="3" EnableCondition="OptionsInstallAndroidPlatform">#(loc.Sdk_ProductName_Android_x86)</Checkbox>
76-
76+
<Checkbox Name="OptionsInstallEmbeddedPython" X="192" Y="417" Width="-11" Height="17" TabStop="yes" FontId="3">#(loc.EmbeddedPython_ProductName)</Checkbox>
7777
<Button Name="OptionsOkButton" X="-91" Y="-11" Width="75" Height="23" TabStop="yes" FontId="0">
7878
<Text>#(loc.OptionsOkButton)</Text>
7979
<ChangePageAction Page="Install" />
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<Project Sdk="WixToolset.Sdk/4.0.5">
2+
<PropertyGroup>
3+
<OutputName>python</OutputName>
4+
</PropertyGroup>
5+
</Project>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
2+
<?define VariantName = asserts ?>
3+
<?define VariantUpgradeCode = $(PythonUpgradeCode)?>
4+
<?define VariantProductName = !(loc.EmbeddedPython_ProductName)?>
5+
<?define VariantCabinetName = python.asserts.cab?>
6+
<?define ToolchainVersionedVariantDirectory = ToolchainVersionedAsserts ?>
7+
<?define VariantEnvironmentComponentGUID = 30629e0c-b376-47bc-bedf-fefb7d4ca61d?>
8+
<?define PythonRoot = "$(ImageRoot)\Python"?>
9+
10+
<?include ../python.wxi ?>
11+
</Wix>

platforms/Windows/python/python.wxi

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Include xmlns="http://wixtoolset.org/schemas/v4/wxs">
3+
4+
<Package
5+
Language="1033"
6+
Manufacturer="!(loc.ManufacturerName)"
7+
Name="$(VariantProductName)"
8+
UpgradeCode="$(VariantUpgradeCode)"
9+
Version="$(NonSemVerProductVersion)"
10+
Scope="$(PackageScope)">
11+
12+
<Media Id="1" Cabinet="$(VariantCabinetName)" EmbedCab="$(ArePackageCabsEmbedded)" />
13+
14+
<WixVariable Id="SideBySidePackageUpgradeCode" Value="$(VariantUpgradeCode)" />
15+
<FeatureGroupRef Id="SideBySideUpgradeStrategy" />
16+
17+
<ComponentGroup Id="EmbeddedPython">
18+
<Component Directory="toolchain_$(VariantName)_usr_bin">
19+
<File Source="$(PythonRoot)\libcrypto-1_1-arm64.dll" />
20+
</Component>
21+
22+
<Component Directory="toolchain_$(VariantName)_usr_bin">
23+
<File Source="$(PythonRoot)\libffi-7.dll" />
24+
</Component>
25+
26+
<Component Directory="toolchain_$(VariantName)_usr_bin">
27+
<File Source="$(PythonRoot)\libssl-1_1-arm64.dll" />
28+
</Component>
29+
30+
<Component Directory="toolchain_$(VariantName)_usr_bin">
31+
<File Source="$(PythonRoot)\LICENSE.txt" />
32+
</Component>
33+
34+
<Component Directory="toolchain_$(VariantName)_usr_bin">
35+
<File Source="$(PythonRoot)\pyexpat.pyd" />
36+
</Component>
37+
38+
<Component Directory="toolchain_$(VariantName)_usr_bin">
39+
<File Source="$(PythonRoot)\python.cat" />
40+
</Component>
41+
42+
<Component Directory="toolchain_$(VariantName)_usr_bin">
43+
<File Source="$(PythonRoot)\python.exe" />
44+
</Component>
45+
46+
<Component Directory="toolchain_$(VariantName)_usr_bin">
47+
<File Source="$(PythonRoot)\python3.dll" />
48+
</Component>
49+
50+
<Component Directory="toolchain_$(VariantName)_usr_bin">
51+
<File Source="$(PythonRoot)\python310.dll" />
52+
</Component>
53+
54+
<Component Directory="toolchain_$(VariantName)_usr_bin">
55+
<File Source="$(PythonRoot)\python310.zip" />
56+
</Component>
57+
58+
<Component Directory="toolchain_$(VariantName)_usr_bin">
59+
<File Source="$(PythonRoot)\python310._pth" />
60+
</Component>
61+
62+
<Component Directory="toolchain_$(VariantName)_usr_bin">
63+
<File Source="$(PythonRoot)\pythonw.exe" />
64+
</Component>
65+
66+
<Component Directory="toolchain_$(VariantName)_usr_bin">
67+
<File Source="$(PythonRoot)\select.pyd" />
68+
</Component>
69+
70+
<Component Directory="toolchain_$(VariantName)_usr_bin">
71+
<File Source="$(PythonRoot)\sqlite3.dll" />
72+
</Component>
73+
74+
<Component Directory="toolchain_$(VariantName)_usr_bin">
75+
<File Source="$(PythonRoot)\unicodedata.pyd" />
76+
</Component>
77+
78+
<Component Directory="toolchain_$(VariantName)_usr_bin">
79+
<File Source="$(PythonRoot)\vcruntime140.dll" />
80+
</Component>
81+
82+
<Component Directory="toolchain_$(VariantName)_usr_bin">
83+
<File Source="$(PythonRoot)\vcruntime140_1.dll" />
84+
</Component>
85+
86+
<Component Directory="toolchain_$(VariantName)_usr_bin">
87+
<File Source="$(PythonRoot)\winsound.pyd" />
88+
</Component>
89+
90+
<Component Directory="toolchain_$(VariantName)_usr_bin">
91+
<File Source="$(PythonRoot)\_asyncio.pyd" />
92+
</Component>
93+
94+
<Component Directory="toolchain_$(VariantName)_usr_bin">
95+
<File Source="$(PythonRoot)\_bz2.pyd" />
96+
</Component>
97+
98+
<Component Directory="toolchain_$(VariantName)_usr_bin">
99+
<File Source="$(PythonRoot)\_ctypes.pyd" />
100+
</Component>
101+
102+
<Component Directory="toolchain_$(VariantName)_usr_bin">
103+
<File Source="$(PythonRoot)\_decimal.pyd" />
104+
</Component>
105+
106+
<Component Directory="toolchain_$(VariantName)_usr_bin">
107+
<File Source="$(PythonRoot)\_elementtree.pyd" />
108+
</Component>
109+
110+
<Component Directory="toolchain_$(VariantName)_usr_bin">
111+
<File Source="$(PythonRoot)\_hashlib.pyd" />
112+
</Component>
113+
114+
<Component Directory="toolchain_$(VariantName)_usr_bin">
115+
<File Source="$(PythonRoot)\_lzma.pyd" />
116+
</Component>
117+
118+
<Component Directory="toolchain_$(VariantName)_usr_bin">
119+
<File Source="$(PythonRoot)\_msi.pyd" />
120+
</Component>
121+
122+
<Component Directory="toolchain_$(VariantName)_usr_bin">
123+
<File Source="$(PythonRoot)\_multiprocessing.pyd" />
124+
</Component>
125+
126+
<Component Directory="toolchain_$(VariantName)_usr_bin">
127+
<File Source="$(PythonRoot)\_overlapped.pyd" />
128+
</Component>
129+
130+
<Component Directory="toolchain_$(VariantName)_usr_bin">
131+
<File Source="$(PythonRoot)\_queue.pyd" />
132+
</Component>
133+
134+
<Component Directory="toolchain_$(VariantName)_usr_bin">
135+
<File Source="$(PythonRoot)\_socket.pyd" />
136+
</Component>
137+
138+
<Component Directory="toolchain_$(VariantName)_usr_bin">
139+
<File Source="$(PythonRoot)\_sqlite3.pyd" />
140+
</Component>
141+
142+
<Component Directory="toolchain_$(VariantName)_usr_bin">
143+
<File Source="$(PythonRoot)\_ssl.pyd" />
144+
</Component>
145+
146+
<Component Directory="toolchain_$(VariantName)_usr_bin">
147+
<File Source="$(PythonRoot)\_uuid.pyd" />
148+
</Component>
149+
150+
<Component Directory="toolchain_$(VariantName)_usr_bin">
151+
<File Source="$(PythonRoot)\_zoneinfo.pyd" />
152+
</Component>
153+
</ComponentGroup>
154+
155+
<Feature Id="EmbeddedPython" AllowAbsent="yes" Title="$(VariantProductName)">
156+
<ComponentGroupRef Id="EmbeddedPython" />
157+
</Feature>
158+
</Package>
159+
</Include>

platforms/Windows/readme.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ The bundle authoring (in `installer.wxs`) drives optional install directory and
3434
| 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. |
3535
| OptionsInstallCLI | Controls whether command-line tools will be installed. |
3636
| OptionsInstallDBG | Controls whether debugging tools will be installed. |
37+
| OptionsInstallEmbeddedPython | Controls whether embeddable Python will be installed. |
3738
| OptionsInstallIDE | Controls whether IDE integration tools will be installed. |
3839
| OptionsInstallUtilties | Controls whether additional utilities will be installed. |
3940
| OptionsInstallAndroidPlatform | Controls whether the Android platform will be installed. |
@@ -216,7 +217,7 @@ Note that these GUIDs are substituted at bind time so they skip the normal valid
216217

217218
| Property | Description |
218219
| -------- | ----------- |
219-
| BldAssertsUpgradeCode, CliAssertsUpgradeCode, DbgAssertsUpgradeCode, 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`. |
220+
| BldAssertsUpgradeCode, CliAssertsUpgradeCode, DbgAssertsUpgradeCode, 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`. |
220221
| 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. |
221222

222223

platforms/Windows/shared/swift.en-us.wxl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
<String Id="CliAsserts_ProductName" Value="Swift Command Line Tools (Asserts)" />
99
<String Id="Dbg_ProductName" Value="Swift Debugging Tools" />
1010
<String Id="DbgAsserts_ProductName" Value="Swift Debugging Tools (Asserts)" />
11+
<String Id="EmbeddedPython_ProductName" Value="Embedded Python 3.10.1" />
1112
<String Id="Ide_ProductName" Value="Swift IDE Integration Tools" />
1213
<String Id="IdeAsserts_ProductName" Value="Swift IDE Integration Tools (Asserts)" />
1314
<String Id="Rtl_ProductName" Value="Swift Windows Runtime" />

0 commit comments

Comments
 (0)