[Python-checkins] bpo-33125: Enables building traditional installer for Windows ARM64 (GH-30885)

zooba webhook-mailer at python.org
Fri Jan 28 11:48:17 EST 2022


https://github.com/python/cpython/commit/45faf151c693b6f13f78926761caea6df7242024
commit: 45faf151c693b6f13f78926761caea6df7242024
branch: main
author: Steve Dower <steve.dower at python.org>
committer: zooba <steve.dower at microsoft.com>
date: 2022-01-28T16:48:06Z
summary:

bpo-33125: Enables building traditional installer for Windows ARM64 (GH-30885)

Also makes a few general improvements to the build process and removes some dead code.

files:
A Misc/NEWS.d/next/Windows/2022-01-25-14-48-39.bpo-33125.5WyY_J.rst
A Tools/msi/bundle/Default.ARM64.xsl
M .azure-pipelines/windows-release.yml
M .azure-pipelines/windows-release/msi-steps.yml
M .azure-pipelines/windows-release/stage-publish-nugetorg.yml
M .azure-pipelines/windows-release/stage-publish-pythonorg.yml
M .azure-pipelines/windows-release/stage-test-msi.yml
M .github/workflows/build_msi.yml
M PCbuild/openssl.props
M PCbuild/tcltk.props
M Tools/msi/appendpath/appendpath.wxs
M Tools/msi/build.bat
M Tools/msi/buildrelease.bat
M Tools/msi/bundle/Default.thm
M Tools/msi/bundle/Default.wxl
M Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp
M Tools/msi/bundle/bootstrap/pythonba.vcxproj
M Tools/msi/bundle/bundle.targets
M Tools/msi/bundle/bundle.wxs
M Tools/msi/core/core.wxs
M Tools/msi/core/core_d.wxs
M Tools/msi/core/core_pdb.wxs
M Tools/msi/dev/dev.wxs
M Tools/msi/dev/dev_d.wxs
M Tools/msi/doc/doc.wxs
M Tools/msi/exe/exe.wxs
M Tools/msi/exe/exe_d.wxs
M Tools/msi/exe/exe_pdb.wxs
M Tools/msi/get_externals.bat
M Tools/msi/launcher/launcher.wxs
M Tools/msi/lib/lib.wxs
M Tools/msi/lib/lib_d.wxs
M Tools/msi/lib/lib_pdb.wxs
M Tools/msi/msi.props
M Tools/msi/msi.targets
M Tools/msi/path/path.wxs
M Tools/msi/pip/pip.wxs
M Tools/msi/purge.py
M Tools/msi/tcltk/tcltk.wxs
M Tools/msi/tcltk/tcltk_d.wxs
M Tools/msi/tcltk/tcltk_pdb.wxs
M Tools/msi/test/test.wxs
M Tools/msi/test/test_d.wxs
M Tools/msi/test/test_pdb.wxs
M Tools/msi/tools/tools.wxs
M Tools/msi/ucrt/ucrt.wxs
M Tools/msi/wix.props

diff --git a/.azure-pipelines/windows-release.yml b/.azure-pipelines/windows-release.yml
index 338c305ecdc0a..c038ccdb8675a 100644
--- a/.azure-pipelines/windows-release.yml
+++ b/.azure-pipelines/windows-release.yml
@@ -34,6 +34,10 @@ parameters:
   displayName: "Signature description"
   type: string
   default: 'Built: $(Build.BuildNumber)'
+- name: DoARM64
+  displayName: "Publish ARM64 build"
+  type: boolean
+  default: true
 - name: DoPGO
   displayName: "Run PGO"
   type: boolean
@@ -64,25 +68,26 @@ parameters:
   default: '0'
 
 variables:
-    __RealSigningCertificate: 'Python Software Foundation'
-    ${{ if ne(parameters.GitRemote, '(Other)') }}:
-      GitRemote: ${{ parameters.GitRemote }}
-    ${{ else }}:
-      GitRemote: ${{ parameters.GitRemote_Other }}
-    SourceTag: ${{ parameters.SourceTag }}
-    DoPGO: ${{ parameters.DoPGO }}
-    ${{ if ne(parameters.SigningCertificate, 'Unsigned') }}:
-      SigningCertificate: ${{ parameters.SigningCertificate }}
-    SigningDescription: ${{ parameters.SigningDescription }}
-    DoLayout: ${{ parameters.DoLayout }}
-    DoMSIX: ${{ parameters.DoMSIX }}
-    DoNuget: ${{ parameters.DoNuget }}
-    DoEmbed: ${{ parameters.DoEmbed }}
-    DoMSI: ${{ parameters.DoMSI }}
-    DoPublish: ${{ parameters.DoPublish }}
+  __RealSigningCertificate: 'Python Software Foundation'
+  ${{ if ne(parameters.GitRemote, '(Other)') }}:
+    GitRemote: ${{ parameters.GitRemote }}
+  ${{ else }}:
+    GitRemote: ${{ parameters.GitRemote_Other }}
+  SourceTag: ${{ parameters.SourceTag }}
+  DoPGO: ${{ parameters.DoPGO }}
+  ${{ if ne(parameters.SigningCertificate, 'Unsigned') }}:
+    SigningCertificate: ${{ parameters.SigningCertificate }}
+  SigningDescription: ${{ parameters.SigningDescription }}
+  DoLayout: ${{ parameters.DoLayout }}
+  DoMSIX: ${{ parameters.DoMSIX }}
+  DoNuget: ${{ parameters.DoNuget }}
+  DoEmbed: ${{ parameters.DoEmbed }}
+  DoMSI: ${{ parameters.DoMSI }}
+  DoPublish: ${{ parameters.DoPublish }}
+  PublishARM64: ${{ parameters.DoARM64 }}
 # QUEUE TIME VARIABLES
-#    PyDotOrgUsername: ''
-#    PyDotOrgServer: ''
+#  PyDotOrgUsername: ''
+#  PyDotOrgServer: ''
 
 trigger: none
 pr: none
diff --git a/.azure-pipelines/windows-release/msi-steps.yml b/.azure-pipelines/windows-release/msi-steps.yml
index 307510a40dd4e..ef98d56c78363 100644
--- a/.azure-pipelines/windows-release/msi-steps.yml
+++ b/.azure-pipelines/windows-release/msi-steps.yml
@@ -45,6 +45,20 @@ steps:
       artifactName: bin_amd64_d
       targetPath: $(Build.BinariesDirectory)\amd64
 
+  - task: DownloadPipelineArtifact at 1
+    displayName: 'Download artifact: bin_arm64'
+    condition: and(succeeded(), eq(variables['PublishARM64'], 'true'))
+    inputs:
+      artifactName: bin_arm64
+      targetPath: $(Build.BinariesDirectory)\arm64
+
+  - task: DownloadPipelineArtifact at 1
+    displayName: 'Download artifact: bin_arm64_d'
+    condition: and(succeeded(), eq(variables['PublishARM64'], 'true'))
+    inputs:
+      artifactName: bin_arm64_d
+      targetPath: $(Build.BinariesDirectory)\arm64
+
   - task: DownloadPipelineArtifact at 1
     displayName: 'Download artifact: tcltk_lib_win32'
     inputs:
@@ -84,12 +98,12 @@ steps:
 
   - script: |
       %MSBUILD% Tools\msi\bundle\releaselocal.wixproj /t:Rebuild /p:RebuildAll=true
-      %MSBUILD% Tools\msi\bundle\releaseweb.wixproj /t:Rebuild /p:RebuildAll=false
     displayName: 'Build win32 installer'
     env:
       Platform: x86
       Py_OutDir: $(Build.BinariesDirectory)
       PYTHON: $(Build.BinariesDirectory)\win32\python.exe
+      PythonForBuild: $(Build.BinariesDirectory)\win32\python.exe
       PYTHONHOME: $(Build.SourcesDirectory)
       TclTkLibraryDir: $(Build.BinariesDirectory)\tcltk_lib_win32
       BuildForRelease: true
@@ -97,19 +111,32 @@ steps:
 
   - script: |
       %MSBUILD% Tools\msi\bundle\releaselocal.wixproj /t:Rebuild /p:RebuildAll=true
-      %MSBUILD% Tools\msi\bundle\releaseweb.wixproj /t:Rebuild /p:RebuildAll=false
     displayName: 'Build amd64 installer'
     env:
       Platform: x64
       Py_OutDir: $(Build.BinariesDirectory)
       PYTHON: $(Build.BinariesDirectory)\amd64\python.exe
+      PythonForBuild: $(Build.BinariesDirectory)\amd64\python.exe
       PYTHONHOME: $(Build.SourcesDirectory)
       TclTkLibraryDir: $(Build.BinariesDirectory)\tcltk_lib_amd64
       BuildForRelease: true
       SuppressMinGWLib: true
 
+  - script: |
+      %MSBUILD% Tools\msi\bundle\releaselocal.wixproj /t:Rebuild /p:RebuildAll=true
+    displayName: 'Build arm64 installer'
+    condition: and(succeeded(), eq(variables['PublishARM64'], 'true'))
+    env:
+      Platform: ARM64
+      Py_OutDir: $(Build.BinariesDirectory)
+      PYTHON: $(Build.BinariesDirectory)\win32\python.exe
+      PythonForBuild: $(Build.BinariesDirectory)\win32\python.exe
+      PYTHONHOME: $(Build.SourcesDirectory)
+      BuildForRelease: true
+      SuppressMinGWLib: true
+
   - task: CopyFiles at 2
-    displayName: 'Assemble artifact: msi (1/2)'
+    displayName: 'Assemble artifact: msi (win32)'
     inputs:
       sourceFolder: $(Build.BinariesDirectory)\win32\en-us
       targetFolder: $(Build.ArtifactStagingDirectory)\msi\win32
