Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 2 additions & 0 deletions platforms/Windows/SideBySideUpgradeStrategy.props
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<RtlUpgradeCode>{BEA8C6DC-F73E-445B-9486-2333D1CF2886}</RtlUpgradeCode>
<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 @@ -61,6 +62,7 @@
RtlUpgradeCode=$(RtlUpgradeCode);
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 @@ -20,6 +20,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\asserts\python.wixproj" BindName="python" />
<ProjectReference Include="..\rtl\msi\rtlmsi.wixproj" BindName="rtl" />
</ItemGroup>

Expand Down
7 changes: 7 additions & 0 deletions platforms/Windows/bundle/installer.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,13 @@
<MsiProperty Name="INSTALLROOT" Value="[InstallRoot]" />
</MsiPackage>

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

<MsiPackage
SourceFile="!(bindpath.ide.asserts)\ide.asserts.msi"
InstallCondition="OptionsInstallIDE = 1"
Expand Down
2 changes: 1 addition & 1 deletion platforms/Windows/bundle/theme.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
<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="OptionsInstallEmbeddedPython" X="192" Y="417" Width="-11" Height="17" TabStop="yes" FontId="3">#(loc.EmbeddedPython_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/asserts/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>
11 changes: 11 additions & 0 deletions platforms/Windows/python/asserts/python.wxs
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<?define VariantName = asserts ?>
Copy link
Member

Choose a reason for hiding this comment

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

Do we need the VariantName now?

<?define VariantUpgradeCode = $(PythonUpgradeCode)?>
<?define VariantProductName = !(loc.EmbeddedPython_ProductName)?>
<?define VariantCabinetName = python.asserts.cab?>
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
<?define VariantCabinetName = python.asserts.cab?>
<?define VariantCabinetName = python.cab?>

Comment on lines +3 to +5
Copy link
Member

Choose a reason for hiding this comment

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

I think that we should be able to drop the Variant in the variable names now.

<?define ToolchainVersionedVariantDirectory = ToolchainVersionedAsserts ?>
Copy link
Member

Choose a reason for hiding this comment

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

Do we need the ToolchainVersionedVariantDirectory define now?

<?define VariantEnvironmentComponentGUID = 30629e0c-b376-47bc-bedf-fefb7d4ca61d?>
<?define PythonRoot = "$(ImageRoot)\Python"?>

<?include ../python.wxi ?>
</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

Copy link
Author

Choose a reason for hiding this comment

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

Fixed, thanks 👍

159 changes: 159 additions & 0 deletions platforms/Windows/python/python.wxi
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
<?xml version="1.0" encoding="utf-8"?>
<Include xmlns="http://wixtoolset.org/schemas/v4/wxs">

Copy link
Member

Choose a reason for hiding this comment

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

Extraneous whitespace

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

<Media Id="1" Cabinet="$(VariantCabinetName)" EmbedCab="$(ArePackageCabsEmbedded)" />

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

<ComponentGroup Id="EmbeddedPython">
Copy link
Member

Choose a reason for hiding this comment

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

Can the directory attribute be moved to the ComponentGroup instead of the Component? That would simplify the authoring here.

Copy link
Author

Choose a reason for hiding this comment

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

Fixed, thanks 👍

<Component Directory="toolchain_$(VariantName)_usr_bin">
<File Source="$(PythonRoot)\libcrypto-1_1-arm64.dll" />
Copy link
Member

Choose a reason for hiding this comment

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

Is this file included on both ARM64 and AMD64?

Copy link
Author

Choose a reason for hiding this comment

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

It's not, I've added the ArchSuffix define to address this. Thanks!

</Component>

Copy link
Member

Choose a reason for hiding this comment

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

I would drop the whitespace between the components.

<Component Directory="toolchain_$(VariantName)_usr_bin">
<File Source="$(PythonRoot)\libffi-7.dll" />
</Component>

<Component Directory="toolchain_$(VariantName)_usr_bin">
<File Source="$(PythonRoot)\libssl-1_1-arm64.dll" />
Copy link
Member

Choose a reason for hiding this comment

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

Likewise

Copy link
Author

Choose a reason for hiding this comment

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

It's not, I've added the ArchSuffix define to address this. Thanks!

</Component>

<Component Directory="toolchain_$(VariantName)_usr_bin">
<File Source="$(PythonRoot)\LICENSE.txt" />
</Component>
Copy link
Member

Choose a reason for hiding this comment

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

Why is the LICENSE file in /usr/bin? Shouldn't that be under /usr/share/licenses?

Copy link
Author

Choose a reason for hiding this comment

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

I did not know about usr/share/licenses. Created the directory and added the license there 👍


<Component Directory="toolchain_$(VariantName)_usr_bin">
<File Source="$(PythonRoot)\pyexpat.pyd" />
</Component>

<Component Directory="toolchain_$(VariantName)_usr_bin">
<File Source="$(PythonRoot)\python.cat" />
</Component>

<Component Directory="toolchain_$(VariantName)_usr_bin">
<File Source="$(PythonRoot)\python.exe" />
</Component>

<Component Directory="toolchain_$(VariantName)_usr_bin">
<File Source="$(PythonRoot)\python3.dll" />
</Component>

<Component Directory="toolchain_$(VariantName)_usr_bin">
<File Source="$(PythonRoot)\python310.dll" />
</Component>

<Component Directory="toolchain_$(VariantName)_usr_bin">
<File Source="$(PythonRoot)\python310.zip" />
</Component>

