summaryrefslogtreecommitdiffstats
path: root/Tools/msi
diff options
context:
space:
mode:
authorZachary Ware <zachary.ware@gmail.com>2015-04-13 17:11:40 (GMT)
committerZachary Ware <zachary.ware@gmail.com>2015-04-13 17:11:40 (GMT)
commit774ac377daf0da8eaddc578d883cd2002cb7a6a4 (patch)
tree1f7931b0ce49dd62621846ba61ccf3f4280386bb /Tools/msi
parent9c680b07285867844927871ddcbf60c93e786e1f (diff)
parent4c9c848159b63fac440c29ffc2b437e055d355cc (diff)
downloadcpython-774ac377daf0da8eaddc578d883cd2002cb7a6a4.zip
cpython-774ac377daf0da8eaddc578d883cd2002cb7a6a4.tar.gz
cpython-774ac377daf0da8eaddc578d883cd2002cb7a6a4.tar.bz2
Closes #17202: Merge with 3.4
Diffstat (limited to 'Tools/msi')
-rw-r--r--Tools/msi/build.bat92
-rw-r--r--Tools/msi/buildrelease.bat326
-rw-r--r--Tools/msi/testrelease.bat228
-rw-r--r--Tools/msi/uploadrelease.bat112
4 files changed, 379 insertions, 379 deletions
diff --git a/Tools/msi/build.bat b/Tools/msi/build.bat
index efee66b..4dfa5fb 100644
--- a/Tools/msi/build.bat
+++ b/Tools/msi/build.bat
@@ -1,46 +1,46 @@
-@echo off
-setlocal
-set D=%~dp0
-set PCBUILD=%D%..\..\PCBuild\
-
-set BUILDX86=
-set BUILDX64=
-set BUILDDOC=
-
-:CheckOpts
-if '%1'=='-x86' (set BUILDX86=1) && shift && goto CheckOpts
-if '%1'=='-x64' (set BUILDX64=1) && shift && goto CheckOpts
-if '%1'=='--doc' (set BUILDDOC=1) && shift && goto CheckOpts
-
-if not defined BUILDX86 if not defined BUILDX64 (set BUILDX86=1) && (set BUILDX64=1)
-
-call "%PCBUILD%env.bat" x86
-
-if defined BUILDX86 (
- call "%PCBUILD%build.bat" -d
- if errorlevel 1 goto :eof
- call "%PCBUILD%build.bat"
- if errorlevel 1 goto :eof
-)
-if defined BUILDX64 (
- call "%PCBUILD%build.bat" -p x64 -d
- if errorlevel 1 goto :eof
- call "%PCBUILD%build.bat" -p x64
- if errorlevel 1 goto :eof
-)
-
-if defined BUILDDOC (
- call "%PCBUILD%..\Doc\make.bat" htmlhelp
- if errorlevel 1 goto :eof
-)
-
-if defined BUILDX86 (
- "%PCBUILD%win32\python.exe" "%D%get_wix.py"
- msbuild "%D%bundle\snapshot.wixproj"
- if errorlevel 1 goto :eof
-)
-if defined BUILDX64 (
- "%PCBUILD%amd64\python.exe" "%D%get_wix.py"
- msbuild "%D%bundle\snapshot.wixproj" /p:Platform=x64
- if errorlevel 1 goto :eof
-)
+@echo off
+setlocal
+set D=%~dp0
+set PCBUILD=%D%..\..\PCBuild\
+
+set BUILDX86=
+set BUILDX64=
+set BUILDDOC=
+
+:CheckOpts
+if '%1'=='-x86' (set BUILDX86=1) && shift && goto CheckOpts
+if '%1'=='-x64' (set BUILDX64=1) && shift && goto CheckOpts
+if '%1'=='--doc' (set BUILDDOC=1) && shift && goto CheckOpts
+
+if not defined BUILDX86 if not defined BUILDX64 (set BUILDX86=1) && (set BUILDX64=1)
+
+call "%PCBUILD%env.bat" x86
+
+if defined BUILDX86 (
+ call "%PCBUILD%build.bat" -d
+ if errorlevel 1 goto :eof
+ call "%PCBUILD%build.bat"
+ if errorlevel 1 goto :eof
+)
+if defined BUILDX64 (
+ call "%PCBUILD%build.bat" -p x64 -d
+ if errorlevel 1 goto :eof
+ call "%PCBUILD%build.bat" -p x64
+ if errorlevel 1 goto :eof
+)
+
+if defined BUILDDOC (
+ call "%PCBUILD%..\Doc\make.bat" htmlhelp
+ if errorlevel 1 goto :eof
+)
+
+if defined BUILDX86 (
+ "%PCBUILD%win32\python.exe" "%D%get_wix.py"
+ msbuild "%D%bundle\snapshot.wixproj"
+ if errorlevel 1 goto :eof
+)
+if defined BUILDX64 (
+ "%PCBUILD%amd64\python.exe" "%D%get_wix.py"
+ msbuild "%D%bundle\snapshot.wixproj" /p:Platform=x64
+ if errorlevel 1 goto :eof
+)
diff --git a/Tools/msi/buildrelease.bat b/Tools/msi/buildrelease.bat
index 09c63a6..25f4508 100644
--- a/Tools/msi/buildrelease.bat
+++ b/Tools/msi/buildrelease.bat
@@ -1,164 +1,164 @@
-@setlocal
-@echo off
-
-rem This script is intended for building official releases of Python.
-rem To use it to build alternative releases, you should clone this file
-rem and modify the following three URIs.
-rem
-rem The first two will ensure that your release can be installed
-rem alongside an official Python release, while the second specifies
-rem the URL that will be used to download installation files. The
-rem files available from this URL *will* conflict with your installer.
-rem Trust me, you don't want them, even if it seems like a good idea.
-
-set RELEASE_URI_X86=http://www.python.org/win32
-set RELEASE_URI_X64=http://www.python.org/amd64
-set DOWNLOAD_URL_BASE=https://www.python.org/ftp/python
-set DOWNLOAD_URL=
-
-set D=%~dp0
-set PCBUILD=%D%..\..\PCBuild\
-
-set BUILDX86=
-set BUILDX64=
-set TARGET=Rebuild
-set TESTTARGETDIR=
-
-
-:CheckOpts
-if "%1" EQU "-h" goto Help
-if "%1" EQU "-c" (set CERTNAME=%~2) && shift && shift && goto CheckOpts
-if "%1" EQU "--certificate" (set CERTNAME=%~2) && shift && shift && goto CheckOpts
-if "%1" EQU "-o" (set OUTDIR=%~2) && shift && shift && goto CheckOpts
-if "%1" EQU "--out" (set OUTDIR=%~2) && shift && shift && goto CheckOpts
-if "%1" EQU "-D" (set SKIPDOC=1) && shift && goto CheckOpts
-if "%1" EQU "--skip-doc" (set SKIPDOC=1) && shift && goto CheckOpts
-if "%1" EQU "-B" (set SKIPBUILD=1) && shift && goto CheckOpts
-if "%1" EQU "--skip-build" (set SKIPBUILD=1) && shift && goto CheckOpts
-if "%1" EQU "--download" (set DOWNLOAD_URL=%~2) && shift && shift && goto CheckOpts
-if "%1" EQU "--test" (set TESTTARGETDIR=%~2) && shift && shift && goto CheckOpts
-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 not defined BUILDX86 if not defined BUILDX64 (set BUILDX86=1) && (set BUILDX64=1)
-
-:builddoc
-if "%SKIPBUILD%" EQU "1" goto skipdoc
-if "%SKIPDOC%" EQU "1" goto skipdoc
-
-if not defined PYTHON where py -q || echo Cannot find py on path and PYTHON is not set. && exit /B 1
-if not defined SPHINXBUILD where sphinx-build -q || echo Cannot find sphinx-build on path and SPHINXBUILD is not set. && exit /B 1
-call "%D%..\..\doc\make.bat" htmlhelp
-if errorlevel 1 goto :eof
-:skipdoc
-
-where hg /q || echo Cannot find Mercurial on PATH && exit /B 1
-
-where dlltool /q && goto skipdlltoolsearch
-set _DLLTOOL_PATH=
-where /R "%D%..\..\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
-)
-
-if defined BUILDX64 (
- call :build x64
- if errorlevel 1 exit /B
-)
-
-if defined TESTTARGETDIR (
- call "%D%testrelease.bat" -t "%TESTTARGETDIR%"
-)
-
-exit /B 0
-
-:build
-@setlocal
-@echo off
-
-if "%1" EQU "x86" (
- call "%PCBUILD%env.bat" x86
- set BUILD=%PCBUILD%win32\
- set BUILD_PLAT=Win32
- set OUTDIR_PLAT=win32
- set OBJDIR_PLAT=x86
- set RELEASE_URI=%RELEASE_URI_X86%
-) ELSE (
- call "%PCBUILD%env.bat" x86_amd64
- set BUILD=%PCBUILD%amd64\
- set BUILD_PLAT=x64
- set OUTDIR_PLAT=amd64
- set OBJDIR_PLAT=x64
- set RELEASE_URI=%RELEASE_URI_X64%
-)
-
-if exist "%BUILD%en-us" (
- echo Deleting %BUILD%en-us
- rmdir /q/s "%BUILD%en-us"
- if errorlevel 1 exit /B
-)
-
-if exist "%D%obj\Release_%OBJDIR_PLAT%" (
- echo Deleting "%D%obj\Release_%OBJDIR_PLAT%"
- rmdir /q/s "%D%obj\Release_%OBJDIR_PLAT%"
- if errorlevel 1 exit /B
-)
-
-if not "%CERTNAME%" EQU "" (
- set CERTOPTS="/p:SigningCertificate=%CERTNAME%"
-) else (
- set CERTOPTS=
-)
-
-if not "%SKIPBUILD%" EQU "1" (
- call "%PCBUILD%build.bat" -e -p %BUILD_PLAT% -d -t %TARGET% %CERTOPTS%
- if errorlevel 1 exit /B
- call "%PCBUILD%build.bat" -p %BUILD_PLAT% -t %TARGET% %CERTOPTS%
- if errorlevel 1 exit /B
- @rem build.bat turns echo back on, so we disable it again
- @echo off
-)
-
-"%BUILD%python.exe" "%D%get_wix.py"
-
-set BUILDOPTS=/p:Platform=%1 /p:BuildForRelease=true /p:DownloadUrl=%DOWNLOAD_URL% /p:DownloadUrlBase=%DOWNLOAD_URL_BASE% /p:ReleaseUri=%RELEASE_URI%
-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 not "%OUTDIR%" EQU "" (
- mkdir "%OUTDIR%\%OUTDIR_PLAT%"
- copy /Y "%BUILD%en-us\*.cab" "%OUTDIR%\%OUTDIR_PLAT%"
- copy /Y "%BUILD%en-us\*.exe" "%OUTDIR%\%OUTDIR_PLAT%"
- copy /Y "%BUILD%en-us\*.msi" "%OUTDIR%\%OUTDIR_PLAT%"
- copy /Y "%BUILD%en-us\*.msu" "%OUTDIR%\%OUTDIR_PLAT%"
-)
-
-exit /B 0
-
-:Help
-echo buildrelease.bat [--out DIR] [-x86] [-x64] [--certificate CERTNAME] [--build] [--skip-build]
-echo [--skip-doc] [--download DOWNLOAD URL] [--test TARGETDIR] [-h]
-echo.
-echo --out (-o) Specify an additional output directory for installers
-echo -x86 Build x86 installers
-echo -x64 Build x64 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
-echo --download Specify the full download URL for MSIs (should include {2})
-echo --test Specify the test directory to run the installer tests
-echo -h Display this help information
-echo.
-echo If no architecture is specified, all architectures will be built.
-echo If --test is not specified, the installer tests are not run.
+@setlocal
+@echo off
+
+rem This script is intended for building official releases of Python.
+rem To use it to build alternative releases, you should clone this file
+rem and modify the following three URIs.
+rem
+rem The first two will ensure that your release can be installed
+rem alongside an official Python release, while the second specifies
+rem the URL that will be used to download installation files. The
+rem files available from this URL *will* conflict with your installer.
+rem Trust me, you don't want them, even if it seems like a good idea.
+
+set RELEASE_URI_X86=http://www.python.org/win32
+set RELEASE_URI_X64=http://www.python.org/amd64
+set DOWNLOAD_URL_BASE=https://www.python.org/ftp/python
+set DOWNLOAD_URL=
+
+set D=%~dp0
+set PCBUILD=%D%..\..\PCBuild\
+
+set BUILDX86=
+set BUILDX64=
+set TARGET=Rebuild
+set TESTTARGETDIR=
+
+
+:CheckOpts
+if "%1" EQU "-h" goto Help
+if "%1" EQU "-c" (set CERTNAME=%~2) && shift && shift && goto CheckOpts
+if "%1" EQU "--certificate" (set CERTNAME=%~2) && shift && shift && goto CheckOpts
+if "%1" EQU "-o" (set OUTDIR=%~2) && shift && shift && goto CheckOpts
+if "%1" EQU "--out" (set OUTDIR=%~2) && shift && shift && goto CheckOpts
+if "%1" EQU "-D" (set SKIPDOC=1) && shift && goto CheckOpts
+if "%1" EQU "--skip-doc" (set SKIPDOC=1) && shift && goto CheckOpts
+if "%1" EQU "-B" (set SKIPBUILD=1) && shift && goto CheckOpts
+if "%1" EQU "--skip-build" (set SKIPBUILD=1) && shift && goto CheckOpts
+if "%1" EQU "--download" (set DOWNLOAD_URL=%~2) && shift && shift && goto CheckOpts
+if "%1" EQU "--test" (set TESTTARGETDIR=%~2) && shift && shift && goto CheckOpts
+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 not defined BUILDX86 if not defined BUILDX64 (set BUILDX86=1) && (set BUILDX64=1)
+
+:builddoc
+if "%SKIPBUILD%" EQU "1" goto skipdoc
+if "%SKIPDOC%" EQU "1" goto skipdoc
+
+if not defined PYTHON where py -q || echo Cannot find py on path and PYTHON is not set. && exit /B 1
+if not defined SPHINXBUILD where sphinx-build -q || echo Cannot find sphinx-build on path and SPHINXBUILD is not set. && exit /B 1
+call "%D%..\..\doc\make.bat" htmlhelp
+if errorlevel 1 goto :eof
+:skipdoc
+
+where hg /q || echo Cannot find Mercurial on PATH && exit /B 1
+
+where dlltool /q && goto skipdlltoolsearch
+set _DLLTOOL_PATH=
+where /R "%D%..\..\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
+)
+
+if defined BUILDX64 (
+ call :build x64
+ if errorlevel 1 exit /B
+)
+
+if defined TESTTARGETDIR (
+ call "%D%testrelease.bat" -t "%TESTTARGETDIR%"
+)
+
+exit /B 0
+
+:build
+@setlocal
+@echo off
+
+if "%1" EQU "x86" (
+ call "%PCBUILD%env.bat" x86
+ set BUILD=%PCBUILD%win32\
+ set BUILD_PLAT=Win32
+ set OUTDIR_PLAT=win32
+ set OBJDIR_PLAT=x86
+ set RELEASE_URI=%RELEASE_URI_X86%
+) ELSE (
+ call "%PCBUILD%env.bat" x86_amd64
+ set BUILD=%PCBUILD%amd64\
+ set BUILD_PLAT=x64
+ set OUTDIR_PLAT=amd64
+ set OBJDIR_PLAT=x64
+ set RELEASE_URI=%RELEASE_URI_X64%
+)
+
+if exist "%BUILD%en-us" (
+ echo Deleting %BUILD%en-us
+ rmdir /q/s "%BUILD%en-us"
+ if errorlevel 1 exit /B
+)
+
+if exist "%D%obj\Release_%OBJDIR_PLAT%" (
+ echo Deleting "%D%obj\Release_%OBJDIR_PLAT%"
+ rmdir /q/s "%D%obj\Release_%OBJDIR_PLAT%"
+ if errorlevel 1 exit /B
+)
+
+if not "%CERTNAME%" EQU "" (
+ set CERTOPTS="/p:SigningCertificate=%CERTNAME%"
+) else (
+ set CERTOPTS=
+)
+
+if not "%SKIPBUILD%" EQU "1" (
+ call "%PCBUILD%build.bat" -e -p %BUILD_PLAT% -d -t %TARGET% %CERTOPTS%
+ if errorlevel 1 exit /B
+ call "%PCBUILD%build.bat" -p %BUILD_PLAT% -t %TARGET% %CERTOPTS%
+ if errorlevel 1 exit /B
+ @rem build.bat turns echo back on, so we disable it again
+ @echo off
+)
+
+"%BUILD%python.exe" "%D%get_wix.py"
+
+set BUILDOPTS=/p:Platform=%1 /p:BuildForRelease=true /p:DownloadUrl=%DOWNLOAD_URL% /p:DownloadUrlBase=%DOWNLOAD_URL_BASE% /p:ReleaseUri=%RELEASE_URI%
+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 not "%OUTDIR%" EQU "" (
+ mkdir "%OUTDIR%\%OUTDIR_PLAT%"
+ copy /Y "%BUILD%en-us\*.cab" "%OUTDIR%\%OUTDIR_PLAT%"
+ copy /Y "%BUILD%en-us\*.exe" "%OUTDIR%\%OUTDIR_PLAT%"
+ copy /Y "%BUILD%en-us\*.msi" "%OUTDIR%\%OUTDIR_PLAT%"
+ copy /Y "%BUILD%en-us\*.msu" "%OUTDIR%\%OUTDIR_PLAT%"
+)
+
+exit /B 0
+
+:Help
+echo buildrelease.bat [--out DIR] [-x86] [-x64] [--certificate CERTNAME] [--build] [--skip-build]
+echo [--skip-doc] [--download DOWNLOAD URL] [--test TARGETDIR] [-h]
+echo.
+echo --out (-o) Specify an additional output directory for installers
+echo -x86 Build x86 installers
+echo -x64 Build x64 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
+echo --download Specify the full download URL for MSIs (should include {2})
+echo --test Specify the test directory to run the installer tests
+echo -h Display this help information
+echo.
+echo If no architecture is specified, all architectures will be built.
+echo If --test is not specified, the installer tests are not run.
echo. \ No newline at end of file
diff --git a/Tools/msi/testrelease.bat b/Tools/msi/testrelease.bat
index aee5e2f..b93306a 100644
--- a/Tools/msi/testrelease.bat
+++ b/Tools/msi/testrelease.bat
@@ -1,114 +1,114 @@
-@setlocal
-@echo off
-
-set D=%~dp0
-set PCBUILD=%D%..\..\PCBuild\
-
-set TARGETDIR=%TEMP%
-set TESTX86=
-set TESTX64=
-set TESTALLUSER=
-set TESTPERUSER=
-
-:CheckOpts
-if "%1" EQU "-h" goto Help
-if "%1" EQU "-x86" (set TESTX86=1) && shift && goto CheckOpts
-if "%1" EQU "-x64" (set TESTX64=1) && shift && goto CheckOpts
-if "%1" EQU "-t" (set TARGETDIR=%~2) && shift && shift && goto CheckOpts
-if "%1" EQU "--target" (set TARGETDIR=%~2) && shift && shift && goto CheckOpts
-if "%1" EQU "-a" (set TESTALLUSER=1) && shift && goto CheckOpts
-if "%1" EQU "--alluser" (set TESTALLUSER=1) && shift && goto CheckOpts
-if "%1" EQU "-p" (set TESTPERUSER=1) && shift && goto CheckOpts
-if "%1" EQU "--peruser" (set TESTPERUSER=1) && shift && goto CheckOpts
-
-if not defined TESTX86 if not defined TESTX64 (set TESTX86=1) && (set TESTX64=1)
-if not defined TESTALLUSER if not defined TESTPERUSER (set TESTALLUSER=1) && (set TESTPERUSER=1)
-
-
-if defined TESTX86 (
- for %%f in ("%PCBUILD%win32\en-us\*.exe") do (
- if defined TESTALLUSER call :test "%%~ff" "%TARGETDIR%\%%~nf-alluser" "InstallAllUsers=1 CompileAll=1"
- if errorlevel 1 exit /B
- if defined TESTPERUSER call :test "%%~ff" "%TARGETDIR%\%%~nf-peruser" "InstallAllUsers=0 CompileAll=0"
- if errorlevel 1 exit /B
- )
-)
-
-if defined TESTX64 (
- for %%f in ("%PCBUILD%amd64\en-us\*.exe") do (
- if defined TESTALLUSER call :test "%%~ff" "%TARGETDIR%\%%~nf-alluser" "InstallAllUsers=1 CompileAll=1"
- if errorlevel 1 exit /B
- if defined TESTPERUSER call :test "%%~ff" "%TARGETDIR%\%%~nf-peruser" "InstallAllUsers=0 CompileAll=0"
- if errorlevel 1 exit /B
- )
-)
-
-exit /B 0
-
-:test
-@setlocal
-@echo on
-
-@if not exist "%~1" exit /B 1
-
-@set EXITCODE=0
-@echo Installing %1 into %2
-"%~1" /passive /log "%~2\install\log.txt" TargetDir="%~2\Python" Include_debug=1 Include_symbols=1 %~3
-
-@if not errorlevel 1 (
- @echo Printing version
- "%~2\Python\python.exe" -c "import sys; print(sys.version)" > "%~2\version.txt" 2>&1
-)
-
-@if not errorlevel 1 (
- @echo Capturing Start Menu
- @dir /s/b "%PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs" | findstr /ic:"python" > "%~2\startmenu.txt" 2>&1
- @dir /s/b "%APPDATA%\Microsoft\Windows\Start Menu\Programs" | findstr /ic:"python" >> "%~2\startmenu.txt" 2>&1
-
- @echo Capturing registry
- @for /F "usebackq" %%f in (`reg query HKCR /s /f python /k`) do @(
- echo %%f >> "%~2\hkcr.txt"
- reg query "%%f" /s >> "%~2\hkcr.txt" 2>&1
- )
- @reg query HKCU\Software\Python /s > "%~2\hkcu.txt" 2>&1
- @reg query HKLM\Software\Python /reg:32 /s > "%~2\hklm.txt" 2>&1
- @reg query HKLM\Software\Python /reg:64 /s >> "%~2\hklm.txt" 2>&1
- cmd /k exit 0
-)
-
-@if not errorlevel 1 (
- @echo Installing package
- "%~2\Python\python.exe" -m pip install "azure<0.10" > "%~2\pip.txt" 2>&1
- @if not errorlevel 1 (
- "%~2\Python\python.exe" -m pip uninstall -y azure python-dateutil six >> "%~2\pip.txt" 2>&1
- )
-)
-@if not errorlevel 1 (
- @echo Testing Tcl/tk
- @set TCL_LIBRARY=%~2\Python\tcl\tcl8.6
- "%~2\Python\python.exe" -m test -uall -v test_ttk_guionly test_tk test_idle > "%~2\tcltk.txt" 2>&1
- @set TCL_LIBRARY=
-)
-
-@set EXITCODE=%ERRORLEVEL%
-
-@echo Result was %EXITCODE%
-@echo Removing %1
-"%~1" /passive /uninstall /log "%~2\uninstall\log.txt"
-
-@echo off
-exit /B %EXITCODE%
-
-:Help
-echo testrelease.bat [--target TARGET] [-x86] [-x64] [--alluser] [--peruser] [-h]
-echo.
-echo --target (-t) Specify the target directory for installs and logs
-echo -x86 Run tests for x86 installers
-echo -x64 Run tests for x64 installers
-echo --alluser (-a) Run tests for all-user installs (requires Administrator)
-echo --peruser (-p) Run tests for per-user installs
-echo -h Display this help information
-echo.
-echo If no test architecture is specified, all architectures will be tested.
-echo If no install type is selected, all install types will be tested.
-echo.
+@setlocal
+@echo off
+
+set D=%~dp0
+set PCBUILD=%D%..\..\PCBuild\
+
+set TARGETDIR=%TEMP%
+set TESTX86=
+set TESTX64=
+set TESTALLUSER=
+set TESTPERUSER=
+
+:CheckOpts
+if "%1" EQU "-h" goto Help
+if "%1" EQU "-x86" (set TESTX86=1) && shift && goto CheckOpts
+if "%1" EQU "-x64" (set TESTX64=1) && shift && goto CheckOpts
+if "%1" EQU "-t" (set TARGETDIR=%~2) && shift && shift && goto CheckOpts
+if "%1" EQU "--target" (set TARGETDIR=%~2) && shift && shift && goto CheckOpts
+if "%1" EQU "-a" (set TESTALLUSER=1) && shift && goto CheckOpts
+if "%1" EQU "--alluser" (set TESTALLUSER=1) && shift && goto CheckOpts
+if "%1" EQU "-p" (set TESTPERUSER=1) && shift && goto CheckOpts
+if "%1" EQU "--peruser" (set TESTPERUSER=1) && shift && goto CheckOpts
+
+if not defined TESTX86 if not defined TESTX64 (set TESTX86=1) && (set TESTX64=1)
+if not defined TESTALLUSER if not defined TESTPERUSER (set TESTALLUSER=1) && (set TESTPERUSER=1)
+
+
+if defined TESTX86 (
+ for %%f in ("%PCBUILD%win32\en-us\*.exe") do (
+ if defined TESTALLUSER call :test "%%~ff" "%TARGETDIR%\%%~nf-alluser" "InstallAllUsers=1 CompileAll=1"
+ if errorlevel 1 exit /B
+ if defined TESTPERUSER call :test "%%~ff" "%TARGETDIR%\%%~nf-peruser" "InstallAllUsers=0 CompileAll=0"
+ if errorlevel 1 exit /B
+ )
+)
+
+if defined TESTX64 (
+ for %%f in ("%PCBUILD%amd64\en-us\*.exe") do (
+ if defined TESTALLUSER call :test "%%~ff" "%TARGETDIR%\%%~nf-alluser" "InstallAllUsers=1 CompileAll=1"
+ if errorlevel 1 exit /B
+ if defined TESTPERUSER call :test "%%~ff" "%TARGETDIR%\%%~nf-peruser" "InstallAllUsers=0 CompileAll=0"
+ if errorlevel 1 exit /B
+ )
+)
+
+exit /B 0
+
+:test
+@setlocal
+@echo on
+
+@if not exist "%~1" exit /B 1
+
+@set EXITCODE=0
+@echo Installing %1 into %2
+"%~1" /passive /log "%~2\install\log.txt" TargetDir="%~2\Python" Include_debug=1 Include_symbols=1 %~3
+
+@if not errorlevel 1 (
+ @echo Printing version
+ "%~2\Python\python.exe" -c "import sys; print(sys.version)" > "%~2\version.txt" 2>&1
+)
+
+@if not errorlevel 1 (
+ @echo Capturing Start Menu
+ @dir /s/b "%PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs" | findstr /ic:"python" > "%~2\startmenu.txt" 2>&1
+ @dir /s/b "%APPDATA%\Microsoft\Windows\Start Menu\Programs" | findstr /ic:"python" >> "%~2\startmenu.txt" 2>&1
+
+ @echo Capturing registry
+ @for /F "usebackq" %%f in (`reg query HKCR /s /f python /k`) do @(
+ echo %%f >> "%~2\hkcr.txt"
+ reg query "%%f" /s >> "%~2\hkcr.txt" 2>&1
+ )
+ @reg query HKCU\Software\Python /s > "%~2\hkcu.txt" 2>&1
+ @reg query HKLM\Software\Python /reg:32 /s > "%~2\hklm.txt" 2>&1
+ @reg query HKLM\Software\Python /reg:64 /s >> "%~2\hklm.txt" 2>&1
+ cmd /k exit 0
+)
+
+@if not errorlevel 1 (
+ @echo Installing package
+ "%~2\Python\python.exe" -m pip install "azure<0.10" > "%~2\pip.txt" 2>&1
+ @if not errorlevel 1 (
+ "%~2\Python\python.exe" -m pip uninstall -y azure python-dateutil six >> "%~2\pip.txt" 2>&1
+ )
+)
+@if not errorlevel 1 (
+ @echo Testing Tcl/tk
+ @set TCL_LIBRARY=%~2\Python\tcl\tcl8.6
+ "%~2\Python\python.exe" -m test -uall -v test_ttk_guionly test_tk test_idle > "%~2\tcltk.txt" 2>&1
+ @set TCL_LIBRARY=
+)
+
+@set EXITCODE=%ERRORLEVEL%
+
+@echo Result was %EXITCODE%
+@echo Removing %1
+"%~1" /passive /uninstall /log "%~2\uninstall\log.txt"
+
+@echo off
+exit /B %EXITCODE%
+
+:Help
+echo testrelease.bat [--target TARGET] [-x86] [-x64] [--alluser] [--peruser] [-h]
+echo.
+echo --target (-t) Specify the target directory for installs and logs
+echo -x86 Run tests for x86 installers
+echo -x64 Run tests for x64 installers
+echo --alluser (-a) Run tests for all-user installs (requires Administrator)
+echo --peruser (-p) Run tests for per-user installs
+echo -h Display this help information
+echo.
+echo If no test architecture is specified, all architectures will be tested.
+echo If no install type is selected, all install types will be tested.
+echo.
diff --git a/Tools/msi/uploadrelease.bat b/Tools/msi/uploadrelease.bat
index 3709196..7967637 100644
--- a/Tools/msi/uploadrelease.bat
+++ b/Tools/msi/uploadrelease.bat
@@ -1,56 +1,56 @@
-@setlocal
-@echo off
-
-set D=%~dp0
-set PCBUILD=%D%..\..\PCBuild\
-
-set HOST=
-set USER=
-set TARGET=
-set DRYRUN=false
-
-:CheckOpts
-if "%1" EQU "-h" goto Help
-if "%1" EQU "-o" (set HOST=%~2) && shift && shift && goto CheckOpts
-if "%1" EQU "--host" (set HOST=%~2) && shift && shift && goto CheckOpts
-if "%1" EQU "-u" (set USER=%~2) && shift && shift && goto CheckOpts
-if "%1" EQU "--user" (set USER=%~2) && shift && shift && goto CheckOpts
-if "%1" EQU "-t" (set TARGET=%~2) && shift && shift && goto CheckOpts
-if "%1" EQU "--target" (set TARGET=%~2) && shift && shift && goto CheckOpts
-if "%1" EQU "--dry-run" (set DRYRUN=true) && shift && goto CheckOpts
-
-if not defined PLINK where plink > "%TEMP%\plink.loc" 2> nul && set /P PLINK= < "%TEMP%\plink.loc" & del "%TEMP%\plink.loc"
-if not defined PLINK where /R "%ProgramFiles(x86)%\PuTTY" plink > "%TEMP%\plink.loc" 2> nul && set /P PLINK= < "%TEMP%\plink.loc" & del "%TEMP%\plink.loc"
-if not defined PLINK where /R "%ProgramFiles(x86)%" plink > "%TEMP%\plink.loc" 2> nul && set /P PLINK= < "%TEMP%\plink.loc" & del "%TEMP%\plink.loc"
-if not defined PLINK echo Cannot locate plink.exe & exit /B 1
-echo Found plink.exe at %PLINK%
-
-if not defined PSCP where pscp > "%TEMP%\pscp.loc" 2> nul && set /P pscp= < "%TEMP%\pscp.loc" & del "%TEMP%\pscp.loc"
-if not defined PSCP where /R "%ProgramFiles(x86)%\PuTTY" pscp > "%TEMP%\pscp.loc" 2> nul && set /P pscp= < "%TEMP%\pscp.loc" & del "%TEMP%\pscp.loc"
-if not defined PSCP where /R "%ProgramFiles(x86)%" pscp > "%TEMP%\pscp.loc" 2> nul && set /P pscp= < "%TEMP%\pscp.loc" & del "%TEMP%\pscp.loc"
-if not defined PSCP echo Cannot locate pscp.exe & exit /B 1
-echo Found pscp.exe at %PSCP%
-
-if not defined GPG where gpg2 > "%TEMP%\gpg.loc" 2> nul && set /P GPG= < "%TEMP%\gpg.loc" & del "%TEMP%\gpg.loc"
-if not defined GPG where /R "%PCBUILD%..\externals" gpg2 > "%TEMP%\gpg.loc" 2> nul && set /P GPG= < "%TEMP%\gpg.loc" & del "%TEMP%\gpg.loc"
-if not defined GPG echo Cannot locate gpg2.exe. Signatures will not be uploaded & pause
-echo Found gpg2.exe at %GPG%
-
-call "%PCBUILD%env.bat" > nul 2> nul
-pushd "%D%"
-msbuild /v:m /nologo uploadrelease.proj /t:Upload /p:Platform=x86
-msbuild /v:m /nologo uploadrelease.proj /t:Upload /p:Platform=x64 /p:IncludeDoc=false
-msbuild /v:m /nologo uploadrelease.proj /t:ShowHashes /p:Platform=x86
-msbuild /v:m /nologo uploadrelease.proj /t:ShowHashes /p:Platform=x64 /p:IncludeDoc=false
-popd
-exit /B 0
-
-:Help
-echo uploadrelease.bat --host HOST --user USERNAME [--target TARGET] [--dry-run] [-h]
-echo.
-echo --host (-o) Specify the upload host (required)
-echo --user (-u) Specify the user on the host (required)
-echo --target (-t) Specify the target directory on the host
-echo --dry-run Display commands and filenames without executing them
-echo -h Display this help information
-echo.
+@setlocal
+@echo off
+
+set D=%~dp0
+set PCBUILD=%D%..\..\PCBuild\
+
+set HOST=
+set USER=
+set TARGET=
+set DRYRUN=false
+
+:CheckOpts
+if "%1" EQU "-h" goto Help
+if "%1" EQU "-o" (set HOST=%~2) && shift && shift && goto CheckOpts
+if "%1" EQU "--host" (set HOST=%~2) && shift && shift && goto CheckOpts
+if "%1" EQU "-u" (set USER=%~2) && shift && shift && goto CheckOpts
+if "%1" EQU "--user" (set USER=%~2) && shift && shift && goto CheckOpts
+if "%1" EQU "-t" (set TARGET=%~2) && shift && shift && goto CheckOpts
+if "%1" EQU "--target" (set TARGET=%~2) && shift && shift && goto CheckOpts
+if "%1" EQU "--dry-run" (set DRYRUN=true) && shift && goto CheckOpts
+
+if not defined PLINK where plink > "%TEMP%\plink.loc" 2> nul && set /P PLINK= < "%TEMP%\plink.loc" & del "%TEMP%\plink.loc"
+if not defined PLINK where /R "%ProgramFiles(x86)%\PuTTY" plink > "%TEMP%\plink.loc" 2> nul && set /P PLINK= < "%TEMP%\plink.loc" & del "%TEMP%\plink.loc"
+if not defined PLINK where /R "%ProgramFiles(x86)%" plink > "%TEMP%\plink.loc" 2> nul && set /P PLINK= < "%TEMP%\plink.loc" & del "%TEMP%\plink.loc"
+if not defined PLINK echo Cannot locate plink.exe & exit /B 1
+echo Found plink.exe at %PLINK%
+
+if not defined PSCP where pscp > "%TEMP%\pscp.loc" 2> nul && set /P pscp= < "%TEMP%\pscp.loc" & del "%TEMP%\pscp.loc"
+if not defined PSCP where /R "%ProgramFiles(x86)%\PuTTY" pscp > "%TEMP%\pscp.loc" 2> nul && set /P pscp= < "%TEMP%\pscp.loc" & del "%TEMP%\pscp.loc"
+if not defined PSCP where /R "%ProgramFiles(x86)%" pscp > "%TEMP%\pscp.loc" 2> nul && set /P pscp= < "%TEMP%\pscp.loc" & del "%TEMP%\pscp.loc"
+if not defined PSCP echo Cannot locate pscp.exe & exit /B 1
+echo Found pscp.exe at %PSCP%
+
+if not defined GPG where gpg2 > "%TEMP%\gpg.loc" 2> nul && set /P GPG= < "%TEMP%\gpg.loc" & del "%TEMP%\gpg.loc"
+if not defined GPG where /R "%PCBUILD%..\externals" gpg2 > "%TEMP%\gpg.loc" 2> nul && set /P GPG= < "%TEMP%\gpg.loc" & del "%TEMP%\gpg.loc"
+if not defined GPG echo Cannot locate gpg2.exe. Signatures will not be uploaded & pause
+echo Found gpg2.exe at %GPG%
+
+call "%PCBUILD%env.bat" > nul 2> nul
+pushd "%D%"
+msbuild /v:m /nologo uploadrelease.proj /t:Upload /p:Platform=x86
+msbuild /v:m /nologo uploadrelease.proj /t:Upload /p:Platform=x64 /p:IncludeDoc=false
+msbuild /v:m /nologo uploadrelease.proj /t:ShowHashes /p:Platform=x86
+msbuild /v:m /nologo uploadrelease.proj /t:ShowHashes /p:Platform=x64 /p:IncludeDoc=false
+popd
+exit /B 0
+
+:Help
+echo uploadrelease.bat --host HOST --user USERNAME [--target TARGET] [--dry-run] [-h]
+echo.
+echo --host (-o) Specify the upload host (required)
+echo --user (-u) Specify the user on the host (required)
+echo --target (-t) Specify the target directory on the host
+echo --dry-run Display commands and filenames without executing them
+echo -h Display this help information
+echo.