@@ -119,7 +146,7 @@ steps:
         *.exe
 
   - task: CopyFiles at 2
-    displayName: 'Assemble artifact: msi (2/2)'
+    displayName: 'Assemble artifact: msi (amd64)'
     inputs:
       sourceFolder: $(Build.BinariesDirectory)\amd64\en-us
       targetFolder: $(Build.ArtifactStagingDirectory)\msi\amd64
@@ -128,6 +155,17 @@ steps:
         *.cab
         *.exe
 
+  - task: CopyFiles at 2
+    displayName: 'Assemble artifact: msi (arm64)'
+    condition: and(succeeded(), eq(variables['PublishARM64'], 'true'))
+    inputs:
+      sourceFolder: $(Build.BinariesDirectory)\arm64\en-us
+      targetFolder: $(Build.ArtifactStagingDirectory)\msi\arm64
+      contents: |
+        *.msi
+        *.cab
+        *.exe
+
   - task: PublishPipelineArtifact at 0
     displayName: 'Publish MSI'
     inputs:
diff --git a/.azure-pipelines/windows-release/stage-publish-nugetorg.yml b/.azure-pipelines/windows-release/stage-publish-nugetorg.yml
index 38f6772afcde3..a8855f0ace8f5 100644
--- a/.azure-pipelines/windows-release/stage-publish-nugetorg.yml
+++ b/.azure-pipelines/windows-release/stage-publish-nugetorg.yml
@@ -36,9 +36,9 @@ jobs:
 
 
   - powershell: 'gci pythonarm*.nupkg | %{ Write-Host "Not publishing: $($_.Name)"; gi $_ } | del'
-    displayName: 'Prevent publishing ARM/ARM64 packages'
+    displayName: 'Prevent publishing ARM64 packages'
     workingDirectory: '$(Build.BinariesDirectory)\nuget'
-    condition: and(succeeded(), not(variables['PublishArmPackages']))
+    condition: and(succeeded(), eq(variables['PublishARM64'], 'true'))
 
   - task: NuGetCommand at 2
     displayName: Push packages
diff --git a/.azure-pipelines/windows-release/stage-publish-pythonorg.yml b/.azure-pipelines/windows-release/stage-publish-pythonorg.yml
index ef95572f7d165..be4ef9e0cca89 100644
--- a/.azure-pipelines/windows-release/stage-publish-pythonorg.yml
+++ b/.azure-pipelines/windows-release/stage-publish-pythonorg.yml
@@ -77,10 +77,11 @@ jobs:
         downloadPath: $(Build.BinariesDirectory)
 
 
+  # Note that ARM64 MSIs are skipped at build when this option is specified
   - powershell: 'gci *embed-arm*.zip | %{ Write-Host "Not publishing: $($_.Name)"; gi $_ } | del'
-    displayName: 'Prevent publishing ARM/ARM64 packages'
+    displayName: 'Prevent publishing ARM64 packages'
     workingDirectory: '$(Build.BinariesDirectory)\embed'
-    condition: and(succeeded(), not(variables['PublishArmPackages']))
+    condition: and(succeeded(), eq(variables['PublishARM64'], 'true'))
 
 
   - template: ./gpg-sign.yml
diff --git a/.azure-pipelines/windows-release/stage-test-msi.yml b/.azure-pipelines/windows-release/stage-test-msi.yml
index 4b02f478ce0a1..a471d05bc6a4a 100644
--- a/.azure-pipelines/windows-release/stage-test-msi.yml
+++ b/.azure-pipelines/windows-release/stage-test-msi.yml
@@ -11,19 +11,19 @@ jobs:
   strategy:
     matrix:
       win32_User:
-        ExeMatch: 'python-[\dabrc.]+-webinstall\.exe'
+        ExeMatch: 'python-[\dabrc.]+\.exe'
         Logs: $(Build.ArtifactStagingDirectory)\logs\win32_User
         InstallAllUsers: 0
       win32_Machine:
-        ExeMatch: 'python-[\dabrc.]+-webinstall\.exe'
+        ExeMatch: 'python-[\dabrc.]+\.exe'
         Logs: $(Build.ArtifactStagingDirectory)\logs\win32_Machine
         InstallAllUsers: 1
       amd64_User:
-        ExeMatch: 'python-[\dabrc.]+-amd64-webinstall\.exe'
+        ExeMatch: 'python-[\dabrc.]+-amd64\.exe'
         Logs: $(Build.ArtifactStagingDirectory)\logs\amd64_User
         InstallAllUsers: 0
       amd64_Machine:
-        ExeMatch: 'python-[\dabrc.]+-amd64-webinstall\.exe'
+        ExeMatch: 'python-[\dabrc.]+-amd64\.exe'
         Logs: $(Build.ArtifactStagingDirectory)\logs\amd64_Machine
         InstallAllUsers: 1
 
diff --git a/.github/workflows/build_msi.yml b/.github/workflows/build_msi.yml
index 476a0b1bc0738..6e989b2ab9886 100644
--- a/.github/workflows/build_msi.yml
+++ b/.github/workflows/build_msi.yml
@@ -37,3 +37,11 @@ jobs:
     - uses: actions/checkout at v2
     - name: Build CPython installer
       run: .\Tools\msi\build.bat -x64
+
+  build_win_arm64:
+    name: 'Windows (ARM64) Installer'
+    runs-on: windows-latest
+    steps:
+    - uses: actions/checkout at v2
+    - name: Build CPython installer
+      run: .\Tools\msi\build.bat -arm64
diff --git a/Misc/NEWS.d/next/Windows/2022-01-25-14-48-39.bpo-33125.5WyY_J.rst b/Misc/NEWS.d/next/Windows/2022-01-25-14-48-39.bpo-33125.5WyY_J.rst
new file mode 100644
index 0000000000000..54811db67add8
--- /dev/null
+++ b/Misc/NEWS.d/next/Windows/2022-01-25-14-48-39.bpo-33125.5WyY_J.rst
@@ -0,0 +1,2 @@
+The traditional EXE/MSI based installer for Windows is now available for
+ARM64
diff --git a/PCbuild/openssl.props b/PCbuild/openssl.props
index a7e16793c7f28..6081d3c8c6964 100644
--- a/PCbuild/openssl.props
+++ b/PCbuild/openssl.props
@@ -13,6 +13,7 @@
     <_DLLSuffix>-1_1</_DLLSuffix>
     <_DLLSuffix Condition="$(Platform) == 'ARM'">$(_DLLSuffix)-arm</_DLLSuffix>
     <_DLLSuffix Condition="$(Platform) == 'ARM64'">$(_DLLSuffix)-arm64</_DLLSuffix>
+    <OpenSSLDLLSuffix>$(_DLLSuffix)</OpenSSLDLLSuffix>
   </PropertyGroup>
   <ItemGroup>
     <_SSLDLL Include="$(opensslOutDir)\libcrypto$(_DLLSuffix).dll" />
@@ -20,10 +21,14 @@
     <_SSLDLL Include="$(opensslOutDir)\libssl$(_DLLSuffix).dll" />
     <_SSLDLL Include="$(opensslOutDir)\libssl$(_DLLSuffix).pdb" />
   </ItemGroup>
-  <Target Name="_CopySSLDLL" Inputs="@(_SSLDLL)" Outputs="@(_SSLDLL->'$(OutDir)%(Filename)%(Extension)')" AfterTargets="Build">
+  <Target Name="_CopySSLDLL"
+          Inputs="@(_SSLDLL)"
+          Outputs="@(_SSLDLL->'$(OutDir)%(Filename)%(Extension)')"
+          Condition="$(SkipCopySSLDLL) == ''"
+          AfterTargets="Build">
     <Copy SourceFiles="@(_SSLDLL)" DestinationFolder="$(OutDir)" />
   </Target>
-  <Target Name="_CleanSSLDLL" BeforeTargets="Clean">
+  <Target Name="_CleanSSLDLL" Condition="$(SkipCopySSLDLL) == ''" BeforeTargets="Clean">
     <Delete Files="@(_SSLDLL->'$(OutDir)%(Filename)%(Extension)')" TreatErrorsAsWarnings="true" />
   </Target>
 </Project>
\ No newline at end of file
diff --git a/PCbuild/tcltk.props b/PCbuild/tcltk.props
index 16dc35d45ebd5..72cffc3ea1da6 100644
--- a/PCbuild/tcltk.props
+++ b/PCbuild/tcltk.props
@@ -29,6 +29,7 @@
     <tcltkLib>$(tcltkDir)lib\tcl$(TclMajorVersion)$(TclMinorVersion)t$(TclDebugExt).lib;$(tcltkDir)lib\tk$(TkMajorVersion)$(TkMinorVersion)t$(TclDebugExt).lib</tcltkLib>
     <TclMachine>IX86</TclMachine>
     <TclMachine Condition="'$(Platform)' == 'x64'">AMD64</TclMachine>
+    <TclMachine Condition="'$(Platform)' == 'ARM64'">ARM64</TclMachine>
     <TclVersions>TCL_MAJOR_VERSION=$(TclMajorVersion) TCL_MINOR_VERSION=$(TclMinorVersion) TCL_PATCH_LEVEL=$(TclPatchLevel)</TclVersions>
     <TclShortVersions>TCL_MAJOR=$(TclMajorVersion) TCL_MINOR=$(TclMinorVersion) TCL_PATCH=$(TclPatchLevel)</TclShortVersions>
     <TkVersions>TK_MAJOR_VERSION=$(TkMajorVersion) TK_MINOR_VERSION=$(TkMinorVersion) TK_PATCH_LEVEL=$(TkPatchLevel)</TkVersions>