<Component Directory="toolchain_$(VariantName)_usr_bin">
<File Source="$(PythonRoot)\python310._pth" />
</Component>

<Component Directory="toolchain_$(VariantName)_usr_bin">
<File Source="$(PythonRoot)\pythonw.exe" />
</Component>

<Component Directory="toolchain_$(VariantName)_usr_bin">
<File Source="$(PythonRoot)\select.pyd" />
</Component>

<Component Directory="toolchain_$(VariantName)_usr_bin">
<File Source="$(PythonRoot)\sqlite3.dll" />
</Component>

<Component Directory="toolchain_$(VariantName)_usr_bin">
<File Source="$(PythonRoot)\unicodedata.pyd" />
</Component>

<Component Directory="toolchain_$(VariantName)_usr_bin">
<File Source="$(PythonRoot)\vcruntime140.dll" />
</Component>

<Component Directory="toolchain_$(VariantName)_usr_bin">
<File Source="$(PythonRoot)\vcruntime140_1.dll" />
</Component>
Copy link
Member

Choose a reason for hiding this comment

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

This brings up the question - do we want to bundle an additional copy of the VCRuntime? This is an interesting question because the toolchain itself also does depend on the runtime. There is a copy in the system. And now in python. The system one however will get security updates, this will not. Since part of the argument for this upgrade is "security" - we shouldn't be bundling them IMO.

Copy link
Author

Choose a reason for hiding this comment

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

Removed them 👍


<Component Directory="toolchain_$(VariantName)_usr_bin">
<File Source="$(PythonRoot)\winsound.pyd" />
</Component>

<Component Directory="toolchain_$(VariantName)_usr_bin">
<File Source="$(PythonRoot)\_asyncio.pyd" />
</Component>

<Component Directory="toolchain_$(VariantName)_usr_bin">
<File Source="$(PythonRoot)\_bz2.pyd" />
</Component>

<Component Directory="toolchain_$(VariantName)_usr_bin">
<File Source="$(PythonRoot)\_ctypes.pyd" />
</Component>

<Component Directory="toolchain_$(VariantName)_usr_bin">
<File Source="$(PythonRoot)\_decimal.pyd" />
</Component>

<Component Directory="toolchain_$(VariantName)_usr_bin">
<File Source="$(PythonRoot)\_elementtree.pyd" />
</Component>

<Component Directory="toolchain_$(VariantName)_usr_bin">
<File Source="$(PythonRoot)\_hashlib.pyd" />
</Component>

<Component Directory="toolchain_$(VariantName)_usr_bin">
<File Source="$(PythonRoot)\_lzma.pyd" />
</Component>

<Component Directory="toolchain_$(VariantName)_usr_bin">
<File Source="$(PythonRoot)\_msi.pyd" />
</Component>

<Component Directory="toolchain_$(VariantName)_usr_bin">
<File Source="$(PythonRoot)\_multiprocessing.pyd" />
</Component>

<Component Directory="toolchain_$(VariantName)_usr_bin">
<File Source="$(PythonRoot)\_overlapped.pyd" />
</Component>

<Component Directory="toolchain_$(VariantName)_usr_bin">
<File Source="$(PythonRoot)\_queue.pyd" />
</Component>

<Component Directory="toolchain_$(VariantName)_usr_bin">
<File Source="$(PythonRoot)\_socket.pyd" />
</Component>

<Component Directory="toolchain_$(VariantName)_usr_bin">
<File Source="$(PythonRoot)\_sqlite3.pyd" />
</Component>

<Component Directory="toolchain_$(VariantName)_usr_bin">
<File Source="$(PythonRoot)\_ssl.pyd" />
</Component>

<Component Directory="toolchain_$(VariantName)_usr_bin">
<File Source="$(PythonRoot)\_uuid.pyd" />
</Component>

<Component Directory="toolchain_$(VariantName)_usr_bin">
<File Source="$(PythonRoot)\_zoneinfo.pyd" />
</Component>
</ComponentGroup>

<Feature Id="EmbeddedPython" AllowAbsent="yes" Title="$(VariantProductName)">
Copy link
Member

Choose a reason for hiding this comment

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

I don't think that we should allow this component to be absent. We would install nothing then.

Copy link
Author

Choose a reason for hiding this comment

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

Fixed, thanks 👍

<ComponentGroupRef Id="EmbeddedPython" />
</Feature>
</Package>
</Include>
3 changes: 2 additions & 1 deletion 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. |
| OptionsInstallEmbeddedPython | 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 @@ -216,7 +217,7 @@ Note that these GUIDs are substituted at bind time so they skip the normal valid

| Property | Description |
| -------- | ----------- |
| 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`. |
| 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`. |
| 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
1 change: 1 addition & 0 deletions platforms/Windows/shared/swift.en-us.wxl
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<String Id="CliAsserts_ProductName" Value="Swift Command Line Tools (Asserts)" />
<String Id="Dbg_ProductName" Value="Swift Debugging Tools" />
<String Id="DbgAsserts_ProductName" Value="Swift Debugging Tools (Asserts)" />
<String Id="EmbeddedPython_ProductName" Value="Embedded Python 3.10.1" />
<String Id="Ide_ProductName" Value="Swift IDE Integration Tools" />
<String Id="IdeAsserts_ProductName" Value="Swift IDE Integration Tools (Asserts)" />
<String Id="Rtl_ProductName" Value="Swift Windows Runtime" />
Expand Down