From d53985570a99b52a1ad708916745ad010584df18 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Tue, 25 Jan 2022 01:07:27 +0000 Subject: [PATCH 01/12] Implement MSI installer for ARM64 --- PCbuild/openssl.props | 9 +++- PCbuild/tcltk.props | 1 + Tools/msi/appendpath/appendpath.wxs | 2 +- Tools/msi/buildrelease.bat | 54 ++++++++++++++++----- Tools/msi/bundle/Default.thm | 8 +-- Tools/msi/bundle/bootstrap/pythonba.vcxproj | 10 ++-- Tools/msi/bundle/bundle.targets | 5 +- Tools/msi/bundle/bundle.wxs | 13 +++++ Tools/msi/core/core.wxs | 2 +- Tools/msi/core/core_d.wxs | 2 +- Tools/msi/core/core_pdb.wxs | 2 +- Tools/msi/dev/dev.wxs | 2 +- Tools/msi/dev/dev_d.wxs | 2 +- Tools/msi/doc/doc.wxs | 2 +- Tools/msi/exe/exe.wxs | 2 +- Tools/msi/exe/exe_d.wxs | 2 +- Tools/msi/exe/exe_pdb.wxs | 2 +- Tools/msi/launcher/launcher.wxs | 2 +- Tools/msi/lib/lib.wxs | 2 +- Tools/msi/lib/lib_d.wxs | 2 +- Tools/msi/lib/lib_pdb.wxs | 2 +- Tools/msi/msi.props | 26 ++++++---- Tools/msi/msi.targets | 7 ++- Tools/msi/path/path.wxs | 2 +- Tools/msi/pip/pip.wxs | 2 +- Tools/msi/tcltk/tcltk.wxs | 2 +- Tools/msi/tcltk/tcltk_d.wxs | 2 +- Tools/msi/tcltk/tcltk_pdb.wxs | 2 +- Tools/msi/test/test.wxs | 2 +- Tools/msi/test/test_d.wxs | 2 +- Tools/msi/test/test_pdb.wxs | 2 +- Tools/msi/tools/tools.wxs | 2 +- Tools/msi/ucrt/ucrt.wxs | 2 +- 33 files changed, 118 insertions(+), 63 deletions(-) diff --git a/PCbuild/openssl.props b/PCbuild/openssl.props index a7e16793c7f283..6081d3c8c69641 100644 --- a/PCbuild/openssl.props +++ b/PCbuild/openssl.props @@ -13,6 +13,7 @@ <_DLLSuffix>-1_1 <_DLLSuffix Condition="$(Platform) == 'ARM'">$(_DLLSuffix)-arm <_DLLSuffix Condition="$(Platform) == 'ARM64'">$(_DLLSuffix)-arm64 + $(_DLLSuffix) <_SSLDLL Include="$(opensslOutDir)\libcrypto$(_DLLSuffix).dll" /> @@ -20,10 +21,14 @@ <_SSLDLL Include="$(opensslOutDir)\libssl$(_DLLSuffix).dll" /> <_SSLDLL Include="$(opensslOutDir)\libssl$(_DLLSuffix).pdb" /> - + - + \ No newline at end of file diff --git a/PCbuild/tcltk.props b/PCbuild/tcltk.props index 16dc35d45ebd5c..72cffc3ea1da6d 100644 --- a/PCbuild/tcltk.props +++ b/PCbuild/tcltk.props @@ -29,6 +29,7 @@ $(tcltkDir)lib\tcl$(TclMajorVersion)$(TclMinorVersion)t$(TclDebugExt).lib;$(tcltkDir)lib\tk$(TkMajorVersion)$(TkMinorVersion)t$(TclDebugExt).lib IX86 AMD64 + ARM64 TCL_MAJOR_VERSION=$(TclMajorVersion) TCL_MINOR_VERSION=$(TclMinorVersion) TCL_PATCH_LEVEL=$(TclPatchLevel) TCL_MAJOR=$(TclMajorVersion) TCL_MINOR=$(TclMinorVersion) TCL_PATCH=$(TclPatchLevel) TK_MAJOR_VERSION=$(TkMajorVersion) TK_MINOR_VERSION=$(TkMinorVersion) TK_PATCH_LEVEL=$(TkPatchLevel) diff --git a/Tools/msi/appendpath/appendpath.wxs b/Tools/msi/appendpath/appendpath.wxs index b972f612bf7992..e8d7a9d0a31ae1 100644 --- a/Tools/msi/appendpath/appendpath.wxs +++ b/Tools/msi/appendpath/appendpath.wxs @@ -1,7 +1,7 @@  - + diff --git a/Tools/msi/buildrelease.bat b/Tools/msi/buildrelease.bat index 4fbaf2c99ba9b8..faee96bf25541c 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,12 +85,12 @@ 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= +rem where dlltool /q && goto skipdlltoolsearch +rem set _DLLTOOL_PATH= +rem where /R "%EXTERNALS%\" dlltool > "%TEMP%\dlltool.loc" 2> nul && set /P _DLLTOOL_PATH= < "%TEMP%\dlltool.loc" & del "%TEMP%\dlltool.loc" +rem if not exist "%_DLLTOOL_PATH%" echo Cannot find binutils on PATH or in external && exit /B 1 +rem for %%f in (%_DLLTOOL_PATH%) do set PATH=%PATH%;%%~dpf +rem set _DLLTOOL_PATH= :skipdlltoolsearch if defined BUILDX86 ( @@ -101,6 +103,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 +124,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" ( @@ -184,13 +200,21 @@ if defined BUILDMSI ( ) 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 +229,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 +237,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 +256,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.thm b/Tools/msi/bundle/Default.thm index f5ba43d838fcf7..8b77022344cb29 100644 --- a/Tools/msi/bundle/Default.thm +++ b/Tools/msi/bundle/Default.thm @@ -52,16 +52,16 @@ #(loc.Custom1Header) - #(loc.Include_docLabel) + #(loc.Include_docLabel) #(loc.Include_docHelpLabel) - #(loc.Include_pipLabel) + #(loc.Include_pipLabel) #(loc.Include_pipHelpLabel) - #(loc.Include_tcltkLabel) + #(loc.Include_tcltkLabel) #(loc.Include_tcltkHelpLabel) - #(loc.Include_testLabel) + #(loc.Include_testLabel) #(loc.Include_testHelpLabel) #(loc.Include_launcherLabel) diff --git a/Tools/msi/bundle/bootstrap/pythonba.vcxproj b/Tools/msi/bundle/bootstrap/pythonba.vcxproj index d90b5e3ff00096..fd5c834b90efc7 100644 --- a/Tools/msi/bundle/bootstrap/pythonba.vcxproj +++ b/Tools/msi/bundle/bootstrap/pythonba.vcxproj @@ -21,11 +21,10 @@ Release Win32 - v142 + v143 + v142 v141 - v140 - v140 - v120 + v140 {7A09B132-B3EE-499B-A700-A4B2157FEA3D} PythonBA @@ -50,8 +49,7 @@ comctl32.lib;gdiplus.lib;msimg32.lib;shlwapi.lib;wininet.lib;dutil.lib;balutil.lib;version.lib;uxtheme.lib;%(AdditionalDependencies) - $(WixInstallPath)sdk\vs2017\lib\x86 - $(WixInstallPath)sdk\vs2017\lib\x86 + $(WixInstallPath)sdk\vs2017\lib\x86 $(WixInstallPath)sdk\vs2015\lib\x86 $(WixInstallPath)sdk\vs2013\lib\x86 pythonba.def diff --git a/Tools/msi/bundle/bundle.targets b/Tools/msi/bundle/bundle.targets index 5d8ae6c1d7cbaa..33f177a93a2546 100644 --- a/Tools/msi/bundle/bundle.targets +++ b/Tools/msi/bundle/bundle.targets @@ -9,6 +9,7 @@ $(OutputName)-$(PythonVersion) $(OutputName)-$(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber).$(RevisionNumber) $(OutputName)-amd64 + $(OutputName)-arm64 $(OutputName)-$(OutputSuffix) $(OutputName)-d $(OutputName) @@ -69,10 +70,10 @@ - + - + diff --git a/Tools/msi/bundle/bundle.wxs b/Tools/msi/bundle/bundle.wxs index a145d840d3305d..69e858a064008f 100644 --- a/Tools/msi/bundle/bundle.wxs +++ b/Tools/msi/bundle/bundle.wxs @@ -36,6 +36,10 @@ + + + + @@ -69,7 +73,12 @@ + + + + + @@ -94,7 +103,9 @@ + + @@ -102,7 +113,9 @@ + + diff --git a/Tools/msi/core/core.wxs b/Tools/msi/core/core.wxs index 0d4fbde9787cca..21a8bcdf971017 100644 --- a/Tools/msi/core/core.wxs +++ b/Tools/msi/core/core.wxs @@ -1,7 +1,7 @@  - + diff --git a/Tools/msi/core/core_d.wxs b/Tools/msi/core/core_d.wxs index 07e0397686b7b0..1cee0973aac312 100644 --- a/Tools/msi/core/core_d.wxs +++ b/Tools/msi/core/core_d.wxs @@ -1,7 +1,7 @@  - + diff --git a/Tools/msi/core/core_pdb.wxs b/Tools/msi/core/core_pdb.wxs index c2c3178973cd21..1fe7d1e7a944cb 100644 --- a/Tools/msi/core/core_pdb.wxs +++ b/Tools/msi/core/core_pdb.wxs @@ -1,7 +1,7 @@  - + diff --git a/Tools/msi/dev/dev.wxs b/Tools/msi/dev/dev.wxs index 23a710df87d55c..cfc4c449d17cf8 100644 --- a/Tools/msi/dev/dev.wxs +++ b/Tools/msi/dev/dev.wxs @@ -1,7 +1,7 @@  - + diff --git a/Tools/msi/dev/dev_d.wxs b/Tools/msi/dev/dev_d.wxs index c467aac57b951f..20bf9ee256f2f8 100644 --- a/Tools/msi/dev/dev_d.wxs +++ b/Tools/msi/dev/dev_d.wxs @@ -1,7 +1,7 @@  - + diff --git a/Tools/msi/doc/doc.wxs b/Tools/msi/doc/doc.wxs index cd1a68cc2601ae..d05936fd850556 100644 --- a/Tools/msi/doc/doc.wxs +++ b/Tools/msi/doc/doc.wxs @@ -1,7 +1,7 @@  - + diff --git a/Tools/msi/exe/exe.wxs b/Tools/msi/exe/exe.wxs index 98d31b3a77bc35..05a8d775193e38 100644 --- a/Tools/msi/exe/exe.wxs +++ b/Tools/msi/exe/exe.wxs @@ -1,7 +1,7 @@  - + diff --git a/Tools/msi/exe/exe_d.wxs b/Tools/msi/exe/exe_d.wxs index eedb6bb640eea7..3b327bc26d7893 100644 --- a/Tools/msi/exe/exe_d.wxs +++ b/Tools/msi/exe/exe_d.wxs @@ -1,7 +1,7 @@  - + diff --git a/Tools/msi/exe/exe_pdb.wxs b/Tools/msi/exe/exe_pdb.wxs index f25094f8281333..f706cf3b0e0cf3 100644 --- a/Tools/msi/exe/exe_pdb.wxs +++ b/Tools/msi/exe/exe_pdb.wxs @@ -1,7 +1,7 @@  - + diff --git a/Tools/msi/launcher/launcher.wxs b/Tools/msi/launcher/launcher.wxs index 7de131a3edbbbb..d001fe53ea3811 100644 --- a/Tools/msi/launcher/launcher.wxs +++ b/Tools/msi/launcher/launcher.wxs @@ -1,7 +1,7 @@  - + diff --git a/Tools/msi/lib/lib.wxs b/Tools/msi/lib/lib.wxs index 2a3b9ecfeef8d0..5c674209789275 100644 --- a/Tools/msi/lib/lib.wxs +++ b/Tools/msi/lib/lib.wxs @@ -1,7 +1,7 @@  - + diff --git a/Tools/msi/lib/lib_d.wxs b/Tools/msi/lib/lib_d.wxs index 8a8a530d41a890..7968d179743a00 100644 --- a/Tools/msi/lib/lib_d.wxs +++ b/Tools/msi/lib/lib_d.wxs @@ -1,7 +1,7 @@  - + diff --git a/Tools/msi/lib/lib_pdb.wxs b/Tools/msi/lib/lib_pdb.wxs index 8839e8a429f786..7918893a9a2505 100644 --- a/Tools/msi/lib/lib_pdb.wxs +++ b/Tools/msi/lib/lib_pdb.wxs @@ -1,7 +1,7 @@  - + diff --git a/Tools/msi/msi.props b/Tools/msi/msi.props index cb9221fddf8ec7..0093c42ada0450 100644 --- a/Tools/msi/msi.props +++ b/Tools/msi/msi.props @@ -12,9 +12,11 @@ x86 perUser <_MakeCatCommand Condition="'$(_MakeCatCommand)' == ''">makecat + true + @@ -71,8 +73,10 @@ 32-bit 64-bit + ARM64 32bit 64bit + ARM64 $(DefineConstants); Version=$(InstallerVersion); @@ -88,17 +92,12 @@ PyArchExt=$(PyArchExt); PyTestExt=$(PyTestExt); OptionalFeatureName=$(OutputName); - ssltag=-1_1; + ssltag=$(OpenSSLDLLSuffix); + Suffix32=$(PyArchExt); $(DefineConstants);CRTRedist=$(CRTRedist); - - $(DefineConstants);Suffix32=-32; - - - $(DefineConstants);Suffix32=; - @@ -134,10 +133,14 @@ build64 + + buildarm64 + - + @@ -166,13 +169,16 @@ registry/$(OutputName) - + <_Uuids>@(_Uuid->'("%(Identity)", "$(MajorVersionNumber).$(MinorVersionNumber)/%(Uri)")',',') <_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(`"`,`'`))])) - diff --git a/Tools/msi/msi.targets b/Tools/msi/msi.targets index 4788a637a5d2d6..2640953e27ee70 100644 --- a/Tools/msi/msi.targets +++ b/Tools/msi/msi.targets @@ -1,7 +1,10 @@ - + <_FileListTarget>$(IntermediateOutputPath)$(MSBuildProjectName).g.csv <_InstallFilesTarget>$(IntermediateOutputPath)$(MSBuildProjectName).g.wxs @@ -17,7 +20,7 @@ - diff --git a/Tools/msi/path/path.wxs b/Tools/msi/path/path.wxs index 8b37936cc938f2..496f9d08a470c6 100644 --- a/Tools/msi/path/path.wxs +++ b/Tools/msi/path/path.wxs @@ -1,7 +1,7 @@  - + diff --git a/Tools/msi/pip/pip.wxs b/Tools/msi/pip/pip.wxs index 19e9f5fd208860..1d8083cad91a56 100644 --- a/Tools/msi/pip/pip.wxs +++ b/Tools/msi/pip/pip.wxs @@ -1,7 +1,7 @@  - + diff --git a/Tools/msi/tcltk/tcltk.wxs b/Tools/msi/tcltk/tcltk.wxs index eeae8e8b0dfa5f..fdd6da384bf0c6 100644 --- a/Tools/msi/tcltk/tcltk.wxs +++ b/Tools/msi/tcltk/tcltk.wxs @@ -1,7 +1,7 @@  - + diff --git a/Tools/msi/tcltk/tcltk_d.wxs b/Tools/msi/tcltk/tcltk_d.wxs index 391b3af5713d24..38aacd929995ef 100644 --- a/Tools/msi/tcltk/tcltk_d.wxs +++ b/Tools/msi/tcltk/tcltk_d.wxs @@ -1,7 +1,7 @@  - + diff --git a/Tools/msi/tcltk/tcltk_pdb.wxs b/Tools/msi/tcltk/tcltk_pdb.wxs index 04454f3849fc7f..55f209162553eb 100644 --- a/Tools/msi/tcltk/tcltk_pdb.wxs +++ b/Tools/msi/tcltk/tcltk_pdb.wxs @@ -1,7 +1,7 @@  - + diff --git a/Tools/msi/test/test.wxs b/Tools/msi/test/test.wxs index f2ed64f07bf281..bf601f42a72836 100644 --- a/Tools/msi/test/test.wxs +++ b/Tools/msi/test/test.wxs @@ -1,7 +1,7 @@  - + diff --git a/Tools/msi/test/test_d.wxs b/Tools/msi/test/test_d.wxs index a954876755c476..9b26ff6a4bf4cc 100644 --- a/Tools/msi/test/test_d.wxs +++ b/Tools/msi/test/test_d.wxs @@ -1,7 +1,7 @@  - + diff --git a/Tools/msi/test/test_pdb.wxs b/Tools/msi/test/test_pdb.wxs index de634a390bab6f..5a2ef366840075 100644 --- a/Tools/msi/test/test_pdb.wxs +++ b/Tools/msi/test/test_pdb.wxs @@ -1,7 +1,7 @@  - + diff --git a/Tools/msi/tools/tools.wxs b/Tools/msi/tools/tools.wxs index 7a805d0612e080..bb6436c7a0f814 100644 --- a/Tools/msi/tools/tools.wxs +++ b/Tools/msi/tools/tools.wxs @@ -1,7 +1,7 @@  - + diff --git a/Tools/msi/ucrt/ucrt.wxs b/Tools/msi/ucrt/ucrt.wxs index 76e56820c53b23..525130c8bec3ad 100644 --- a/Tools/msi/ucrt/ucrt.wxs +++ b/Tools/msi/ucrt/ucrt.wxs @@ -1,7 +1,7 @@  - + From 03f7877c738c588f60fb1cdb9a32e89b5e9c0275 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Tue, 25 Jan 2022 13:26:21 +0000 Subject: [PATCH 02/12] Use WiX 3.14, allow skipping ARM publish on release, purge ARM64 URLs --- .azure-pipelines/windows-release.yml | 41 ++++++++++-------- .../windows-release/msi-steps.yml | 43 +++++++++++++++++-- .../stage-publish-nugetorg.yml | 4 +- .../stage-publish-pythonorg.yml | 5 ++- Tools/msi/buildrelease.bat | 2 - Tools/msi/get_externals.bat | 2 +- Tools/msi/purge.py | 8 +++- Tools/msi/wix.props | 2 +- 8 files changed, 76 insertions(+), 31 deletions(-) diff --git a/.azure-pipelines/windows-release.yml b/.azure-pipelines/windows-release.yml index 338c305ecdc0a1..c038ccdb8675a3 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 307510a40dd4e5..1671d98d5cca76 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@1 + displayName: 'Download artifact: bin_arm64' + condition: and(succeeded(), eq(variables['PublishARM64'], 'true')) + inputs: + artifactName: bin_arm64 + targetPath: $(Build.BinariesDirectory)\arm64 + + - task: DownloadPipelineArtifact@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@1 displayName: 'Download artifact: tcltk_lib_win32' inputs: @@ -84,7 +98,6 @@ 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 @@ -97,7 +110,6 @@ 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 @@ -108,8 +120,20 @@ steps: 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 + PYTHONHOME: $(Build.SourcesDirectory) + BuildForRelease: true + SuppressMinGWLib: true + - task: CopyFiles@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 +143,7 @@ steps: *.exe - task: CopyFiles@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 +152,17 @@ steps: *.cab *.exe + - task: CopyFiles@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@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 38f6772afcde3f..a8855f0ace8f59 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@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 ef95572f7d165f..be4ef9e0cca891 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/Tools/msi/buildrelease.bat b/Tools/msi/buildrelease.bat index faee96bf25541c..3028a2fe758c2e 100644 --- a/Tools/msi/buildrelease.bat +++ b/Tools/msi/buildrelease.bat @@ -195,8 +195,6 @@ 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 ( diff --git a/Tools/msi/get_externals.bat b/Tools/msi/get_externals.bat index d66781d7c42ec4..f6602ce9588ff4 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/purge.py b/Tools/msi/purge.py index 41be06939ab4ce..de9fdc95202af7 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/wix.props b/Tools/msi/wix.props index 7269d34c030cad..d8ced317d0ce81 100644 --- a/Tools/msi/wix.props +++ b/Tools/msi/wix.props @@ -4,7 +4,7 @@ $(MSBuildThisFileDirectory)\Wix\ - $(ExternalsDir)\windows-installer\wix\ + $(ExternalsDir)\windows-installer\wix-314\ $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Installer XML\3.10@InstallRoot) $(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows Installer XML\3.10@InstallRoot) $(WixInstallPath)\Wix.targets From 9e305575e5d0ec47ccdf1383259ed4c8ba981db8 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Tue, 25 Jan 2022 13:29:00 +0000 Subject: [PATCH 03/12] Remove old dlltool search --- Tools/msi/buildrelease.bat | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Tools/msi/buildrelease.bat b/Tools/msi/buildrelease.bat index 3028a2fe758c2e..722298ff6137a4 100644 --- a/Tools/msi/buildrelease.bat +++ b/Tools/msi/buildrelease.bat @@ -85,14 +85,6 @@ call "%D%..\..\doc\make.bat" htmlhelp if errorlevel 1 goto :eof :skipdoc -rem where dlltool /q && goto skipdlltoolsearch -rem set _DLLTOOL_PATH= -rem where /R "%EXTERNALS%\" dlltool > "%TEMP%\dlltool.loc" 2> nul && set /P _DLLTOOL_PATH= < "%TEMP%\dlltool.loc" & del "%TEMP%\dlltool.loc" -rem if not exist "%_DLLTOOL_PATH%" echo Cannot find binutils on PATH or in external && exit /B 1 -rem for %%f in (%_DLLTOOL_PATH%) do set PATH=%PATH%;%%~dpf -rem set _DLLTOOL_PATH= -:skipdlltoolsearch - if defined BUILDX86 ( call :build x86 if errorlevel 1 exit /B From f6d7026504676097479dfd7c0c712e9f42be482a Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Tue, 25 Jan 2022 14:47:12 +0000 Subject: [PATCH 04/12] Update build.bat and property detect ProgramFilesArmFolder --- Tools/msi/build.bat | 23 ++++++++++--- .../PythonBootstrapperApplication.cpp | 34 +++++++++++++++++++ Tools/msi/bundle/bundle.wxs | 6 ++-- 3 files changed, 56 insertions(+), 7 deletions(-) diff --git a/Tools/msi/build.bat b/Tools/msi/build.bat index 532cebc5b51184..755c8876cf99c5 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/bundle/bootstrap/PythonBootstrapperApplication.cpp b/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp index fdc2a21d83d5f3..c17b33c1f06ca3 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)]; + 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/bundle.wxs b/Tools/msi/bundle/bundle.wxs index 69e858a064008f..195edbda328c7b 100644 --- a/Tools/msi/bundle/bundle.wxs +++ b/Tools/msi/bundle/bundle.wxs @@ -26,6 +26,9 @@ + + + @@ -37,8 +40,7 @@ - - + From 47bd6c549c9a237f86e5e689382f5820c8edca04 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Tue, 25 Jan 2022 14:48:45 +0000 Subject: [PATCH 05/12] Add NEWS --- .../next/Windows/2022-01-25-14-48-39.bpo-33125.5WyY_J.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Windows/2022-01-25-14-48-39.bpo-33125.5WyY_J.rst 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 00000000000000..54811db67add85 --- /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 From dcbbe0306af46afb4a819bdec4c9c63bbbcdcb57 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Tue, 25 Jan 2022 14:49:30 +0000 Subject: [PATCH 06/12] Enable ARM64 installer test run --- .github/workflows/build_msi.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/build_msi.yml b/.github/workflows/build_msi.yml index 476a0b1bc07385..6e989b2ab98861 100644 --- a/.github/workflows/build_msi.yml +++ b/.github/workflows/build_msi.yml @@ -37,3 +37,11 @@ jobs: - uses: actions/checkout@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@v2 + - name: Build CPython installer + run: .\Tools\msi\build.bat -arm64 From 5b2534cfcb3eb96d878f66b1d3162407fc2613b7 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Tue, 25 Jan 2022 15:20:37 +0000 Subject: [PATCH 07/12] Do not quote PythonForBuild --- Tools/msi/msi.props | 2 +- Tools/msi/msi.targets | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Tools/msi/msi.props b/Tools/msi/msi.props index 0093c42ada0450..b5fd3d3a3da74b 100644 --- a/Tools/msi/msi.props +++ b/Tools/msi/msi.props @@ -178,7 +178,7 @@ <_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(`"`,`'`))])) - diff --git a/Tools/msi/msi.targets b/Tools/msi/msi.targets index 2640953e27ee70..99d1de4d9d83f5 100644 --- a/Tools/msi/msi.targets +++ b/Tools/msi/msi.targets @@ -20,7 +20,7 @@ - From 3f30fc9f5191be437b84d1116675b1dfe365f075 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Tue, 25 Jan 2022 15:39:05 +0000 Subject: [PATCH 08/12] Properly override build-time Python --- .azure-pipelines/windows-release/msi-steps.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.azure-pipelines/windows-release/msi-steps.yml b/.azure-pipelines/windows-release/msi-steps.yml index 1671d98d5cca76..ef98d56c78363c 100644 --- a/.azure-pipelines/windows-release/msi-steps.yml +++ b/.azure-pipelines/windows-release/msi-steps.yml @@ -103,6 +103,7 @@ steps: 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 @@ -115,6 +116,7 @@ steps: 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 @@ -128,6 +130,7 @@ steps: 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 From 117629976576d80dd4fd6f07f0ca742b8637da5b Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Tue, 25 Jan 2022 16:12:35 +0000 Subject: [PATCH 09/12] Test non-webinstall MSI --- .azure-pipelines/windows-release/stage-test-msi.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.azure-pipelines/windows-release/stage-test-msi.yml b/.azure-pipelines/windows-release/stage-test-msi.yml index 4b02f478ce0a14..a471d05bc6a4a2 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 From a4212b19b113f99e9c6931a47eb39689bdaab93a Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Wed, 26 Jan 2022 14:44:35 +0000 Subject: [PATCH 10/12] Fix path and disable launcher --- .../PythonBootstrapperApplication.cpp | 2 +- Tools/msi/bundle/bundle.wxs | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp b/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp index c17b33c1f06ca3..226416f3545850 100644 --- a/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp +++ b/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp @@ -2206,7 +2206,7 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication { return S_OK; } if (buffer[0]) { - wchar_t *p = &buffer[bufferLen / sizeof(wchar_t)]; + wchar_t *p = &buffer[bufferLen / sizeof(wchar_t) - 1]; while (*p == L'\\' || *p == L'\0') { p -= 1; } *++p = L'\\'; *++p = L'\0'; diff --git a/Tools/msi/bundle/bundle.wxs b/Tools/msi/bundle/bundle.wxs index 195edbda328c7b..907a188edb143c 100644 --- a/Tools/msi/bundle/bundle.wxs +++ b/Tools/msi/bundle/bundle.wxs @@ -49,7 +49,7 @@ - + $(DownloadUrlBase.TrimEnd(`/`))/{version}/{arch}{releasename}/{msi} $(DefineConstants);DownloadUrl=$(DownloadUrl.Replace(`{version}`, `$(MajorVersionNumber).$(MinorVersionNumber).$(MicroVersionNumber)`).Replace(`{arch}`, `$(ArchName)`).Replace(`{releasename}`, `$(ReleaseLevelName)`).Replace(`{msi}`, `{2}`)) $(DefineConstants);DownloadUrl={2} - + WixUtilExtension @@ -43,7 +43,6 @@ - @@ -55,7 +54,7 @@ - + BuildForRelease=$(BuildForRelease) @@ -75,35 +74,56 @@ - + Build - + Rebuild - + - + - + + Properties="Configuration=$(BootstrapConfiguration);Platform=Win32;BuildForPlatform=$(Platform)"> - + $(DefineConstants);BootstrapApp=$(BootstrapAppPath) - + + + + + + + $(DefineConstants);DefaultWxl=Default.wxl + + + + + + + + + $(DefineConstants);DefaultWxl=$(IntermediateOutputPath)Default.wxl + + + diff --git a/Tools/msi/bundle/bundle.wxs b/Tools/msi/bundle/bundle.wxs index 907a188edb143c..09ce4ae147b324 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)"> - + From 5285a4fa5367c49edff858f52a8bac7defec1762 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Thu, 27 Jan 2022 17:28:05 +0000 Subject: [PATCH 12/12] Fixes build --- .../msi/bundle/bootstrap/PythonBootstrapperApplication.cpp | 7 ------- Tools/msi/bundle/bundle.targets | 4 ++-- Tools/msi/bundle/bundle.wxs | 4 +++- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp b/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp index bf0737a4f7b1e0..226416f3545850 100644 --- a/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp +++ b/Tools/msi/bundle/bootstrap/PythonBootstrapperApplication.cpp @@ -89,7 +89,6 @@ enum CONTROL_ID { ID_TARGETDIR_EDITBOX, ID_CUSTOM_ASSOCIATE_FILES_CHECKBOX, ID_CUSTOM_INSTALL_ALL_USERS_CHECKBOX, - ID_CUSTOM_INCLUDE_TCLTK_HELP_LABEL, ID_CUSTOM_INSTALL_LAUNCHER_ALL_USERS_CHECKBOX, ID_CUSTOM_INCLUDE_LAUNCHER_HELP_LABEL, ID_CUSTOM_COMPILE_ALL_CHECKBOX, @@ -157,7 +156,6 @@ static THEME_ASSIGN_CONTROL_ID CONTROL_ID_NAMES[] = { { ID_CUSTOM_INSTALL_ALL_USERS_CHECKBOX, L"InstallAllUsers" }, { ID_CUSTOM_INSTALL_LAUNCHER_ALL_USERS_CHECKBOX, L"CustomInstallLauncherAllUsers" }, { ID_CUSTOM_INCLUDE_LAUNCHER_HELP_LABEL, L"Include_launcherHelp" }, - { ID_CUSTOM_INCLUDE_TCLTK_HELP_LABEL, L"Include_tcltkHelpLabel" }, { ID_CUSTOM_COMPILE_ALL_CHECKBOX, L"CompileAll" }, { ID_CUSTOM_BROWSE_BUTTON, L"CustomBrowseButton" }, { ID_CUSTOM_BROWSE_BUTTON_LABEL, L"CustomBrowseButtonLabel" }, @@ -444,11 +442,6 @@ class PythonBootstrapperApplication : public CBalBaseBootstrapperApplication { ThemeControlElevates(_theme, ID_INSTALL_BUTTON, elevated); ThemeControlElevates(_theme, ID_INSTALL_SIMPLE_BUTTON, elevated); ThemeControlElevates(_theme, ID_INSTALL_UPGRADE_BUTTON, elevated); - -#ifdef ARM64 - // Currently we do not support the launcher on ARM64, so hide its checkbox - ThemeShowControl(_theme, ID_INSTALL_LAUNCHER_ALL_USERS_CHECKBOX, SW_HIDE); -#endif } void Custom1Page_Show() { diff --git a/Tools/msi/bundle/bundle.targets b/Tools/msi/bundle/bundle.targets index 23826ff148ac09..4f4306f7b61f01 100644 --- a/Tools/msi/bundle/bundle.targets +++ b/Tools/msi/bundle/bundle.targets @@ -104,7 +104,7 @@ - + @@ -112,7 +112,7 @@ $(DefineConstants);DefaultWxl=Default.wxl - + - + + +