diff --git a/Tools/msi/appendpath/appendpath.wxs b/Tools/msi/appendpath/appendpath.wxs
index b972f612bf799..e8d7a9d0a31ae 100644
--- a/Tools/msi/appendpath/appendpath.wxs
+++ b/Tools/msi/appendpath/appendpath.wxs
@@ -1,7 +1,7 @@
 <?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="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
+        <Package InstallerVersion="500" Compressed="yes" InstallScope="perUser" />
         
         <PropertyRef Id="UpgradeTable" />
         <PropertyRef Id="REGISTRYKEY" />
diff --git a/Tools/msi/build.bat b/Tools/msi/build.bat
index 532cebc5b5118..755c8876cf99c 100644
--- a/Tools/msi/build.bat
+++ b/Tools/msi/build.bat
@@ -5,6 +5,7 @@ set PCBUILD=%D%..\..\PCbuild\
 
 set BUILDX86=
 set BUILDX64=
+set BUILDARM64=
 set BUILDDOC=
 set BUILDTEST=
 set BUILDPACK=
@@ -14,22 +15,23 @@ set REBUILD=
 if "%~1" EQU "-h" goto Help
 if "%~1" EQU "-x86" (set BUILDX86=1) && shift && goto CheckOpts
 if "%~1" EQU "-x64" (set BUILDX64=1) && shift && goto CheckOpts
+if "%~1" EQU "-arm64" (set BUILDARM64=1) && shift && goto CheckOpts
 if "%~1" EQU "--doc" (set BUILDDOC=1) && shift && goto CheckOpts
 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
 
