summaryrefslogtreecommitdiffstats
path: root/Tools
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@python.org>2024-01-17 21:52:23 (GMT)
committerGitHub <noreply@github.com>2024-01-17 21:52:23 (GMT)
commitf56d132deb9fff861439ed56ed7414d22e4e4bb9 (patch)
tree69e70221cd40f134de9abf1292f228ec7d5c9c11 /Tools
parent78fcde039a33d8463e34356d5462fecee0f2831a (diff)
downloadcpython-f56d132deb9fff861439ed56ed7414d22e4e4bb9.zip
cpython-f56d132deb9fff861439ed56ed7414d22e4e4bb9.tar.gz
cpython-f56d132deb9fff861439ed56ed7414d22e4e4bb9.tar.bz2
gh-112984 Update Windows build and installer for free-threaded builds (GH-113129)
Diffstat (limited to 'Tools')
-rw-r--r--Tools/msi/build.bat17
-rw-r--r--Tools/msi/bundle/Default.thm1
-rw-r--r--Tools/msi/bundle/Default.wxl1
-rw-r--r--Tools/msi/bundle/bundle.targets1
-rw-r--r--Tools/msi/bundle/bundle.wxs10
-rw-r--r--Tools/msi/bundle/packagegroups/freethreaded.wxs62
-rw-r--r--Tools/msi/freethreaded/freethreaded.wixproj20
-rw-r--r--Tools/msi/freethreaded/freethreaded.wxs18
-rw-r--r--Tools/msi/freethreaded/freethreaded_d.wixproj20
-rw-r--r--Tools/msi/freethreaded/freethreaded_d.wxs16
-rw-r--r--Tools/msi/freethreaded/freethreaded_en-US.wxl_template8
-rw-r--r--Tools/msi/freethreaded/freethreaded_files.wxs175
-rw-r--r--Tools/msi/freethreaded/freethreaded_pdb.wixproj20
-rw-r--r--Tools/msi/freethreaded/freethreaded_pdb.wxs15
-rw-r--r--Tools/msi/lib/lib_files.wxs12
-rw-r--r--Tools/msi/msi.props33
16 files changed, 413 insertions, 16 deletions
diff --git a/Tools/msi/build.bat b/Tools/msi/build.bat
index b9aab88..2fe8a47 100644
--- a/Tools/msi/build.bat
+++ b/Tools/msi/build.bat
@@ -22,6 +22,9 @@ if "%~1" EQU "--no-test-marker" (set BUILDTEST=) && shift && goto CheckOpts
if "%~1" EQU "--test-marker" (set BUILDTEST=--test-marker) && shift && goto CheckOpts
if "%~1" EQU "--pack" (set BUILDPACK=1) && shift && goto CheckOpts
if "%~1" EQU "-r" (set REBUILD=-r) && shift && goto CheckOpts
+rem %IncludeFreethreaded% is recognised by the MSI build, but not the regular build.
+rem We use it to build twice and then build the installer with its extra option
+if /I "%~1" EQU "--disable-gil" (set IncludeFreethreaded=true) && shift && goto CheckOpts
if not defined BUILDX86 if not defined BUILDX64 if not defined BUILDARM64 (set BUILDX86=1) && (set BUILDX64=1)
@@ -44,6 +47,20 @@ if errorlevel 1 exit /B %ERRORLEVEL%
if defined BUILDARM64 call "%PCBUILD%build.bat" -p ARM64 -e %REBUILD% %BUILDTEST%
if errorlevel 1 exit /B %ERRORLEVEL%
+if /I "%IncludeFreethreaded%"=="true" (
+ rem Cannot "exit /B" inside an if block because %ERRORLEVEL% will be wrong.
+ rem We just skip everything after the first "errorlevel 1" and then exit after
+ if defined BUILDX86 call "%PCBUILD%build.bat" -p Win32 -d -e %REBUILD% %BUILDTEST% --disable-gil
+ if not errorlevel 1 if defined BUILDX86 call "%PCBUILD%build.bat" -p Win32 -e %REBUILD% %BUILDTEST% --disable-gil
+
+ if not errorlevel 1 if defined BUILDX64 call "%PCBUILD%build.bat" -p x64 -d -e %REBUILD% %BUILDTEST% --disable-gil
+ if not errorlevel 1 if defined BUILDX64 call "%PCBUILD%build.bat" -p x64 -e %REBUILD% %BUILDTEST% --disable-gil
+
+ if not errorlevel 1 if defined BUILDARM64 call "%PCBUILD%build.bat" -p ARM64 -d -e %REBUILD% %BUILDTEST% --disable-gil
+ if not errorlevel 1 if defined BUILDARM64 call "%PCBUILD%build.bat" -p ARM64 -e %REBUILD% %BUILDTEST% --disable-gil
+)
+if errorlevel 1 exit /B %ERRORLEVEL%
+
if defined BUILDDOC call "%PCBUILD%..\Doc\make.bat" html
if errorlevel 1 exit /B %ERRORLEVEL%
diff --git a/Tools/msi/bundle/Default.thm b/Tools/msi/bundle/Default.thm
index d1b0f5b..471d37a 100644
--- a/Tools/msi/bundle/Default.thm
+++ b/Tools/msi/bundle/Default.thm
@@ -83,6 +83,7 @@
<Checkbox Name="CompileAll" X="185" Y="151" Width="-11" Height="24" TabStop="yes" FontId="3" HideWhenDisabled="no">#(loc.PrecompileLabel)</Checkbox>
<Checkbox Name="Include_symbols" X="185" Y="176" Width="-11" Height="24" TabStop="yes" FontId="3" HideWhenDisabled="no">#(loc.Include_symbolsLabel)</Checkbox>
<Checkbox Name="Include_debug" X="185" Y="201" Width="-11" Height="24" TabStop="yes" FontId="3" HideWhenDisabled="no">#(loc.Include_debugLabel)</Checkbox>
+ <Checkbox Name="Include_freethreaded" X="185" Y="226" Width="-11" Height="24" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.Include_freethreadedLabel)</Checkbox>
<Text X="185" Y="256" Width="-11" Height="17" FontId="3">#(loc.CustomLocationLabel)</Text>
<Editbox Name="TargetDir" X="185" Y="277" Width="-101" Height="27" TabStop="yes" FontId="3" FileSystemAutoComplete="yes" />
diff --git a/Tools/msi/bundle/Default.wxl b/Tools/msi/bundle/Default.wxl
index 6f8befb..1540f05 100644
--- a/Tools/msi/bundle/Default.wxl
+++ b/Tools/msi/bundle/Default.wxl
@@ -91,6 +91,7 @@ Select Customize to review current options.</String>
<String Id="PrecompileLabel">&amp;Precompile standard library</String>
<String Id="Include_symbolsLabel">Download debugging &amp;symbols</String>
<String Id="Include_debugLabel">Download debu&amp;g binaries (requires VS 2017 or later)</String>
+ <String Id="Include_freethreadedLabel">Download &amp;free-threaded binaries (experimental)</String>
<String Id="ProgressHeader">[ActionLikeInstallation] Progress</String>
<String Id="ProgressLabel">[ActionLikeInstalling]:</String>
diff --git a/Tools/msi/bundle/bundle.targets b/Tools/msi/bundle/bundle.targets
index 9c7410f..cb3effb 100644
--- a/Tools/msi/bundle/bundle.targets
+++ b/Tools/msi/bundle/bundle.targets
@@ -72,6 +72,7 @@
<Package Include="..\tcltk\tcltk*.wixproj" />
<Package Include="..\test\test*.wixproj" />
<Package Include="..\ucrt\ucrt*.wixproj" Condition="$(Platform) != 'ARM64'" />
+ <Package Include="..\freethreaded\freethreaded*.wixproj" Condition="$(IncludeFreethreaded) == 'true'" />
</ItemGroup>
<PropertyGroup>
diff --git a/Tools/msi/bundle/bundle.wxs b/Tools/msi/bundle/bundle.wxs
index 8b12baa..9b4f072 100644
--- a/Tools/msi/bundle/bundle.wxs
+++ b/Tools/msi/bundle/bundle.wxs
@@ -82,6 +82,13 @@
<?endif ?>
<Variable Name="Include_symbols" Value="0" bal:Overridable="yes" />
<Variable Name="Include_debug" Value="0" bal:Overridable="yes" />
+ <?if $(var.IncludeFreethreaded)~="true" ?>
+ <Variable Name="Include_freethreaded" Value="0" bal:Overridable="yes" />
+ <Variable Name="Include_freethreadedState" Value="enabled" />
+ <?else ?>
+ <Variable Name="Include_freethreaded" Value="0" />
+ <Variable Name="Include_freethreadedState" Value="disable" />
+ <?endif ?>
<Variable Name="LauncherOnly" Value="0" bal:Overridable="yes" />
<Variable Name="DetectedLauncher" Value="0" />
@@ -104,6 +111,9 @@
<PackageGroupRef Id="exe" />
<PackageGroupRef Id="dev" />
<PackageGroupRef Id="lib" />
+ <?if $(var.IncludeFreethreaded)~="true" ?>
+ <PackageGroupRef Id="freethreaded" />
+ <?endif ?>
<PackageGroupRef Id="test" />
<PackageGroupRef Id="doc" />
<PackageGroupRef Id="tcltk" />
diff --git a/Tools/msi/bundle/packagegroups/freethreaded.wxs b/Tools/msi/bundle/packagegroups/freethreaded.wxs
new file mode 100644
index 0000000..121ca34
--- /dev/null
+++ b/Tools/msi/bundle/packagegroups/freethreaded.wxs
@@ -0,0 +1,62 @@
+<?xml version="1.0"?>
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
+ <Fragment>
+ <PackageGroup Id="freethreaded">
+ <MsiPackage Id="freethreaded_AllUsers"
+ SourceFile="freethreaded.msi"
+ Compressed="no"
+ DownloadUrl="$(var.DownloadUrl)"
+ ForcePerMachine="yes"
+ InstallCondition="InstallAllUsers and (Include_freethreaded) and not LauncherOnly">
+ <MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
+ <MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
+ </MsiPackage>
+ <MsiPackage Id="freethreaded_AllUsers_pdb"
+ SourceFile="freethreaded_pdb.msi"
+ Compressed="no"
+ DownloadUrl="$(var.DownloadUrl)"
+ ForcePerMachine="yes"
+ InstallCondition="InstallAllUsers and (Include_freethreaded) and Include_symbols and not LauncherOnly">
+ <MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
+ <MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
+ </MsiPackage>
+ <MsiPackage Id="freethreaded_AllUsers_d"
+ SourceFile="freethreaded_d.msi"
+ Compressed="no"
+ DownloadUrl="$(var.DownloadUrl)"
+ ForcePerMachine="yes"
+ InstallCondition="InstallAllUsers and (Include_freethreaded) and Include_debug and not LauncherOnly">
+ <MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
+ <MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
+ </MsiPackage>
+
+ <MsiPackage Id="freethreaded_JustForMe"
+ SourceFile="freethreaded.msi"
+ Compressed="no"
+ DownloadUrl="$(var.DownloadUrl)"
+ ForcePerMachine="no"
+ InstallCondition="not InstallAllUsers and (Include_freethreaded) and not LauncherOnly">
+ <MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
+ <MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
+ </MsiPackage>
+ <MsiPackage Id="freethreaded_JustForMe_pdb"
+ SourceFile="freethreaded_pdb.msi"
+ Compressed="no"
+ DownloadUrl="$(var.DownloadUrl)"
+ ForcePerMachine="no"
+ InstallCondition="not InstallAllUsers and (Include_freethreaded) and Include_symbols and not LauncherOnly">
+ <MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
+ <MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
+ </MsiPackage>
+ <MsiPackage Id="freethreaded_JustForMe_d"
+ SourceFile="freethreaded_d.msi"
+ Compressed="no"
+ DownloadUrl="$(var.DownloadUrl)"
+ ForcePerMachine="no"
+ InstallCondition="not InstallAllUsers and (Include_freethreaded) and Include_debug and not LauncherOnly">
+ <MsiProperty Name="TARGETDIR" Value="[TargetDir]" />
+ <MsiProperty Name="OPTIONALFEATURESREGISTRYKEY" Value="[OptionalFeaturesRegistryKey]" />
+ </MsiPackage>
+ </PackageGroup>
+ </Fragment>
+</Wix> \ No newline at end of file
diff --git a/Tools/msi/freethreaded/freethreaded.wixproj b/Tools/msi/freethreaded/freethreaded.wixproj
new file mode 100644
index 0000000..0b4bd05
--- /dev/null
+++ b/Tools/msi/freethreaded/freethreaded.wixproj
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <ProjectGuid>{1B4502D5-B627-4F50-ABEA-4CC5A8E88265}</ProjectGuid>
+ <SchemaVersion>2.0</SchemaVersion>
+ <OutputName>freethreaded</OutputName>
+ <OutputType>Package</OutputType>
+ </PropertyGroup>
+ <Import Project="..\msi.props" />
+ <ItemGroup>
+ <Compile Include="freethreaded.wxs" />
+ <Compile Include="freethreaded_files.wxs" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="*.wxl" />
+ <WxlTemplate Include="*.wxl_template" />
+ </ItemGroup>
+
+ <Import Project="..\msi.targets" />
+</Project> \ No newline at end of file
diff --git a/Tools/msi/freethreaded/freethreaded.wxs b/Tools/msi/freethreaded/freethreaded.wxs
new file mode 100644
index 0000000..063aa28
--- /dev/null
+++ b/Tools/msi/freethreaded/freethreaded.wxs
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
+ <Product Id="*" Language="!(loc.LCID)" Name="!(loc.Title)" Version="$(var.Version)" Manufacturer="!(loc.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
+ <Package InstallerVersion="500" Compressed="yes" InstallScope="perUser" />
+ <MediaTemplate EmbedCab="yes" CompressionLevel="high" />
+
+ <PropertyRef Id="UpgradeTable" />
+ <PropertyRef Id="REGISTRYKEY" />
+
+ <Feature Id="DefaultFeature" AllowAdvertise="no" Title="!(loc.Title)" Description="!(loc.Description)">
+ <ComponentGroupRef Id="freethreaded_reg" Primary="yes" />
+ <ComponentGroupRef Id="freethreaded_exe" />
+ <ComponentGroupRef Id="freethreaded_lib_files" />
+ <ComponentGroupRef Id="freethreaded_lib_extensions" />
+ <ComponentRef Id="OptionalFeature" />
+ </Feature>
+ </Product>
+</Wix>
diff --git a/Tools/msi/freethreaded/freethreaded_d.wixproj b/Tools/msi/freethreaded/freethreaded_d.wixproj
new file mode 100644
index 0000000..e1563d4
--- /dev/null
+++ b/Tools/msi/freethreaded/freethreaded_d.wixproj
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <ProjectGuid>{D3677DCF-098A-4398-9FA5-8E74AC37E0DF}</ProjectGuid>
+ <SchemaVersion>2.0</SchemaVersion>
+ <OutputName>freethreaded_d</OutputName>
+ <OutputType>Package</OutputType>
+ </PropertyGroup>
+ <Import Project="..\msi.props" />
+ <ItemGroup>
+ <Compile Include="freethreaded_d.wxs" />
+ <Compile Include="freethreaded_files.wxs" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="*.wxl" />
+ <WxlTemplate Include="*.wxl_template" />
+ </ItemGroup>
+
+ <Import Project="..\msi.targets" />
+</Project> \ No newline at end of file
diff --git a/Tools/msi/freethreaded/freethreaded_d.wxs b/Tools/msi/freethreaded/freethreaded_d.wxs
new file mode 100644
index 0000000..cddf22a
--- /dev/null
+++ b/Tools/msi/freethreaded/freethreaded_d.wxs
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
+ <Product Id="*" Language="!(loc.LCID)" Name="!(loc.Title_d)" Version="$(var.Version)" Manufacturer="!(loc.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
+ <Package InstallerVersion="500" Compressed="yes" InstallScope="perUser" />
+ <MediaTemplate EmbedCab="yes" CompressionLevel="high" />
+
+ <PropertyRef Id="UpgradeTable" />
+
+ <Feature Id="DebugBinaries" AllowAdvertise="no" Title="!(loc.Title_d)" Description="!(loc.Description_d)">
+ <ComponentGroupRef Id="freethreaded_dll_d" />
+ <ComponentGroupRef Id="freethreaded_exe_d" />
+ <ComponentGroupRef Id="freethreaded_lib_extensions_d" />
+ <ComponentRef Id="OptionalFeature" />
+ </Feature>
+ </Product>
+</Wix>
diff --git a/Tools/msi/freethreaded/freethreaded_en-US.wxl_template b/Tools/msi/freethreaded/freethreaded_en-US.wxl_template
new file mode 100644
index 0000000..b9747eb
--- /dev/null
+++ b/Tools/msi/freethreaded/freethreaded_en-US.wxl_template
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<WixLocalization Culture="en-us" xmlns="http://schemas.microsoft.com/wix/2006/localization">
+ <String Id="Descriptor">Freethreaded Interpreter</String>
+ <String Id="ShortDescriptor">freethreaded</String>
+ <String Id="ShortcutName">Python {{ShortVersion}} ({{Bitness}}, freethreaded)</String>
+ <String Id="ShortcutDescription">Launches the !(loc.ProductName) freethreaded interpreter.</String>
+ <String Id="SupportUrl">https://www.python.org/</String>
+</WixLocalization>
diff --git a/Tools/msi/freethreaded/freethreaded_files.wxs b/Tools/msi/freethreaded/freethreaded_files.wxs
new file mode 100644
index 0000000..adaf63c
--- /dev/null
+++ b/Tools/msi/freethreaded/freethreaded_files.wxs
@@ -0,0 +1,175 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
+ <Fragment>
+ <Property Id="FREETHREADED_REGISTRYKEY" Value="Software\Python\PythonCore\$(var.ShortVersion)t$(var.PyArchExt)$(var.PyTestExt)" />
+
+ <ComponentGroup Id="freethreaded_reg">
+ <Component Id="PythonRegistration" Directory="InstallDirectory" Guid="$(var.PythonRegComponentGuid)">
+ <RegistryKey Root="HKMU" Key="[FREETHREADED_REGISTRYKEY]">
+ <RegistryValue Name="DisplayName" Type="string" Value="!(loc.ShortcutName)" KeyPath="yes" />
+ <RegistryValue Name="SupportUrl" Type="string" Value="!(loc.SupportUrl)" KeyPath="no" />
+ <RegistryValue Name="Version" Type="string" Value="$(var.LongVersion)" KeyPath="no" />
+ <RegistryValue Name="SysVersion" Type="string" Value="$(var.ShortVersion)" KeyPath="no" />
+ <RegistryValue Name="SysArchitecture" Type="string" Value="$(var.PlatformArchitecture)" KeyPath="no" />
+ </RegistryKey>
+ </Component>
+ </ComponentGroup>
+ </Fragment>
+ <Fragment>
+ <DirectoryRef Id="Lib">
+ <Directory Id="Lib_venv__freethreaded" Name="venv">
+ <Directory Id="Lib_venv_scripts__freethreaded" Name="scripts">
+ <Directory Id="Lib_venv_scripts_nt__freethreaded" Name="nt" />
+ </Directory>
+ </Directory>
+ </DirectoryRef>
+ </Fragment>
+ <Fragment>
+ <PropertyRef Id="FREETHREADED_REGISTRYKEY" />
+
+ <ComponentGroup Id="freethreaded_exe">
+ <Component Id="freethreaded_python.exe" Directory="InstallDirectory" Guid="$(var.FreethreadedPythonExeComponentGuid)">
+ <File Name="python$(var.ShortVersion)t.exe" KeyPath="yes" />
+
+ <RegistryKey Root="HKMU" Key="[FREETHREADED_REGISTRYKEY]">
+ <RegistryValue Key="InstallPath" Type="string" Value="[InstallDirectory]" KeyPath="no" />
+ <RegistryValue Key="InstallPath" Name="ExecutablePath" Type="string" Value="[#python$(var.ShortVersion)t.exe]" KeyPath="no" />
+ </RegistryKey>
+ </Component>
+ <Component Id="freethreaded_pythonw.exe" Directory="InstallDirectory" Guid="$(var.FreethreadedPythonwExeComponentGuid)">
+ <File Name="pythonw$(var.ShortVersion)t.exe" KeyPath="yes" />
+ <RegistryKey Root="HKMU" Key="[FREETHREADED_REGISTRYKEY]">
+ <RegistryValue Key="InstallPath" Name="WindowedExecutablePath" Type="string" Value="[#pythonw$(var.ShortVersion)t.exe]" KeyPath="no" />
+ </RegistryKey>
+ </Component>
+ <Component Id="freethreaded_python_stable.dll" Directory="InstallDirectory" Guid="*">
+ <File Id="freethreaded_python_stable.dll" Name="python$(var.MajorVersionNumber)t.dll" KeyPath="yes" />
+ </Component>
+ <Component Id="freethreaded_python.dll" Directory="InstallDirectory" Guid="*">
+ <File Id="freethreaded_python.dll" Name="python$(var.MajorVersionNumber)$(var.MinorVersionNumber)t.dll" KeyPath="yes" />
+ </Component>
+ </ComponentGroup>
+ </Fragment>
+ <Fragment>
+ <ComponentGroup Id="freethreaded_symbols">
+ <Component Id="freethreaded_python_dll.pdb" Directory="InstallDirectory" Guid="*">
+ <File Name="python$(var.MajorVersionNumber)$(var.MinorVersionNumber)t.pdb" KeyPath="yes" />
+ </Component>
+ <Component Id="freethreaded_python.pdb" Directory="InstallDirectory" Guid="*">
+ <File Name="python$(var.ShortVersion)t.pdb" />
+ </Component>
+ <Component Id="freethreaded_pythonw.pdb" Directory="InstallDirectory" Guid="*">
+ <File Name="pythonw$(var.ShortVersion)t.pdb" />
+ </Component>
+ </ComponentGroup>
+ </Fragment>
+ <Fragment>
+ <ComponentGroup Id="freethreaded_dll_d">
+ <Component Id="freethreaded_python_stable_d.dll" Directory="InstallDirectory" Guid="*">
+ <File Id="freethreaded_python_stable_d.dll" Name="python$(var.MajorVersionNumber)t_d.dll" KeyPath="yes" />
+ </Component>
+ <Component Id="freethreaded_python_d.dll" Directory="InstallDirectory" Guid="*">
+ <File Id="freethreaded_python_d.dll" Name="python$(var.MajorVersionNumber)$(var.MinorVersionNumber)_d.dll" KeyPath="yes" />
+ <File Id="freethreaded_python_d.pdb" Name="python$(var.MajorVersionNumber)$(var.MinorVersionNumber)_d.pdb" KeyPath="no" />
+ </Component>
+ </ComponentGroup>
+ </Fragment>
+ <Fragment>
+ <ComponentGroup Id="freethreaded_exe_d">
+ <Component Id="freethreaded_python_d.exe" Directory="InstallDirectory" Guid="*">
+ <File Name="python$(var.ShortVersion)t_d.exe" />
+ </Component>
+ <Component Id="freethreaded_python_d.pdb" Directory="InstallDirectory" Guid="*">
+ <File Name="python$(var.ShortVersion)t_d.pdb" />
+ </Component>
+ <Component Id="freethreaded_pythonw_d.exe" Directory="InstallDirectory" Guid="*">
+ <File Name="pythonw$(var.ShortVersion)t_d.exe" />
+ </Component>
+ <Component Id="freethreaded_pythonw_d.pdb" Directory="InstallDirectory" Guid="*">
+ <File Name="pythonw$(var.ShortVersion)t_d.pdb" />
+ </Component>
+ </ComponentGroup>
+ </Fragment>
+
+ <?define exts=pyexpat;select;unicodedata;winsound;_bz2;_elementtree;_socket;_ssl;_ctypes;_hashlib;_multiprocessing;_lzma;_decimal;_overlapped;_sqlite3;_asyncio;_queue;_uuid;_wmi;_zoneinfo;_testcapi;_ctypes_test;_testbuffer;_testimportmultiple;_testmultiphase;_testsinglephase;_testconsole;_testinternalcapi;_testclinic;_testclinic_limited ?>
+ <Fragment>
+ <DirectoryRef Id="Lib_venv_scripts_nt__freethreaded" />
+
+ <ComponentGroup Id="freethreaded_lib_extensions">
+ <?foreach ext in $(var.exts)?>
+
+ <Component Id="freethreaded_$(var.ext).pyd" Directory="DLLs" Guid="*">
+ <File Name="$(var.ext)$(var.FreethreadedPydTag).pyd" KeyPath="yes" />
+ </Component>
+
+ <?endforeach ?>
+
+ <Component Id="venvlaunchert.exe" Directory="Lib_venv_scripts_nt__freethreaded" Guid="*">
+ <File Name="venvlaunchert.exe" KeyPath="yes" />
+ </Component>
+ <Component Id="venvwlaunchert.exe" Directory="Lib_venv_scripts_nt__freethreaded" Guid="*">
+ <File Name="venvwlaunchert.exe" KeyPath="yes" />
+ </Component>
+ </ComponentGroup>
+ </Fragment>
+
+ <Fragment>
+ <DirectoryRef Id="Lib_venv_scripts_nt__freethreaded" />
+
+ <ComponentGroup Id="freethreaded_lib_extensions_symbols">
+ <?foreach ext in $(var.exts)?>
+
+ <Component Id="freethreaded_$(var.ext).pdb" Directory="DLLs" Guid="*">
+ <File Name="$(var.ext)$(var.FreethreadedPydTag).pdb" />
+ </Component>
+
+ <?endforeach ?>
+
+ <Component Id="venvlaunchert.pdb" Directory="Lib_venv_scripts_nt__freethreaded" Guid="*">
+ <File Name="venvlaunchert.pdb" KeyPath="yes" />
+ </Component>
+ <Component Id="venvwlaunchert.pdb" Directory="Lib_venv_scripts_nt__freethreaded" Guid="*">
+ <File Name="venvwlaunchert.pdb" KeyPath="yes" />
+ </Component>
+ </ComponentGroup>
+ </Fragment>
+
+ <Fragment>
+ <ComponentGroup Id="freethreaded_lib_extensions_d">
+ <?foreach ext in $(var.exts)?>
+
+ <Component Id="freethreaded_$(var.ext)_d.pyd" Directory="DLLs" Guid="*">
+ <File Name="$(var.ext)_d$(var.FreethreadedPydTag).pyd" />
+ </Component>
+ <Component Id="freethreaded_$(var.ext)_d.pdb" Directory="DLLs" Guid="*">
+ <File Name="$(var.ext)_d$(var.FreethreadedPydTag).pdb" />
+ </Component>
+
+ <?endforeach ?>
+
+ <Component Id="venvlauncher_d.exe" Directory="Lib_venv_scripts_nt__freethreaded" Guid="*">
+ <File Name="python_d.exe" Source="venvlauncher_d.exe" KeyPath="yes" />
+ </Component>
+ <Component Id="venvwlauncher_d.exe" Directory="Lib_venv_scripts_nt__freethreaded" Guid="*">
+ <File Name="pythonw_d.exe" Source="venvwlauncher_d.exe" KeyPath="yes" />
+ </Component>
+ <Component Id="venvlaunchert_d.pdb" Directory="Lib_venv_scripts_nt__freethreaded" Guid="*">
+ <File Name="venvlaunchert_d.pdb" KeyPath="yes" />
+ </Component>
+ <Component Id="venvwlaunchert_d.pdb" Directory="Lib_venv_scripts_nt__freethreaded" Guid="*">
+ <File Name="venvwlaunchert_d.pdb" KeyPath="yes" />
+ </Component>
+ </ComponentGroup>
+ </Fragment>
+ <Fragment>
+ <PropertyRef Id="FREETHREADED_REGISTRYKEY" />
+
+ <ComponentGroup Id="freethreaded_lib_files">
+ <Component Id="PythonPathRegistry" Directory="Lib" Guid="*">
+ <RegistryKey Root="HKMU" Key="[FREETHREADED_REGISTRYKEY]">
+ <RegistryValue Key="PythonPath" Type="string" Value="[Lib];[DLLs]" />
+ </RegistryKey>
+ </Component>
+ </ComponentGroup>
+ </Fragment>
+</Wix>
diff --git a/Tools/msi/freethreaded/freethreaded_pdb.wixproj b/Tools/msi/freethreaded/freethreaded_pdb.wixproj
new file mode 100644
index 0000000..789a4f5
--- /dev/null
+++ b/Tools/msi/freethreaded/freethreaded_pdb.wixproj
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <ProjectGuid>{E98E7539-64E7-4DCE-AACD-01E3ADE40EFD}</ProjectGuid>
+ <SchemaVersion>2.0</SchemaVersion>
+ <OutputName>freethreaded_pdb</OutputName>
+ <OutputType>Package</OutputType>
+ </PropertyGroup>
+ <Import Project="..\msi.props" />
+ <ItemGroup>
+ <Compile Include="freethreaded_pdb.wxs" />
+ <Compile Include="freethreaded_files.wxs" />
+ </ItemGroup>
+ <ItemGroup>
+ <EmbeddedResource Include="*.wxl" />
+ <WxlTemplate Include="*.wxl_template" />
+ </ItemGroup>
+
+ <Import Project="..\msi.targets" />
+</Project> \ No newline at end of file
diff --git a/Tools/msi/freethreaded/freethreaded_pdb.wxs b/Tools/msi/freethreaded/freethreaded_pdb.wxs
new file mode 100644
index 0000000..302ac41
--- /dev/null
+++ b/Tools/msi/freethreaded/freethreaded_pdb.wxs
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
+ <Product Id="*" Language="!(loc.LCID)" Name="!(loc.TitlePdb)" Version="$(var.Version)" Manufacturer="!(loc.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
+ <Package InstallerVersion="500" Compressed="yes" InstallScope="perUser" />
+ <MediaTemplate EmbedCab="yes" CompressionLevel="high" />
+
+ <PropertyRef Id="UpgradeTable" />
+
+ <Feature Id="Symbols" AllowAdvertise="no" Title="!(loc.TitlePdb)" Description="!(loc.DescriptionPdb)">
+ <ComponentGroupRef Id="freethreaded_symbols" />
+ <ComponentGroupRef Id="freethreaded_lib_extensions_symbols" />
+ <ComponentRef Id="OptionalFeature" />
+ </Feature>
+ </Product>
+</Wix>
diff --git a/Tools/msi/lib/lib_files.wxs b/Tools/msi/lib/lib_files.wxs
index a82cad5..b8e16b5 100644
--- a/Tools/msi/lib/lib_files.wxs
+++ b/Tools/msi/lib/lib_files.wxs
@@ -26,10 +26,10 @@
<File Name="libffi-8.dll" KeyPath="yes" />
</Component>
<Component Id="venvlauncher.exe" Directory="Lib_venv_scripts_nt" Guid="*">
- <File Name="python.exe" Source="venvlauncher.exe" KeyPath="yes" />
+ <File Name="venvlauncher.exe" KeyPath="yes" />
</Component>
<Component Id="venvwlauncher.exe" Directory="Lib_venv_scripts_nt" Guid="*">
- <File Name="pythonw.exe" Source="venvwlauncher.exe" KeyPath="yes" />
+ <File Name="venvwlauncher.exe" KeyPath="yes" />
</Component>
</ComponentGroup>
</Fragment>
@@ -63,10 +63,10 @@
<File Name="libssl$(var.ssltag).pdb" KeyPath="yes" />
</Component>
<Component Id="venvlauncher.pdb" Directory="Lib_venv_scripts_nt__pdbs" Guid="*">
- <File Name="python.pdb" Source="venvlauncher.pdb" KeyPath="yes" />
+ <File Name="venvlauncher.pdb" KeyPath="yes" />
</Component>
<Component Id="venvwlauncher.pdb" Directory="Lib_venv_scripts_nt__pdbs" Guid="*">
- <File Name="pythonw.pdb" Source="venvwlauncher.pdb" KeyPath="yes" />
+ <File Name="venvwlauncher.pdb" KeyPath="yes" />
</Component>
</ComponentGroup>
</Fragment>
@@ -100,10 +100,10 @@
<File Name="sqlite3_d.pdb" KeyPath="yes" />
</Component>
<Component Id="venvlauncher_d.exe" Directory="Lib_venv_scripts_nt__d" Guid="*">
- <File Name="python_d.exe" Source="venvlauncher_d.exe" KeyPath="yes" />
+ <File Name="venvlauncher_d.exe" KeyPath="yes" />
</Component>
<Component Id="venvwlauncher_d.exe" Directory="Lib_venv_scripts_nt__d" Guid="*">
- <File Name="pythonw_d.exe" Source="venvwlauncher_d.exe" KeyPath="yes" />
+ <File Name="venvwlauncher_d.exe" KeyPath="yes" />
</Component>
</ComponentGroup>
</Fragment>
diff --git a/Tools/msi/msi.props b/Tools/msi/msi.props
index cfb3ca9..372c482 100644
--- a/Tools/msi/msi.props
+++ b/Tools/msi/msi.props
@@ -24,14 +24,14 @@
This URI is used to generate the various GUIDs used by the installer.
Installers built with the same URI will upgrade each other or block
when attempting to downgrade.
-
+
By default, this is the local computer name, which will produce
installers that do not interfere with other installers. Products
that intend to bundle Python should rebuild these modules with their
own URI to avoid conflicting with the official releases.
-
+
The official releases use "https://www.python.org/$(ArchName)"
-
+
This is not the same as the DownloadUrl property used in the bundle
projects.
-->
@@ -39,7 +39,7 @@
<ReleaseUri Condition="!$(ReleaseUri.EndsWith(`/`))">$(ReleaseUri)/</ReleaseUri>
</PropertyGroup>
-
+
<ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)common.wxs" />
<WxlTemplate Include="$(MSBuildThisFileDirectory)\*.wxl_template" Condition="$(IgnoreCommonWxlTemplates) != 'true'" />
@@ -63,13 +63,17 @@
<InstallerVersion>$(MajorVersionNumber).$(MinorVersionNumber).$(Field3Value).0</InstallerVersion>
</PropertyGroup>
-
+
+ <PropertyGroup>
+ <IncludeFreethreaded Condition="$(IncludeFreethreaded) != 'true'">false</IncludeFreethreaded>
+ </PropertyGroup>
+
<PropertyGroup Condition="!$(BuildForRelease)">
<RevisionNumber Condition="'$(RevisionNumber)' == ''">$([System.Math]::Floor($([System.DateTime]::Now.Subtract($([System.DateTime]::new(2001, 1, 1))).TotalDays)))</RevisionNumber>
<PythonVersion>$(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber)dev$(RevisionNumber)</PythonVersion>
<InstallerVersion>$(MajorVersionNumber).$(MinorVersionNumber).$(RevisionNumber).0</InstallerVersion>
</PropertyGroup>
-
+
<PropertyGroup>
<Bitness>32-bit</Bitness>
<Bitness Condition="$(Platform) == 'x64'">64-bit</Bitness>
@@ -91,9 +95,12 @@
PyDebugExt=$(PyDebugExt);
PyArchExt=$(PyArchExt);
PyTestExt=$(PyTestExt);
+ PydTag=$(PydTag);
+ FreethreadedPydTag=$(FreethreadedPydTag);
OptionalFeatureName=$(OutputName);
ssltag=$(OpenSSLDLLSuffix);
Suffix32=$(PyArchExt);
+ IncludeFreethreaded=$(IncludeFreethreaded);
</DefineConstants>
<DefineConstants Condition="'$(CRTRedist)' != ''">
$(DefineConstants);CRTRedist=$(CRTRedist);
@@ -139,7 +146,7 @@
<Error Text="Platform '$(Platform)' is not supported. Use 'x86', 'x64' or 'ARM64'."
Condition="$(Platform) != 'x86' and $(Platform) != 'x64' and $(Platform) != 'ARM64'" />
</Target>
-
+
<ItemGroup>
<_Uuid Include="CoreUpgradeCode">
<Uri>upgradecode</Uri>
@@ -162,6 +169,12 @@
<_Uuid Include="PythonRegComponentGuid">
<Uri>registry/$(OutputName)</Uri>
</_Uuid>
+ <_Uuid Include="FreethreadedPythonExeComponentGuid" Condition="$(IncludeFreethreaded)">
+ <Uri>freethreaded/python.exe</Uri>
+ </_Uuid>
+ <_Uuid Include="FreethreadedPythonwExeComponentGuid" Condition="$(IncludeFreethreaded)">
+ <Uri>freethreaded/pythonw.exe</Uri>
+ </_Uuid>
</ItemGroup>
<Target Name="_GenerateGuids"
AfterTargets="PrepareForBuild"
@@ -171,15 +184,15 @@
<_Uuids>@(_Uuid->'("%(Identity)", "$(MajorVersionNumber).$(MinorVersionNumber)/%(Uri)")',',')</_Uuids>
<_GenerateCommand>import uuid; print('\n'.join('{}={}'.format(i, uuid.uuid5(uuid.UUID('c8d9733e-a70c-43ff-ab0c-e26456f11083'), '$(ReleaseUri.Replace(`{arch}`, `$(ArchName)`))' + j)) for i,j in [$(_Uuids.Replace(`"`,`'`))]))</_GenerateCommand>
</PropertyGroup>
-
+
<Exec Command='$(PythonForBuild) -c "$(_GenerateCommand)" &gt; "$(IntermediateOutputPath)$(OutputName)guids.txt"'
WorkingDirectory="$(MSBuildThisFileDirectory)"
IgnoreExitCode="false" />
-
+
<ReadLinesFromFile File="$(IntermediateOutputPath)$(OutputName)guids.txt">
<Output TaskParameter="Lines" ItemName="_UuidValue" />
</ReadLinesFromFile>
-
+
<PropertyGroup>
<DefineConstants>$(DefineConstants);@(_UuidValue,';');</DefineConstants>
</PropertyGroup>