-if not defined BUILDX86 if not defined BUILDX64 (set BUILDX86=1) && (set BUILDX64=1)
+if not defined BUILDX86 if not defined BUILDX64 if not defined BUILDARM64 (set BUILDX86=1) && (set BUILDX64=1)
 
 call "%D%get_externals.bat"
 call "%PCBUILD%find_msbuild.bat" %MSBUILD%
 if ERRORLEVEL 1 (echo Cannot locate MSBuild.exe on PATH or as MSBUILD variable & exit /b 2)
 
 if defined BUILDX86 (
-    call "%PCBUILD%build.bat" -d -e %REBUILD% %BUILDTEST%
+    call "%PCBUILD%build.bat" -p Win32 -d -e %REBUILD% %BUILDTEST%
     if errorlevel 1 goto :eof
-    call "%PCBUILD%build.bat" -e %REBUILD% %BUILDTEST%
+    call "%PCBUILD%build.bat" -p Win32 -e %REBUILD% %BUILDTEST%
     if errorlevel 1 goto :eof
 )
 if defined BUILDX64 (
@@ -38,6 +40,12 @@ if defined BUILDX64 (
     call "%PCBUILD%build.bat" -p x64 -e %REBUILD% %BUILDTEST%
     if errorlevel 1 goto :eof
 )
+if defined BUILDARM64 (
+    call "%PCBUILD%build.bat" -p ARM64 -d -e %REBUILD% %BUILDTEST%
+    if errorlevel 1 goto :eof
+    call "%PCBUILD%build.bat" -p ARM64 -e %REBUILD% %BUILDTEST%
+    if errorlevel 1 goto :eof
+)
 
 if defined BUILDDOC (
     call "%PCBUILD%..\Doc\make.bat" htmlhelp
@@ -59,21 +67,26 @@ if defined REBUILD (
 )
 
 if defined BUILDX86 (
-    %MSBUILD% %BUILD_CMD%
+    %MSBUILD% /p:Platform=x86 %BUILD_CMD%
     if errorlevel 1 goto :eof
 )
 if defined BUILDX64 (
     %MSBUILD% /p:Platform=x64 %BUILD_CMD%
     if errorlevel 1 goto :eof
 )
+if defined BUILDARM64 (
+    %MSBUILD% /p:Platform=ARM64 %BUILD_CMD%
+    if errorlevel 1 goto :eof
+)
 
 exit /B 0
 
 :Help
-echo build.bat [-x86] [-x64] [--doc] [-h] [--test-marker] [--pack] [-r]
+echo build.bat [-x86] [-x64] [-arm64] [--doc] [-h] [--test-marker] [--pack] [-r]
 echo.
 echo    -x86                Build x86 installers
 echo    -x64                Build x64 installers
+echo    -ARM64                Build ARM64 installers
 echo    --doc               Build CHM documentation
 echo    --test-marker       Build with test markers
 echo    --no-test-marker    Build without test markers (default)
diff --git a/Tools/msi/buildrelease.bat b/Tools/msi/buildrelease.bat
index 4fbaf2c99ba9b..722298ff6137a 100644
--- a/Tools/msi/buildrelease.bat
+++ b/Tools/msi/buildrelease.bat
@@ -34,6 +34,7 @@ set EXTERNALS=%D%..\..\externals\windows-installer\
 
 set BUILDX86=
 set BUILDX64=
+set BUILDARM64=
 set TARGET=Rebuild
 set TESTTARGETDIR=
 set PGO=-m test -q --pgo
@@ -58,6 +59,7 @@ if "%1" EQU "-b" (set TARGET=Build) && shift && goto CheckOpts
 if "%1" EQU "--build" (set TARGET=Build) && shift && goto CheckOpts
 if "%1" EQU "-x86" (set BUILDX86=1) && shift && goto CheckOpts
 if "%1" EQU "-x64" (set BUILDX64=1) && shift && goto CheckOpts
+if "%1" EQU "-arm64" (set BUILDARM64=1) && shift && goto CheckOpts
 if "%1" EQU "--pgo" (set PGO=%~2) && shift && shift && goto CheckOpts
 if "%1" EQU "--skip-pgo" (set PGO=) && shift && goto CheckOpts
 if "%1" EQU "--skip-nuget" (set BUILDNUGET=) && shift && goto CheckOpts
@@ -66,7 +68,7 @@ if "%1" EQU "--skip-msi" (set BUILDMSI=) && shift && goto CheckOpts
 
 if "%1" NEQ "" echo Invalid option: "%1" && exit /B 1
 
-if not defined BUILDX86 if not defined BUILDX64 (set BUILDX86=1) && (set BUILDX64=1)
+if not defined BUILDX86 if not defined BUILDX64 if not defined BUILDARM64 (set BUILDX86=1) && (set BUILDX64=1)
 
 if not exist "%GIT%" where git > "%TEMP%\git.loc" 2> nul && set /P GIT= < "%TEMP%\git.loc" & del "%TEMP%\git.loc"
 if not exist "%GIT%" echo Cannot find Git on PATH && exit /B 1
@@ -83,14 +85,6 @@ call "%D%..\..\doc\make.bat" htmlhelp
 if errorlevel 1 goto :eof
 :skipdoc
 
-where dlltool /q && goto skipdlltoolsearch
-set _DLLTOOL_PATH=
-where /R "%EXTERNALS%\" dlltool > "%TEMP%\dlltool.loc" 2> nul && set /P _DLLTOOL_PATH= < "%TEMP%\dlltool.loc" & del "%TEMP%\dlltool.loc"
-if not exist "%_DLLTOOL_PATH%" echo Cannot find binutils on PATH or in external && exit /B 1
-for %%f in (%_DLLTOOL_PATH%) do set PATH=%PATH%;%%~dpf
-set _DLLTOOL_PATH=
-:skipdlltoolsearch
-
 if defined BUILDX86 (
     call :build x86
     if errorlevel 1 exit /B
@@ -101,6 +95,11 @@ if defined BUILDX64 (
     if errorlevel 1 exit /B
 )
 
+if defined BUILDARM64 (
+    call :build ARM64
+    if errorlevel 1 exit /B
+)
+
 if defined TESTTARGETDIR (
     call "%D%testrelease.bat" -t "%TESTTARGETDIR%"
 )
@@ -117,12 +116,21 @@ if "%1" EQU "x86" (
     set BUILD_PLAT=Win32
     set OUTDIR_PLAT=win32
     set OBJDIR_PLAT=x86
-) else (
+) else if "%1" EQU "x64" (
     set BUILD=%Py_OutDir%amd64\
     set PGO=%~2
     set BUILD_PLAT=x64
     set OUTDIR_PLAT=amd64
     set OBJDIR_PLAT=x64
+) else if "%1" EQU "ARM64" (
+    set BUILD=%Py_OutDir%amd64\
+    set PGO=%~2
+    set BUILD_PLAT=ARM64
+    set OUTDIR_PLAT=arm64
+    set OBJDIR_PLAT=arm64
+) else (
+    echo Unknown platform %1
+    exit /B 1
 )
 
 if exist "%BUILD%en-us" (
@@ -179,18 +187,24 @@ set BUILDOPTS=/p:Platform=%1 /p:BuildForRelease=true /p:DownloadUrl=%DOWNLOAD_UR
 if defined BUILDMSI (
     %MSBUILD% "%D%bundle\releaselocal.wixproj" /t:Rebuild %BUILDOPTS% %CERTOPTS% /p:RebuildAll=true
     if errorlevel 1 exit /B
-    %MSBUILD% "%D%bundle\releaseweb.wixproj" /t:Rebuild %BUILDOPTS% %CERTOPTS% /p:RebuildAll=false
-    if errorlevel 1 exit /B
 )
 
 if defined BUILDZIP (
-    %MSBUILD% "%D%make_zip.proj" /t:Build %BUILDOPTS% %CERTOPTS% /p:OutputPath="%BUILD%en-us"
-    if errorlevel 1 exit /B
+    if "%BUILD_PLAT%" EQU "ARM64" (
+        echo Skipping embeddable ZIP generation for ARM64 platform
+    ) else (
+        %MSBUILD% "%D%make_zip.proj" /t:Build %BUILDOPTS% %CERTOPTS% /p:OutputPath="%BUILD%en-us"
+        if errorlevel 1 exit /B
+    )
 )
 
 if defined BUILDNUGET (
-    %MSBUILD% "%D%..\nuget\make_pkg.proj" /t:Build /p:Configuration=Release /p:Platform=%1 /p:OutputPath="%BUILD%en-us"
-    if errorlevel 1 exit /B
+    if "%BUILD_PLAT%" EQU "ARM64" (
+        echo Skipping Nuget package generation for ARM64 platform
+    ) else (
+        %MSBUILD% "%D%..\nuget\make_pkg.proj" /t:Build /p:Configuration=Release /p:Platform=%1 /p:OutputPath="%BUILD%en-us"
+        if errorlevel 1 exit /B
+    )
 )
 
 if not "%OUTDIR%" EQU "" (
@@ -205,7 +219,7 @@ if not "%OUTDIR%" EQU "" (
 exit /B 0
 
 :Help
-echo buildrelease.bat [--out DIR] [-x86] [-x64] [--certificate CERTNAME] [--build] [--pgo COMMAND]
+echo buildrelease.bat [--out DIR] [-x86] [-x64] [-arm64] [--certificate CERTNAME] [--build] [--pgo COMMAND]
 echo                  [--skip-build] [--skip-doc] [--skip-nuget] [--skip-zip] [--skip-pgo]
 echo                  [--download DOWNLOAD URL] [--test TARGETDIR]
 echo                  [-h]
@@ -213,6 +227,7 @@ echo.
 echo    --out (-o)          Specify an additional output directory for installers
 echo    -x86                Build x86 installers
 echo    -x64                Build x64 installers
+echo    -arm64              Build ARM64 installers
 echo    --build (-b)        Incrementally build Python rather than rebuilding
 echo    --skip-build (-B)   Do not build Python (just do the installers)
 echo    --skip-doc (-D)     Do not build documentation
@@ -231,6 +246,9 @@ echo.
 echo For the --pgo option, any Python command line can be used, or 'default' to
 echo use the default task (-m test --pgo).
 echo.
+echo x86 and ARM64 builds will never use PGO. ARM64 builds will never generate
+echo embeddable or Nuget packages.
+echo.
 echo The following substitutions will be applied to the download URL:
 echo     Variable        Description         Example
 echo     {version}       version number      3.5.0
diff --git a/Tools/msi/bundle/Default.ARM64.xsl b/Tools/msi/bundle/Default.ARM64.xsl
new file mode 100644
index 0000000000000..0dd1c9e6a3d52
--- /dev/null
+++ b/Tools/msi/bundle/Default.ARM64.xsl
@@ -0,0 +1,26 @@
+<xsl:stylesheet version="2.0"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns="http://schemas.microsoft.com/wix/2006/localization">
+    <xsl:output indent="yes"/>
+    <xsl:strip-space elements="*"/>
+
+    <xsl:template match="node()|@*">
+        <xsl:copy>
+            <xsl:apply-templates select="node()|@*"/>
+        </xsl:copy>
+    </xsl:template>
+
+    <xsl:template match="*[local-name()='String' and @Id='InstallButtonNote']">
+        <String Id="InstallButtonNote">[TargetDir]
+
+Includes pip and documentation
+Creates shortcuts but no file associations</String>
+    </xsl:template>
+
+    <xsl:template match="*[local-name()='String' and @Id='Include_launcherHelp']">
+        <String Id="Include_launcherHelp">(The 'py' launcher is currently unavailable on ARM64.)</String>
+    </xsl:template>
+    <xsl:template match="*[local-name()='String' and @Id='Include_tcltkHelpLabel']">
+        <String Id="Include_tcltkHelpLabel">(tcl/tk and IDLE are currently unavailable on ARM64.)</String>
+    </xsl:template>
+</xsl:stylesheet>
\ No newline at end of file
diff --git a/Tools/msi/bundle/Default.thm b/Tools/msi/bundle/Default.thm
index f5ba43d838fcf..d1b0f5bd9c1d4 100644
--- a/Tools/msi/bundle/Default.thm
+++ b/Tools/msi/bundle/Default.thm
@@ -52,16 +52,16 @@
         <Text X="185" Y="11" Width="-11" Height="36" FontId="1" DisablePrefix="yes">#(loc.Custom1Header)</Text>
         <Image X="0" Y="0" Width="178" Height="382" ImageFile="SideBar.png"/>
         
-        <Checkbox Name="Include_doc" X="185" Y="51" Width="-11" Height="24" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.Include_docLabel)</Checkbox>
+        <Checkbox Name="Include_doc" X="185" Y="51" Width="-11" Height="24" TabStop="yes" FontId="3" HideWhenDisabled="no">#(loc.Include_docLabel)</Checkbox>
         <Text X="205" Y="76" Width="-11" Height="24" TabStop="no" FontId="5">#(loc.Include_docHelpLabel)</Text>
         
-        <Checkbox Name="Include_pip" X="185" Y="101" Width="-11" Height="24" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.Include_pipLabel)</Checkbox>
+        <Checkbox Name="Include_pip" X="185" Y="101" Width="-11" Height="24" TabStop="yes" FontId="3" HideWhenDisabled="no">#(loc.Include_pipLabel)</Checkbox>
         <Text X="205" Y="126" Width="-11" Height="24" TabStop="no" FontId="5">#(loc.Include_pipHelpLabel)</Text>
         
-        <Checkbox Name="Include_tcltk" X="185" Y="151" Width="-11" Height="24" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.Include_tcltkLabel)</Checkbox>
-        <Text X="205" Y="176" Width="-11" Height="24" TabStop="no" FontId="5">#(loc.Include_tcltkHelpLabel)</Text>
+        <Checkbox Name="Include_tcltk" X="185" Y="151" Width="-11" Height="24" TabStop="yes" FontId="3" HideWhenDisabled="no">#(loc.Include_tcltkLabel)</Checkbox>
+        <Text Name="Include_tcltkLabel" X="205" Y="176" Width="-11" Height="24" TabStop="no" FontId="5">#(loc.Include_tcltkHelpLabel)</Text>
         
-        <Checkbox Name="Include_test" X="185" Y="201" Width="-11" Height="24" TabStop="yes" FontId="3" HideWhenDisabled="yes">#(loc.Include_testLabel)</Checkbox>
+        <Checkbox Name="Include_test" X="185" Y="201" Width="-11" Height="24" TabStop="yes" FontId="3" HideWhenDisabled="no">#(loc.Include_testLabel)</Checkbox>
         <Text X="205" Y="226" Width="-11" Height="24" TabStop="no" FontId="5">#(loc.Include_testHelpLabel)</Text>
 
         <Checkbox Name="Include_launcher" X="185" Y="251" Width="100" Height="24" TabStop="yes" FontId="3" HideWhenDisabled="no">#(loc.Include_launcherLabel)</Checkbox>
diff --git a/Tools/msi/bundle/Default.wxl b/Tools/msi/bundle/Default.wxl
index 053306b0d7dcf..70fb467ec8b19 100644
--- a/Tools/msi/bundle/Default.wxl
+++ b/Tools/msi/bundle/Default.wxl
@@ -1,7 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <WixLocalization Culture="en-us" Language="1033" xmlns="http://schemas.microsoft.com/wix/2006/localization">
   <String Id="Caption">[WixBundleName] Setup</String>
-  <String Id="Title">[WixBundleName]</String>
   <String Id="Installing">Installing</String>
   <String Id="Installation">Setup</String>
   <String Id="Modifying">Updating</String>
diff --git a/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp b/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp
index fdc2a21d83d5f..226416f354585 100644
--- a/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp
+++ b/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp
@@ -1501,6 +1501,9 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication {
         hr = UpdateUIStrings(_command.action);
         BalExitOnFailure(hr, "Failed to load UI strings.");
 
+        hr = FindProgramFilesArm();
+        BalExitOnFailure(hr, "Fatal error locating Program Files (Arm)");
+
         GetBundleFileVersion();
         // don't fail if we couldn't get the version info; best-effort only
     LExit:
@@ -2181,6 +2184,37 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication {
         return hr;
     }
 
+    HRESULT FindProgramFilesArm() {
+        wchar_t buffer[MAX_PATH + 1];
+        DWORD bufferLen = MAX_PATH;
+        LSTATUS res = RegGetValueW(
+            HKEY_LOCAL_MACHINE,
+            L"SOFTWARE\\Microsoft\\Windows\\CurrentVersion",
+            L"ProgramFilesDir (Arm)",
+            RRF_RT_REG_SZ | RRF_RT_REG_EXPAND_SZ | RRF_SUBKEY_WOW6464KEY,
+            NULL,
+            buffer,
+            &bufferLen
+        );
+        if (res != ERROR_SUCCESS) {
+            // ProgramFilesArmFolder will default to ProgramFilesFolder. We only report
+            // an error if the value existed, as it will simply just be absent on non-ARM
+            // devices.
+            if (res != ERROR_FILE_NOT_FOUND) {
+                BalLog(BOOTSTRAPPER_LOG_LEVEL_ERROR, "Failed to query 'ProgramFilesDir (Arm)': error code %d", res);
+            }
+            return S_OK;
+        }
+        if (buffer[0]) {
+            wchar_t *p = &buffer[bufferLen / sizeof(wchar_t) - 1];
+            while (*p == L'\\' || *p == L'\0') { p -= 1; }
+            *++p = L'\\';
+            *++p = L'\0';
+            _engine->SetVariableString(L"ProgramFilesArmFolder", buffer);
+        }
+        return S_OK;
+    }
+
     //
     // OnPlan - plan the detected changes.
     //
diff --git a/Tools/msi/bundle/bootstrap/pythonba.vcxproj b/Tools/msi/bundle/bootstrap/pythonba.vcxproj
index d90b5e3ff0009..bb383bfcaa240 100644
--- a/Tools/msi/bundle/bootstrap/pythonba.vcxproj
+++ b/Tools/msi/bundle/bootstrap/pythonba.vcxproj
@@ -21,11 +21,10 @@
   <PropertyGroup Label="Globals">
     <Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
     <Platform Condition="'$(Platform)' == ''">Win32</Platform>
-    <PlatformToolset Condition="'$(PlatformToolset)' == '' and ('$(MSBuildToolsVersion)' == '16.0' or '$(VisualStudioVersion)' == '16.0')">v142</PlatformToolset>
+    <PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(VisualStudioVersion)' == '17.0'">v143</PlatformToolset>
+    <PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(VisualStudioVersion)' == '16.0'">v142</PlatformToolset>
     <PlatformToolset Condition="'$(PlatformToolset)' == '' and ('$(MSBuildToolsVersion)' == '15.0' or '$(VisualStudioVersion)' == '15.0')">v141</PlatformToolset>
-    <PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(VCTargetsPath14)' != ''">v140</PlatformToolset>
-    <PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(VCTargetsPath14)' != ''">v140</PlatformToolset>
-    <PlatformToolset Condition="'$(PlatformToolset)' == '' and '$(VCTargetsPath12)' != ''">v120</PlatformToolset>
+    <PlatformToolset Condition="'$(PlatformToolset)' == ''">v140</PlatformToolset>
     <ProjectGuid>{7A09B132-B3EE-499B-A700-A4B2157FEA3D}</ProjectGuid>
     <TargetName>PythonBA</TargetName>
   </PropertyGroup>
@@ -42,6 +41,7 @@
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
   <ItemDefinitionGroup>
     <ClCompile>
+      <PreprocessorDefinitions Condition="$(BuildForPlatform) == 'ARM64'">ARM64=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <PreprocessorDefinitions>_CRT_STDIO_LEGACY_WIDE_SPECIFIERS=1;%(PreprocessorDefinitions)</PreprocessorDefinitions>
       <AdditionalIncludeDirectories>$(WixInstallPath)sdk\inc</AdditionalIncludeDirectories>
       <PrecompiledHeader>Use</PrecompiledHeader>
@@ -50,8 +50,7 @@
     </ClCompile>
     <Link>
       <AdditionalDependencies>comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;wininet.lib;dutil.lib;balutil.lib;version.lib;uxtheme.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalLibraryDirectories Condition="'$(PlatformToolset)' == 'v142'">$(WixInstallPath)sdk\vs2017\lib\x86</AdditionalLibraryDirectories>
-      <AdditionalLibraryDirectories Condition="'$(PlatformToolset)' == 'v141'">$(WixInstallPath)sdk\vs2017\lib\x86</AdditionalLibraryDirectories>
+      <AdditionalLibraryDirectories Condition="$(PlatformToolset.StartsWith(`v14`))">$(WixInstallPath)sdk\vs2017\lib\x86</AdditionalLibraryDirectories>
       <AdditionalLibraryDirectories Condition="'$(PlatformToolset)' == 'v140'">$(WixInstallPath)sdk\vs2015\lib\x86</AdditionalLibraryDirectories>
       <AdditionalLibraryDirectories Condition="'$(PlatformToolset)' == 'v120'">$(WixInstallPath)sdk\vs2013\lib\x86</AdditionalLibraryDirectories>
       <ModuleDefinitionFile>pythonba.def</ModuleDefinitionFile>
diff --git a/Tools/msi/bundle/bundle.targets b/Tools/msi/bundle/bundle.targets
index 5d8ae6c1d7cba..4f4306f7b61f0 100644
--- a/Tools/msi/bundle/bundle.targets
+++ b/Tools/msi/bundle/bundle.targets
@@ -3,25 +3,26 @@
     <PropertyGroup>
         <SchemaVersion>2.0</SchemaVersion>
         <OutputType>Bundle</OutputType>
-        
+
         <BootstrapConfiguration Condition="'$(BootstrapConfiguration)' == ''">Release</BootstrapConfiguration>
         <LinkerSuppressSpecificWarnings>1132;1135;1140</LinkerSuppressSpecificWarnings>
         <OutputName Condition="$(BuildForRelease)">$(OutputName)-$(PythonVersion)</OutputName>
         <OutputName Condition="!$(BuildForRelease)">$(OutputName)-$(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber).$(RevisionNumber)</OutputName>
         <OutputName Condition="$(Platform) == 'x64'">$(OutputName)-amd64</OutputName>
+        <OutputName Condition="$(Platform) == 'ARM64'">$(OutputName)-arm64</OutputName>
         <OutputName Condition="'$(OutputSuffix)' != ''">$(OutputName)-$(OutputSuffix)</OutputName>
         <OutputName Condition="'$(Configuration)' == 'Debug'">$(OutputName)-d</OutputName>
         <TargetName>$(OutputName)</TargetName>
 
         <OutputPath>$(OutputPath)en-us\</OutputPath>
         <OutDir>$(OutputPath)</OutDir>
-        
+
         <!-- See Tools/msi/buildrelease.bat for help on configuring the download URL -->
         <DownloadUrl Condition="'$(DownloadUrl)' == '' and '$(DownloadUrlBase)' != ''">$(DownloadUrlBase.TrimEnd(`/`))/{version}/{arch}{releasename}/{msi}</DownloadUrl>
         <DefineConstants Condition="'$(DownloadUrl)' != ''">$(DefineConstants);DownloadUrl=$(DownloadUrl.Replace(`{version}`, `$(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber)`).Replace(`{arch}`, `$(ArchName)`).Replace(`{releasename}`, `$(ReleaseLevelName)`).Replace(`{msi}`, `{2}`))</DefineConstants>
         <DefineConstants Condition="'$(DownloadUrl)' == ''">$(DefineConstants);DownloadUrl={2}</DefineConstants>
     </PropertyGroup>
-    
+
     <ItemGroup>
         <WixExtension Include="WixUtilExtension">
             <HintPath>WixUtilExtension</HintPath>
@@ -42,7 +43,6 @@
     </ItemGroup>
     <ItemGroup>
         <Content Include="Default.thm" />
-        <Content Include="Default.wxl" />
         <Content Include="SideBar.png" />
     </ItemGroup>
     <ItemGroup>
@@ -54,7 +54,7 @@
             <BindName></BindName>
         </LinkerBindInputPaths>
     </ItemGroup>
-    
+
     <ItemDefinitionGroup>
         <Package>
             <Properties>BuildForRelease=$(BuildForRelease)</Properties>
@@ -69,40 +69,61 @@
         <Package Include="..\path\path*.wixproj" />
         <Package Include="..\appendpath\appendpath*.wixproj" />
         <Package Include="..\pip\pip*.wixproj" />
-        <Package Include="..\tcltk\tcltk*.wixproj" />
+        <Package Include="..\tcltk\tcltk*.wixproj" Condition="$(Platform) != 'ARM64'" />
         <Package Include="..\test\test*.wixproj" />
         <Package Include="..\tools\tools*.wixproj" />
-        <Package Include="..\ucrt\ucrt*.wixproj" />
+        <Package Include="..\ucrt\ucrt*.wixproj" Condition="$(Platform) != 'ARM64'" />
     </ItemGroup>
-    
+
     <PropertyGroup>
         <BuildPackagesTargets>Build</BuildPackagesTargets>
     </PropertyGroup>
-    
+
     <Target Name="_SetRebuildTarget" BeforeTargets="BeforeRebuild">
         <PropertyGroup>
             <BuildPackagesTargets>Rebuild</BuildPackagesTargets>
         </PropertyGroup>
     </Target>
-    
+
     <Target Name="BuildPackages" BeforeTargets="BeforeBuild" Condition="'$(RebuildAll)' != 'false'">
         <MSBuild Projects="@(Package)" Targets="$(BuildPackagesTargets)" BuildInParallel="true" />
     </Target>
-    
+
     <Target Name="BuildBootstrapApplication" BeforeTargets="BeforeBuild">
         <Message Text="Building bootstrap app" Importance="high" />
-        
+
         <MSBuild Projects="bootstrap\pythonba.vcxproj"
                  Targets="Build;GetNativeTargetPath"
                  UseResultsCache="true"
-                 Properties="Configuration=$(BootstrapConfiguration);Platform=Win32">
+                 Properties="Configuration=$(BootstrapConfiguration);Platform=Win32;BuildForPlatform=$(Platform)">
             <Output TaskParameter="TargetOutputs" PropertyName="BootstrapAppPath" />
         </MSBuild>
-        
+
         <PropertyGroup>
             <DefineConstants>$(DefineConstants);BootstrapApp=$(BootstrapAppPath)</DefineConstants>
         </PropertyGroup>
     </Target>
-    
+
+    <Target Name="AddDefaultWxl" AfterTargets="PrepareForBuild" Condition="!Exists('Default.$(Platform).xsl')">
+        <ItemGroup>
+            <EmbeddedResource Include="Default.wxl" />
+        </ItemGroup>
+        <PropertyGroup>
+            <DefineConstants>$(DefineConstants);DefaultWxl=Default.wxl</DefineConstants>
+        </PropertyGroup>
+    </Target>
+    <Target Name="AddUpdatedDefaultWxl" AfterTargets="PrepareForBuild" Condition="Exists('Default.$(Platform).xsl')">
+        <XslTransformation XmlInputPaths="Default.wxl"
+                           OutputPaths="$(IntermediateOutputPath)Default.wxl"
+                           XslInputPath="Default.$(Platform).xsl"
+                           UseTrustedSettings="true" />
+        <ItemGroup>
+          <EmbeddedResource Include="$(IntermediateOutputPath)Default.wxl" />
+        </ItemGroup>
+        <PropertyGroup>
+            <DefineConstants>$(DefineConstants);DefaultWxl=$(IntermediateOutputPath)Default.wxl</DefineConstants>
+        </PropertyGroup>
+    </Target>
+
     <Import Project="..\msi.targets" />
 </Project>
diff --git a/Tools/msi/bundle/bundle.wxs b/Tools/msi/bundle/bundle.wxs
index a145d840d3305..5c9fd6dca394c 100644
--- a/Tools/msi/bundle/bundle.wxs
+++ b/Tools/msi/bundle/bundle.wxs
@@ -12,7 +12,7 @@
           dep:ProviderKey="CPython-$(var.MajorVersionNumber).$(var.MinorVersionNumber)$(var.PyArchExt)$(var.PyTestExt)">
     <BootstrapperApplication Id="PythonBA" SourceFile="$(var.BootstrapApp)">
         <Payload Compressed='yes' SourceFile='Default.thm' />
-        <Payload Compressed='yes' SourceFile='Default.wxl' />
+        <Payload Compressed='yes' SourceFile='$(var.DefaultWxl)' />
         <Payload Compressed='yes' SourceFile='SideBar.png' />
     </BootstrapperApplication>
 
@@ -26,6 +26,9 @@
     <Variable Name="WinVer" Value="$(var.MajorVersionNumber).$(var.MinorVersionNumber)$(var.PyArchExt)$(var.PyTestExt)" />
     <Variable Name="WinVerNoDot" Value="$(var.MajorVersionNumber)$(var.MinorVersionNumber)$(var.PyArchExt)$(var.PyTestExt)" />
 
+    <!-- A more accurate value may be calculated by the bootstrapper -->
+    <Variable Name="ProgramFilesArmFolder" Value="[ProgramFilesFolder]" bal:Overridable="yes" />
+
     <Variable Name="InstallAllUsers" Value="0" bal:Overridable="yes" />
     <?if "$(var.PyTestExt)"="" ?>
     <Variable Name="InstallLauncherAllUsers" Value="1" bal:Overridable="yes" />
@@ -36,6 +39,9 @@
     <?if $(var.Platform)~="x64" ?>
     <Variable Name="DefaultAllUsersTargetDir" Value="[ProgramFiles64Folder]Python[WinVerNoDot]" bal:Overridable="yes" />
     <Variable Name="TargetPlatform" Value="x64" />
+    <?elseif $(var.Platform)~="ARM64" ?>
+    <Variable Name="DefaultAllUsersTargetDir" Value="[ProgramFilesArmFolder]Python[WinVerNoDot]" bal:Overridable="yes" />
+    <Variable Name="TargetPlatform" Value="ARM64" />
     <?else ?>
     <Variable Name="DefaultAllUsersTargetDir" Value="[ProgramFilesFolder]Python[WinVerNoDot]" bal:Overridable="yes" />
     <Variable Name="TargetPlatform" Value="x86" />
@@ -43,7 +49,7 @@
     <Variable Name="DefaultJustForMeTargetDir" Value="[LocalAppDataFolder]Programs\Python\Python[WinVerNoDot]" bal:Overridable="yes" />
     <Variable Name="OptionalFeaturesRegistryKey" Value="Software\Python\PythonCore\[WinVer]\InstalledFeatures" />
     <Variable Name="TargetDirRegistryKey" Value="Software\Python\PythonCore\[WinVer]\InstallPath" />
-    
+
     <!--
     An empty string will use the other defaults based on InstallAllUsers
     (and switch dynamically in the UI). To get the old default, pass
@@ -53,7 +59,9 @@
     <Variable Name="DefaultCustomTargetDir" Value="" bal:Overridable="yes" />
 
     <Variable Name="InstallAllUsersState" Value="enabled" bal:Overridable="yes" />
-    <?if "$(var.PyTestExt)"="" ?>
+    <?if "$(var.Platform)"~="ARM64" ?>
+    <Variable Name="InstallLauncherAllUsersState" Value="hide" bal:Overridable="yes" />
+    <?elseif "$(var.PyTestExt)"="" ?>
     <Variable Name="InstallLauncherAllUsersState" Value="enabled" bal:Overridable="yes" />
     <?else ?>
     <Variable Name="InstallLauncherAllUsersState" Value="disable" bal:Overridable="yes" />
@@ -69,32 +77,44 @@
     <Variable Name="Include_test" Value="1" bal:Overridable="yes" />
     <Variable Name="Include_doc" Value="1" bal:Overridable="yes" />
     <Variable Name="Include_tools" Value="1" bal:Overridable="yes" />
+    <?if $(var.Platform)~="ARM64" ?>
+    <Variable Name="Include_tcltk" Value="0" />
+    <Variable Name="Include_tcltkState" Value="disable" />
+    <?else ?>
     <Variable Name="Include_tcltk" Value="1" bal:Overridable="yes" />
+    <?endif ?>
     <Variable Name="Include_pip" Value="1" bal:Overridable="yes" />
+    <?if $(var.Platform)~="ARM64" ?>
+    <Variable Name="Include_launcher" Value="0" bal:Overridable="yes" />
+    <Variable Name="Include_launcherState" Value="disable" />
+    <?else ?>
     <Variable Name="Include_launcher" Value="-1" bal:Overridable="yes" />
     <?if "$(var.PyTestExt)"="" ?>
     <Variable Name="Include_launcherState" Value="enabled" bal:Overridable="yes" />
     <?else ?>
     <Variable Name="Include_launcherState" Value="disable" />
     <?endif ?>
+    <?endif ?>
     <Variable Name="Include_symbols" Value="0" bal:Overridable="yes" />
     <Variable Name="Include_debug" Value="0" bal:Overridable="yes" />
-    
+
     <Variable Name="LauncherOnly" Value="0" bal:Overridable="yes" />
     <Variable Name="DetectedLauncher" Value="0" />
     <Variable Name="DetectedOldLauncher" Value="0" />
-    
+
     <Variable Name="AssociateFiles" Value="1" bal:Overridable="yes" />
     <Variable Name="Shortcuts" Value="1" bal:Overridable="yes" />
     <Variable Name="PrependPath" Value="0" bal:Overridable="yes" />
     <Variable Name="AppendPath" Value="0" bal:Overridable="yes" />
     <Variable Name="CompileAll" Value="0" bal:Overridable="yes" />
-    
+
     <Variable Name="SimpleInstall" Value="0" bal:Overridable="yes" />
     <Variable Name="SimpleInstallDescription" Value="" bal:Overridable="yes" />
-    
+
     <Chain ParallelCache="yes">
+      <?if $(var.Platform)!="ARM64" ?>
       <PackageGroupRef Id="crt" />
+      <?endif ?>
       <PackageGroupRef Id="core" />
       <PackageGroupRef Id="dev" />
       <PackageGroupRef Id="exe" />
@@ -102,8 +122,10 @@
       <PackageGroupRef Id="test" />
       <PackageGroupRef Id="doc" />
       <PackageGroupRef Id="tools" />
+      <?if $(var.Platform)!="ARM64" ?>
       <PackageGroupRef Id="tcltk" />
       <PackageGroupRef Id="launcher" />
+      <?endif ?>
       <PackageGroupRef Id="pip" />
       <PackageGroupRef Id="packageinstall" />
       <PackageGroupRef Id="postinstall" />
diff --git a/Tools/msi/core/core.wxs b/Tools/msi/core/core.wxs
index 0d4fbde9787cc..21a8bcdf97101 100644
--- a/Tools/msi/core/core.wxs
+++ b/Tools/msi/core/core.wxs
@@ -1,7 +1,7 @@
 <?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="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
+        <Package InstallerVersion="500" Compressed="yes" InstallScope="perUser" />
         <MediaTemplate EmbedCab="yes" CompressionLevel="high" />
         
         <PropertyRef Id="UpgradeTable" />
diff --git a/Tools/msi/core/core_d.wxs b/Tools/msi/core/core_d.wxs
index 07e0397686b7b..1cee0973aac31 100644
--- a/Tools/msi/core/core_d.wxs
+++ b/Tools/msi/core/core_d.wxs
@@ -1,7 +1,7 @@
 <?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="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
+        <Package InstallerVersion="500" Compressed="yes" InstallScope="perUser" />
         <MediaTemplate EmbedCab="yes" CompressionLevel="high" />
         
         <PropertyRef Id="UpgradeTable" />
diff --git a/Tools/msi/core/core_pdb.wxs b/Tools/msi/core/core_pdb.wxs
index c2c3178973cd2..1fe7d1e7a944c 100644
--- a/Tools/msi/core/core_pdb.wxs
+++ b/Tools/msi/core/core_pdb.wxs
@@ -1,7 +1,7 @@
 <?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="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
+        <Package InstallerVersion="500" Compressed="yes" InstallScope="perUser" />
         <MediaTemplate EmbedCab="yes" CompressionLevel="high" />
         
         <PropertyRef Id="UpgradeTable" />
diff --git a/Tools/msi/dev/dev.wxs b/Tools/msi/dev/dev.wxs
index 23a710df87d55..cfc4c449d17cf 100644
--- a/Tools/msi/dev/dev.wxs
+++ b/Tools/msi/dev/dev.wxs
@@ -1,7 +1,7 @@
 <?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="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
+        <Package InstallerVersion="500" Compressed="yes" InstallScope="perUser" />
         <MediaTemplate EmbedCab="yes" CompressionLevel="high" />
         
         <PropertyRef Id="UpgradeTable" />
diff --git a/Tools/msi/dev/dev_d.wxs b/Tools/msi/dev/dev_d.wxs
index c467aac57b951..20bf9ee256f2f 100644
--- a/Tools/msi/dev/dev_d.wxs
+++ b/Tools/msi/dev/dev_d.wxs
@@ -1,7 +1,7 @@
 <?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="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
+        <Package InstallerVersion="500" Compressed="yes" InstallScope="perUser" />
         <MediaTemplate EmbedCab="yes" CompressionLevel="high" />
         
         <PropertyRef Id="UpgradeTable" />
diff --git a/Tools/msi/doc/doc.wxs b/Tools/msi/doc/doc.wxs
index cd1a68cc2601a..d05936fd85055 100644
--- a/Tools/msi/doc/doc.wxs
+++ b/Tools/msi/doc/doc.wxs
@@ -1,7 +1,7 @@
 <?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="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
+        <Package InstallerVersion="500" Compressed="yes" InstallScope="perUser" />
         <MediaTemplate EmbedCab="yes" CompressionLevel="high" />
         
         <PropertyRef Id="UpgradeTable" />
diff --git a/Tools/msi/exe/exe.wxs b/Tools/msi/exe/exe.wxs
index 98d31b3a77bc3..05a8d775193e3 100644
--- a/Tools/msi/exe/exe.wxs
+++ b/Tools/msi/exe/exe.wxs
@@ -1,7 +1,7 @@
 <?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="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
+        <Package InstallerVersion="500" Compressed="yes" InstallScope="perUser" />
         <MediaTemplate EmbedCab="yes" CompressionLevel="high" />
 
         <PropertyRef Id="UpgradeTable" />
diff --git a/Tools/msi/exe/exe_d.wxs b/Tools/msi/exe/exe_d.wxs
index eedb6bb640eea..3b327bc26d789 100644
--- a/Tools/msi/exe/exe_d.wxs
+++ b/Tools/msi/exe/exe_d.wxs
@@ -1,7 +1,7 @@
 <?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="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
+        <Package InstallerVersion="500" Compressed="yes" InstallScope="perUser" />
         <MediaTemplate EmbedCab="yes" CompressionLevel="high" />
         
         <PropertyRef Id="UpgradeTable" />
diff --git a/Tools/msi/exe/exe_pdb.wxs b/Tools/msi/exe/exe_pdb.wxs
index f25094f828133..f706cf3b0e0cf 100644
--- a/Tools/msi/exe/exe_pdb.wxs
+++ b/Tools/msi/exe/exe_pdb.wxs
@@ -1,7 +1,7 @@
 <?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="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
+        <Package InstallerVersion="500" Compressed="yes" InstallScope="perUser" />
         <MediaTemplate EmbedCab="yes" CompressionLevel="high" />
         
         <PropertyRef Id="UpgradeTable" />
diff --git a/Tools/msi/get_externals.bat b/Tools/msi/get_externals.bat
index d66781d7c42ec..f6602ce9588ff 100644
--- a/Tools/msi/get_externals.bat
+++ b/Tools/msi/get_externals.bat
@@ -56,7 +56,7 @@ set binaries=%binaries%     gpg
 set binaries=%binaries%     htmlhelp
 set binaries=%binaries%     nuget
 set binaries=%binaries%     redist-1
-set binaries=%binaries%     wix
+set binaries=%binaries%     wix-314
 
 for %%b in (%binaries%) do (
     if exist "%EXTERNALS_DIR%\%%b" (
diff --git a/Tools/msi/launcher/launcher.wxs b/Tools/msi/launcher/launcher.wxs
index 7de131a3edbbb..d001fe53ea381 100644
--- a/Tools/msi/launcher/launcher.wxs
+++ b/Tools/msi/launcher/launcher.wxs
@@ -1,7 +1,7 @@
 <?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="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
+        <Package InstallerVersion="500" Compressed="yes" InstallScope="perUser" />
         <MediaTemplate EmbedCab="yes" CompressionLevel="high" />
         
         <Property Id="Suppress_TARGETDIR_Check" Value="1" />
diff --git a/Tools/msi/lib/lib.wxs b/Tools/msi/lib/lib.wxs
index 2a3b9ecfeef8d..5c67420978927 100644
--- a/Tools/msi/lib/lib.wxs
+++ b/Tools/msi/lib/lib.wxs
@@ -1,7 +1,7 @@
 <?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="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
+        <Package InstallerVersion="500" Compressed="yes" InstallScope="perUser" />
         <MediaTemplate EmbedCab="yes" CompressionLevel="high" />
         
         <PropertyRef Id="UpgradeTable" />
diff --git a/Tools/msi/lib/lib_d.wxs b/Tools/msi/lib/lib_d.wxs
index 8a8a530d41a89..7968d179743a0 100644
--- a/Tools/msi/lib/lib_d.wxs
+++ b/Tools/msi/lib/lib_d.wxs
@@ -1,7 +1,7 @@
 <?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="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
+        <Package InstallerVersion="500" Compressed="yes" InstallScope="perUser" />
         <MediaTemplate EmbedCab="yes" CompressionLevel="high" />
         
         <PropertyRef Id="UpgradeTable" />
diff --git a/Tools/msi/lib/lib_pdb.wxs b/Tools/msi/lib/lib_pdb.wxs
index 8839e8a429f78..7918893a9a250 100644
--- a/Tools/msi/lib/lib_pdb.wxs
+++ b/Tools/msi/lib/lib_pdb.wxs
@@ -1,7 +1,7 @@
 <?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="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
+        <Package InstallerVersion="500" Compressed="yes" InstallScope="perUser" />
         <MediaTemplate EmbedCab="yes" CompressionLevel="high" />
         
         <PropertyRef Id="UpgradeTable" />
diff --git a/Tools/msi/msi.props b/Tools/msi/msi.props
index cb9221fddf8ec..b5fd3d3a3da74 100644
--- a/Tools/msi/msi.props
+++ b/Tools/msi/msi.props
@@ -12,9 +12,11 @@
         <Platform Condition="'$(Platform)' == ''">x86</Platform>
         <InstallScope Condition="'$(InstallScope)' != 'perMachine'">perUser</InstallScope>
         <_MakeCatCommand Condition="'$(_MakeCatCommand)' == ''">makecat</_MakeCatCommand>
+        <SkipCopySSLDLL>true</SkipCopySSLDLL>
     </PropertyGroup>
 
     <Import Project="wix.props" />
+    <Import Project="..\..\PCbuild\openssl.props" />
     <Import Project="..\..\PCbuild\tcltk.props" />
 
     <PropertyGroup>
@@ -71,8 +73,10 @@
     <PropertyGroup>
         <Bitness>32-bit</Bitness>
         <Bitness Condition="$(Platform) == 'x64'">64-bit</Bitness>
+        <Bitness Condition="$(Platform) == 'ARM64'">ARM64</Bitness>
         <PlatformArchitecture>32bit</PlatformArchitecture>
         <PlatformArchitecture Condition="$(Platform) == 'x64'">64bit</PlatformArchitecture>
+        <PlatformArchitecture Condition="$(Platform) == 'ARM64'">ARM64</PlatformArchitecture>
         <DefineConstants>
             $(DefineConstants);
             Version=$(InstallerVersion);
@@ -88,17 +92,12 @@
             PyArchExt=$(PyArchExt);
             PyTestExt=$(PyTestExt);
             OptionalFeatureName=$(OutputName);
-            ssltag=-1_1;
+            ssltag=$(OpenSSLDLLSuffix);
+            Suffix32=$(PyArchExt);
         </DefineConstants>
         <DefineConstants Condition="'$(CRTRedist)' != ''">
             $(DefineConstants);CRTRedist=$(CRTRedist);
         </DefineConstants>
-        <DefineConstants Condition="$(Platform) != 'x64'">
-            $(DefineConstants);Suffix32=-32;
-        </DefineConstants>
-        <DefineConstants Condition="$(Platform) == 'x64'">
-            $(DefineConstants);Suffix32=;
-        </DefineConstants>
     </PropertyGroup>
 
     <ItemDefinitionGroup>
@@ -134,10 +133,14 @@
         <LinkerBindInputPaths Include="$(BuildPath64)">
             <BindName>build64</BindName>
         </LinkerBindInputPaths>
+        <LinkerBindInputPaths Include="$(BuildPathARM64)">
+            <BindName>buildarm64</BindName>
+        </LinkerBindInputPaths>
     </ItemGroup>
 
     <Target Name="_ValidateMsiProps" BeforeTargets="PrepareForBuild">
-        <Error Text="Platform '$(Platform)' is not supported. Use 'x86' or 'x64'." Condition="$(Platform) != 'x86' and $(Platform) != 'x64'" />
+        <Error Text="Platform '$(Platform)' is not supported. Use 'x86', 'x64' or 'ARM64'."
+               Condition="$(Platform) != 'x86' and $(Platform) != 'x64' and $(Platform) != 'ARM64'" />
     </Target>
     
     <ItemGroup>
@@ -166,13 +169,16 @@
             <Uri>registry/$(OutputName)</Uri>
         </_Uuid>
     </ItemGroup>
-    <Target Name="_GenerateGuids" AfterTargets="PrepareForBuild" Condition="$(TargetName) != 'launcher'">
+    <Target Name="_GenerateGuids"
+            AfterTargets="PrepareForBuild"
+            DependsOnTargets="FindPythonForBuild"
+            Condition="$(TargetName) != 'launcher'">
         <PropertyGroup>
             <_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='"$(PythonExe)" -c "$(_GenerateCommand)" > "$(IntermediateOutputPath)$(OutputName)guids.txt"'
+        <Exec Command='$(PythonForBuild) -c "$(_GenerateCommand)" > "$(IntermediateOutputPath)$(OutputName)guids.txt"'
               WorkingDirectory="$(MSBuildThisFileDirectory)"
               IgnoreExitCode="false" />
         
diff --git a/Tools/msi/msi.targets b/Tools/msi/msi.targets
index 4788a637a5d2d..99d1de4d9d83f 100644
--- a/Tools/msi/msi.targets
+++ b/Tools/msi/msi.targets
@@ -1,7 +1,10 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
 
-    <Target Name="ProcessInstallFiles" AfterTargets="PrepareForBuild" Condition="@(InstallFiles) != ''">
+    <Target Name="ProcessInstallFiles"
+            AfterTargets="PrepareForBuild"
+            DependsOnTargets="FindPythonForBuild"
+            Condition="@(InstallFiles) != ''">
         <PropertyGroup>
             <_FileListTarget>$(IntermediateOutputPath)$(MSBuildProjectName).g.csv</_FileListTarget>
             <_InstallFilesTarget>$(IntermediateOutputPath)$(MSBuildProjectName).g.wxs</_InstallFilesTarget>
@@ -17,7 +20,7 @@
         </ItemGroup>
 
         <WriteLinesToFile File="$(_FileListTarget)" Lines="@(InstallFiles->'"%(_Source)","%(_Target)","%(Group)","%(DiskId)","%(Condition)"')" Overwrite="true" />
-        <Exec Command='"$(PythonExe)" csv_to_wxs.py "$(_FileListTarget)" "$(_InstallFilesTarget)"'
+        <Exec Command='$(PythonForBuild) csv_to_wxs.py "$(_FileListTarget)" "$(_InstallFilesTarget)"'
               WorkingDirectory="$(MSBuildThisFileDirectory)" />
 
         <ItemGroup>
diff --git a/Tools/msi/path/path.wxs b/Tools/msi/path/path.wxs
index 8b37936cc938f..496f9d08a470c 100644
--- a/Tools/msi/path/path.wxs
+++ b/Tools/msi/path/path.wxs
@@ -1,7 +1,7 @@
 <?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="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
+        <Package InstallerVersion="500" Compressed="yes" InstallScope="perUser" />
         
         <PropertyRef Id="UpgradeTable" />
         <PropertyRef Id="REGISTRYKEY" />
diff --git a/Tools/msi/pip/pip.wxs b/Tools/msi/pip/pip.wxs
index 19e9f5fd20886..1d8083cad91a5 100644
--- a/Tools/msi/pip/pip.wxs
+++ b/Tools/msi/pip/pip.wxs
@@ -1,7 +1,7 @@
 <?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="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
+        <Package InstallerVersion="500" Compressed="yes" InstallScope="perUser" />
         
         <PropertyRef Id="UpgradeTable" />
         <PropertyRef Id="REGISTRYKEY" />
diff --git a/Tools/msi/purge.py b/Tools/msi/purge.py
index 41be06939ab4c..de9fdc95202af 100644
--- a/Tools/msi/purge.py
+++ b/Tools/msi/purge.py
@@ -65,9 +65,15 @@
     "python-{}-webinstall.exe".format(m.group(0)),
     "python-{}-amd64.exe".format(m.group(0)),
     "python-{}-amd64-webinstall.exe".format(m.group(0)),
+    "python-{}-arm64.exe".format(m.group(0)),
+    "python-{}-arm64-webinstall.exe".format(m.group(0)),
     "python-{}-embed-amd64.zip".format(m.group(0)),
     "python-{}-embed-win32.zip".format(m.group(0)),
-] + ["win32{}/{}".format(REL, f) for f in FILES] + ["amd64{}/{}".format(REL, f) for f in FILES]
+    "python-{}-embed-arm64.zip".format(m.group(0)),
+    *["win32{}/{}".format(REL, f) for f in FILES],
+    *["amd64{}/{}".format(REL, f) for f in FILES],
+    *["arm64{}/{}".format(REL, f) for f in FILES],
+]
 PATHS = PATHS + [p + ".asc" for p in PATHS]
 
 print('Purged:')
diff --git a/Tools/msi/tcltk/tcltk.wxs b/Tools/msi/tcltk/tcltk.wxs
index eeae8e8b0dfa5..fdd6da384bf0c 100644
--- a/Tools/msi/tcltk/tcltk.wxs
+++ b/Tools/msi/tcltk/tcltk.wxs
@@ -1,7 +1,7 @@
 <?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="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
+        <Package InstallerVersion="500" Compressed="yes" InstallScope="perUser" />
         <MediaTemplate EmbedCab="yes" CompressionLevel="high" />
         
         <PropertyRef Id="UpgradeTable" />
diff --git a/Tools/msi/tcltk/tcltk_d.wxs b/Tools/msi/tcltk/tcltk_d.wxs
index 391b3af5713d2..38aacd929995e 100644
--- a/Tools/msi/tcltk/tcltk_d.wxs
+++ b/Tools/msi/tcltk/tcltk_d.wxs
@@ -1,7 +1,7 @@
 <?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="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
+        <Package InstallerVersion="500" Compressed="yes" InstallScope="perUser" />
         <MediaTemplate EmbedCab="yes" CompressionLevel="high" />
         
         <PropertyRef Id="UpgradeTable" />
diff --git a/Tools/msi/tcltk/tcltk_pdb.wxs b/Tools/msi/tcltk/tcltk_pdb.wxs
index 04454f3849fc7..55f209162553e 100644
--- a/Tools/msi/tcltk/tcltk_pdb.wxs
+++ b/Tools/msi/tcltk/tcltk_pdb.wxs
@@ -1,7 +1,7 @@
 <?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="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
+        <Package InstallerVersion="500" Compressed="yes" InstallScope="perUser" />
         <MediaTemplate EmbedCab="yes" CompressionLevel="high" />
         
         <PropertyRef Id="UpgradeTable" />
diff --git a/Tools/msi/test/test.wxs b/Tools/msi/test/test.wxs
index f2ed64f07bf28..bf601f42a7283 100644
--- a/Tools/msi/test/test.wxs
+++ b/Tools/msi/test/test.wxs
@@ -1,7 +1,7 @@
 <?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="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
+        <Package InstallerVersion="500" Compressed="yes" InstallScope="perUser" />
         <MediaTemplate EmbedCab="yes" CompressionLevel="high" />
         
         <PropertyRef Id="UpgradeTable" />
diff --git a/Tools/msi/test/test_d.wxs b/Tools/msi/test/test_d.wxs
index a954876755c47..9b26ff6a4bf4c 100644
--- a/Tools/msi/test/test_d.wxs
+++ b/Tools/msi/test/test_d.wxs
@@ -1,7 +1,7 @@
 <?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="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
+        <Package InstallerVersion="500" Compressed="yes" InstallScope="perUser" />
         <MediaTemplate EmbedCab="yes" CompressionLevel="high" />
         
         <PropertyRef Id="UpgradeTable" />
diff --git a/Tools/msi/test/test_pdb.wxs b/Tools/msi/test/test_pdb.wxs
index de634a390bab6..5a2ef36684007 100644
--- a/Tools/msi/test/test_pdb.wxs
+++ b/Tools/msi/test/test_pdb.wxs
@@ -1,7 +1,7 @@
 <?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="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
+        <Package InstallerVersion="500" Compressed="yes" InstallScope="perUser" />
         <MediaTemplate EmbedCab="yes" CompressionLevel="high" />
         
         <PropertyRef Id="UpgradeTable" />
diff --git a/Tools/msi/tools/tools.wxs b/Tools/msi/tools/tools.wxs
index 7a805d0612e08..bb6436c7a0f81 100644
--- a/Tools/msi/tools/tools.wxs
+++ b/Tools/msi/tools/tools.wxs
@@ -1,7 +1,7 @@
 <?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="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
+        <Package InstallerVersion="500" Compressed="yes" InstallScope="perUser" />
         <MediaTemplate EmbedCab="yes" CompressionLevel="high" />
         
         <PropertyRef Id="UpgradeTable" />
diff --git a/Tools/msi/ucrt/ucrt.wxs b/Tools/msi/ucrt/ucrt.wxs
index 76e56820c53b2..525130c8bec3a 100644
--- a/Tools/msi/ucrt/ucrt.wxs
+++ b/Tools/msi/ucrt/ucrt.wxs
@@ -1,7 +1,7 @@
 <?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="300" Compressed="yes" InstallScope="perUser" Platform="$(var.Platform)" />
+        <Package InstallerVersion="500" Compressed="yes" InstallScope="perUser" />
         <MediaTemplate EmbedCab="yes" CompressionLevel="high" />
         
         <PropertyRef Id="UpgradeTable" />
diff --git a/Tools/msi/wix.props b/Tools/msi/wix.props
index 7269d34c030ca..d8ced317d0ce8 100644
--- a/Tools/msi/wix.props
+++ b/Tools/msi/wix.props
@@ -4,7 +4,7 @@
   
   <PropertyGroup>
     <WixInstallPath Condition="'$(WixInstallPath)' == '' and Exists('$(MSBuildThisFileDirectory)\Wix')">$(MSBuildThisFileDirectory)\Wix\</WixInstallPath>
-    <WixInstallPath Condition="'$(WixInstallPath)' == '' and Exists('$(ExternalsDir)\windows-installer\wix')">$(ExternalsDir)\windows-installer\wix\</WixInstallPath>
+    <WixInstallPath Condition="'$(WixInstallPath)' == '' and Exists('$(ExternalsDir)\windows-installer\wix-314')">$(ExternalsDir)\windows-installer\wix-314\</WixInstallPath>
     <WixInstallPath Condition="'$(WixInstallPath)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Installer XML\3.10 at InstallRoot)</WixInstallPath>
     <WixInstallPath Condition="'$(WixInstallPath)' == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows Installer XML\3.10 at InstallRoot)</WixInstallPath>
     <WixTargetsPath>$(WixInstallPath)\Wix.targets</WixTargetsPath>



More information about the Python-checkins mailing list