diff options
Diffstat (limited to 'Tools/msi')
-rw-r--r-- | Tools/msi/build.bat | 158 | ||||
-rw-r--r-- | Tools/msi/buildrelease.bat | 470 | ||||
-rw-r--r-- | Tools/msi/get_externals.bat | 54 | ||||
-rw-r--r-- | Tools/msi/testrelease.bat | 234 | ||||
-rw-r--r-- | Tools/msi/uploadrelease.bat | 152 |
5 files changed, 534 insertions, 534 deletions
diff --git a/Tools/msi/build.bat b/Tools/msi/build.bat index 69f00c0..59e0261 100644 --- a/Tools/msi/build.bat +++ b/Tools/msi/build.bat @@ -1,79 +1,79 @@ -@echo off
-setlocal
-set D=%~dp0
-set PCBUILD=%D%..\..\PCBuild\
-
-set BUILDX86=
-set BUILDX64=
-set BUILDDOC=
-set BUILDTEST=--test-marker
-set BUILDPACK=
-set REBUILD=
-
-:CheckOpts
-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 "--doc" (set BUILDDOC=1) && shift && goto CheckOpts
-if "%~1" EQU "--no-test-marker" (set BUILDTEST=) && 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)
-
-call "%D%get_externals.bat"
-
-call "%PCBUILD%env.bat" x86
-
-if defined BUILDX86 (
- call "%PCBUILD%build.bat" -d -e %REBUILD% %BUILDTEST%
- if errorlevel 1 goto :eof
- call "%PCBUILD%build.bat" -e %REBUILD% %BUILDTEST%
- if errorlevel 1 goto :eof
-)
-if defined BUILDX64 (
- call "%PCBUILD%build.bat" -p x64 -d -e %REBUILD% %BUILDTEST%
- if errorlevel 1 goto :eof
- call "%PCBUILD%build.bat" -p x64 -e %REBUILD% %BUILDTEST%
- if errorlevel 1 goto :eof
-)
-
-if defined BUILDDOC (
- call "%PCBUILD%..\Doc\make.bat" htmlhelp
- if errorlevel 1 goto :eof
-)
-
-rem Build the launcher MSI separately
-msbuild "%D%launcher\launcher.wixproj" /p:Platform=x86
-
-set BUILD_CMD="%D%bundle\snapshot.wixproj"
-if defined BUILDTEST (
- set BUILD_CMD=%BUILD_CMD% /p:UseTestMarker=true
-)
-if defined BUILDPACK (
- set BUILD_CMD=%BUILD_CMD% /p:Pack=true
-)
-if defined REBUILD (
- set BUILD_CMD=%BUILD_CMD% /t:Rebuild
-)
-
-if defined BUILDX86 (
- msbuild %BUILD_CMD%
- if errorlevel 1 goto :eof
-)
-if defined BUILDX64 (
- msbuild /p:Platform=x64 %BUILD_CMD%
- if errorlevel 1 goto :eof
-)
-
-exit /B 0
-
-:Help
-echo build.bat [-x86] [-x64] [--doc] [-h] [--no-test-marker] [--pack] [-r]
-echo.
-echo -x86 Build x86 installers
-echo -x64 Build x64 installers
-echo --doc Build CHM documentation
-echo --no-test-marker Build without test markers
-echo --pack Embed core MSIs into installer
-echo -r Rebuild rather than incremental build
+@echo off +setlocal +set D=%~dp0 +set PCBUILD=%D%..\..\PCBuild\ + +set BUILDX86= +set BUILDX64= +set BUILDDOC= +set BUILDTEST=--test-marker +set BUILDPACK= +set REBUILD= + +:CheckOpts +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 "--doc" (set BUILDDOC=1) && shift && goto CheckOpts +if "%~1" EQU "--no-test-marker" (set BUILDTEST=) && 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) + +call "%D%get_externals.bat" + +call "%PCBUILD%env.bat" x86 + +if defined BUILDX86 ( + call "%PCBUILD%build.bat" -d -e %REBUILD% %BUILDTEST% + if errorlevel 1 goto :eof + call "%PCBUILD%build.bat" -e %REBUILD% %BUILDTEST% + if errorlevel 1 goto :eof +) +if defined BUILDX64 ( + call "%PCBUILD%build.bat" -p x64 -d -e %REBUILD% %BUILDTEST% + if errorlevel 1 goto :eof + call "%PCBUILD%build.bat" -p x64 -e %REBUILD% %BUILDTEST% + if errorlevel 1 goto :eof +) + +if defined BUILDDOC ( + call "%PCBUILD%..\Doc\make.bat" htmlhelp + if errorlevel 1 goto :eof +) + +rem Build the launcher MSI separately +msbuild "%D%launcher\launcher.wixproj" /p:Platform=x86 + +set BUILD_CMD="%D%bundle\snapshot.wixproj" +if defined BUILDTEST ( + set BUILD_CMD=%BUILD_CMD% /p:UseTestMarker=true +) +if defined BUILDPACK ( + set BUILD_CMD=%BUILD_CMD% /p:Pack=true +) +if defined REBUILD ( + set BUILD_CMD=%BUILD_CMD% /t:Rebuild +) + +if defined BUILDX86 ( + msbuild %BUILD_CMD% + if errorlevel 1 goto :eof +) +if defined BUILDX64 ( + msbuild /p:Platform=x64 %BUILD_CMD% + if errorlevel 1 goto :eof +) + +exit /B 0 + +:Help +echo build.bat [-x86] [-x64] [--doc] [-h] [--no-test-marker] [--pack] [-r] +echo. +echo -x86 Build x86 installers +echo -x64 Build x64 installers +echo --doc Build CHM documentation +echo --no-test-marker Build without test markers +echo --pack Embed core MSIs into installer +echo -r Rebuild rather than incremental build diff --git a/Tools/msi/buildrelease.bat b/Tools/msi/buildrelease.bat index 4247f77..c432c39 100644 --- a/Tools/msi/buildrelease.bat +++ b/Tools/msi/buildrelease.bat @@ -1,235 +1,235 @@ -@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 These two will ensure that your release can be installed
-rem alongside an official Python release, by modifying the GUIDs used
-rem for all components.
-rem
-rem The following substitutions will be applied to the release URI:
-rem Variable Description Example
-rem {arch} architecture amd64, win32
-set RELEASE_URI=http://www.python.org/{arch}
-
-rem This is the URL that will be used to download installation files.
-rem The files available from the default URL *will* conflict with your
-rem installer. Trust me, you don't want them, even if it seems like a
-rem good idea.
-rem
-rem The following substitutions will be applied to the download URL:
-rem Variable Description Example
-rem {version} version number 3.5.0
-rem {arch} architecture amd64, win32
-rem {releasename} release name a1, b2, rc3 (or blank for final)
-rem {msi} MSI filename core.msi
-set DOWNLOAD_URL=https://www.python.org/ftp/python/{version}/{arch}{releasename}/{msi}
-
-set D=%~dp0
-set PCBUILD=%D%..\..\PCBuild\
-set EXTERNALS=%D%..\..\externals\windows-installer\
-
-set BUILDX86=
-set BUILDX64=
-set TARGET=Rebuild
-set TESTTARGETDIR=
-set PGO=-m test -q --pgo
-set BUILDNUGET=1
-set BUILDZIP=1
-
-
-: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 "%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
-if "%1" EQU "--skip-zip" (set BUILDZIP=) && 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 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
-
-call "%D%get_externals.bat"
-
-: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 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
-)
-
-if defined BUILDX64 (
- call :build x64 "%PGO%"
- 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" (
- set PGO=
- set BUILD=%PCBUILD%win32\
- set BUILD_PLAT=Win32
- set OUTDIR_PLAT=win32
- set OBJDIR_PLAT=x86
-) else (
- set BUILD=%PCBUILD%amd64\
- set PGO=%~2
- set BUILD_PLAT=x64
- set OUTDIR_PLAT=amd64
- set OBJDIR_PLAT=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\Debug_%OBJDIR_PLAT%" (
- echo Deleting "%D%obj\Debug_%OBJDIR_PLAT%"
- rmdir /q/s "%D%obj\Debug_%OBJDIR_PLAT%"
- 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 "%PGO%" EQU "" (
- set PGOOPTS=--pgo-job "%PGO%"
-) else (
- set PGOOPTS=
-)
-if not "%SKIPBUILD%" EQU "1" (
- @echo call "%PCBUILD%build.bat" -e -p %BUILD_PLAT% -t %TARGET% %PGOOPTS% %CERTOPTS%
- @call "%PCBUILD%build.bat" -e -p %BUILD_PLAT% -t %TARGET% %PGOOPTS% %CERTOPTS%
- @if errorlevel 1 exit /B
- @rem build.bat turns echo back on, so we disable it again
- @echo off
-
- @echo call "%PCBUILD%build.bat" -d -e -p %BUILD_PLAT% -t %TARGET%
- @call "%PCBUILD%build.bat" -d -e -p %BUILD_PLAT% -t %TARGET%
- @if errorlevel 1 exit /B
- @rem build.bat turns echo back on, so we disable it again
- @echo off
-)
-
-call "%PCBUILD%env.bat"
-if "%OUTDIR_PLAT%" EQU "win32" (
- msbuild "%D%launcher\launcher.wixproj" /p:Platform=x86 %CERTOPTS% /p:ReleaseUri=%RELEASE_URI%
- if errorlevel 1 exit /B
-) else if not exist "%PCBUILD%win32\en-us\launcher.msi" (
- msbuild "%D%launcher\launcher.wixproj" /p:Platform=x86 %CERTOPTS% /p:ReleaseUri=%RELEASE_URI%
- if errorlevel 1 exit /B
-)
-
-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 defined BUILDZIP (
- 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 not "%OUTDIR%" EQU "" (
- mkdir "%OUTDIR%\%OUTDIR_PLAT%"
- mkdir "%OUTDIR%\%OUTDIR_PLAT%\binaries"
- mkdir "%OUTDIR%\%OUTDIR_PLAT%\symbols"
- robocopy "%BUILD%en-us" "%OUTDIR%\%OUTDIR_PLAT%" /XF "*.wixpdb"
- robocopy "%BUILD%\" "%OUTDIR%\%OUTDIR_PLAT%\binaries" *.exe *.dll *.pyd /XF "_test*" /XF "*_d.*" /XF "_freeze*" /XF "tcl*" /XF "tk*" /XF "*_test.*"
- robocopy "%BUILD%\" "%OUTDIR%\%OUTDIR_PLAT%\symbols" *.pdb /XF "_test*" /XF "*_d.*" /XF "_freeze*" /XF "tcl*" /XF "tk*" /XF "*_test.*"
-)
-
-exit /B 0
-
-:Help
-echo buildrelease.bat [--out DIR] [-x86] [-x64] [--certificate CERTNAME] [--build] [--pgo COMMAND]
-echo [--skip-build] [--skip-doc] [--skip-nuget] [--skip-zip] [--skip-pgo]
-echo [--download DOWNLOAD URL] [--test TARGETDIR]
-echo [-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 --pgo Specify PGO command for x64 installers
-echo --skip-pgo Build x64 installers without using PGO
-echo --skip-nuget Do not build Nuget packages
-echo --skip-zip Do not build embeddable package
-echo --download Specify the full download URL for MSIs
-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.
-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 The following substitutions will be applied to the download URL:
-echo Variable Description Example
-echo {version} version number 3.5.0
-echo {arch} architecture amd64, win32
-echo {releasename} release name a1, b2, rc3 (or blank for final)
-echo {msi} MSI filename core.msi
+@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 These two will ensure that your release can be installed +rem alongside an official Python release, by modifying the GUIDs used +rem for all components. +rem +rem The following substitutions will be applied to the release URI: +rem Variable Description Example +rem {arch} architecture amd64, win32 +set RELEASE_URI=http://www.python.org/{arch} + +rem This is the URL that will be used to download installation files. +rem The files available from the default URL *will* conflict with your +rem installer. Trust me, you don't want them, even if it seems like a +rem good idea. +rem +rem The following substitutions will be applied to the download URL: +rem Variable Description Example +rem {version} version number 3.5.0 +rem {arch} architecture amd64, win32 +rem {releasename} release name a1, b2, rc3 (or blank for final) +rem {msi} MSI filename core.msi +set DOWNLOAD_URL=https://www.python.org/ftp/python/{version}/{arch}{releasename}/{msi} + +set D=%~dp0 +set PCBUILD=%D%..\..\PCBuild\ +set EXTERNALS=%D%..\..\externals\windows-installer\ + +set BUILDX86= +set BUILDX64= +set TARGET=Rebuild +set TESTTARGETDIR= +set PGO=-m test -q --pgo +set BUILDNUGET=1 +set BUILDZIP=1 + + +: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 "%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 +if "%1" EQU "--skip-zip" (set BUILDZIP=) && 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 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 + +call "%D%get_externals.bat" + +: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 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 +) + +if defined BUILDX64 ( + call :build x64 "%PGO%" + 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" ( + set PGO= + set BUILD=%PCBUILD%win32\ + set BUILD_PLAT=Win32 + set OUTDIR_PLAT=win32 + set OBJDIR_PLAT=x86 +) else ( + set BUILD=%PCBUILD%amd64\ + set PGO=%~2 + set BUILD_PLAT=x64 + set OUTDIR_PLAT=amd64 + set OBJDIR_PLAT=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\Debug_%OBJDIR_PLAT%" ( + echo Deleting "%D%obj\Debug_%OBJDIR_PLAT%" + rmdir /q/s "%D%obj\Debug_%OBJDIR_PLAT%" + 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 "%PGO%" EQU "" ( + set PGOOPTS=--pgo-job "%PGO%" +) else ( + set PGOOPTS= +) +if not "%SKIPBUILD%" EQU "1" ( + @echo call "%PCBUILD%build.bat" -e -p %BUILD_PLAT% -t %TARGET% %PGOOPTS% %CERTOPTS% + @call "%PCBUILD%build.bat" -e -p %BUILD_PLAT% -t %TARGET% %PGOOPTS% %CERTOPTS% + @if errorlevel 1 exit /B + @rem build.bat turns echo back on, so we disable it again + @echo off + + @echo call "%PCBUILD%build.bat" -d -e -p %BUILD_PLAT% -t %TARGET% + @call "%PCBUILD%build.bat" -d -e -p %BUILD_PLAT% -t %TARGET% + @if errorlevel 1 exit /B + @rem build.bat turns echo back on, so we disable it again + @echo off +) + +call "%PCBUILD%env.bat" +if "%OUTDIR_PLAT%" EQU "win32" ( + msbuild "%D%launcher\launcher.wixproj" /p:Platform=x86 %CERTOPTS% /p:ReleaseUri=%RELEASE_URI% + if errorlevel 1 exit /B +) else if not exist "%PCBUILD%win32\en-us\launcher.msi" ( + msbuild "%D%launcher\launcher.wixproj" /p:Platform=x86 %CERTOPTS% /p:ReleaseUri=%RELEASE_URI% + if errorlevel 1 exit /B +) + +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 defined BUILDZIP ( + 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 not "%OUTDIR%" EQU "" ( + mkdir "%OUTDIR%\%OUTDIR_PLAT%" + mkdir "%OUTDIR%\%OUTDIR_PLAT%\binaries" + mkdir "%OUTDIR%\%OUTDIR_PLAT%\symbols" + robocopy "%BUILD%en-us" "%OUTDIR%\%OUTDIR_PLAT%" /XF "*.wixpdb" + robocopy "%BUILD%\" "%OUTDIR%\%OUTDIR_PLAT%\binaries" *.exe *.dll *.pyd /XF "_test*" /XF "*_d.*" /XF "_freeze*" /XF "tcl*" /XF "tk*" /XF "*_test.*" + robocopy "%BUILD%\" "%OUTDIR%\%OUTDIR_PLAT%\symbols" *.pdb /XF "_test*" /XF "*_d.*" /XF "_freeze*" /XF "tcl*" /XF "tk*" /XF "*_test.*" +) + +exit /B 0 + +:Help +echo buildrelease.bat [--out DIR] [-x86] [-x64] [--certificate CERTNAME] [--build] [--pgo COMMAND] +echo [--skip-build] [--skip-doc] [--skip-nuget] [--skip-zip] [--skip-pgo] +echo [--download DOWNLOAD URL] [--test TARGETDIR] +echo [-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 --pgo Specify PGO command for x64 installers +echo --skip-pgo Build x64 installers without using PGO +echo --skip-nuget Do not build Nuget packages +echo --skip-zip Do not build embeddable package +echo --download Specify the full download URL for MSIs +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. +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 The following substitutions will be applied to the download URL: +echo Variable Description Example +echo {version} version number 3.5.0 +echo {arch} architecture amd64, win32 +echo {releasename} release name a1, b2, rc3 (or blank for final) +echo {msi} MSI filename core.msi diff --git a/Tools/msi/get_externals.bat b/Tools/msi/get_externals.bat index 4ead75e..e1d74de 100644 --- a/Tools/msi/get_externals.bat +++ b/Tools/msi/get_externals.bat @@ -1,27 +1,27 @@ -@echo off
-setlocal
-rem Simple script to fetch source for external tools
-
-where /Q svn
-if ERRORLEVEL 1 (
- echo.svn.exe must be on your PATH to get external tools.
- echo.Try TortoiseSVN (http://tortoisesvn.net/^) and be sure to check the
- echo.command line tools option.
- popd
- exit /b 1
-)
-
-if not exist "%~dp0..\..\externals" mkdir "%~dp0..\..\externals"
-pushd "%~dp0..\..\externals"
-
-if "%SVNROOT%"=="" set SVNROOT=http://svn.python.org/projects/external/
-
-if not exist "windows-installer\.svn" (
- echo.Checking out installer dependencies to %CD%\windows-installer
- svn co %SVNROOT%windows-installer
-) else (
- echo.Updating installer dependencies in %CD%\windows-installer
- svn up windows-installer
-)
-
-popd
+@echo off +setlocal +rem Simple script to fetch source for external tools + +where /Q svn +if ERRORLEVEL 1 ( + echo.svn.exe must be on your PATH to get external tools. + echo.Try TortoiseSVN (http://tortoisesvn.net/^) and be sure to check the + echo.command line tools option. + popd + exit /b 1 +) + +if not exist "%~dp0..\..\externals" mkdir "%~dp0..\..\externals" +pushd "%~dp0..\..\externals" + +if "%SVNROOT%"=="" set SVNROOT=http://svn.python.org/projects/external/ + +if not exist "windows-installer\.svn" ( + echo.Checking out installer dependencies to %CD%\windows-installer + svn co %SVNROOT%windows-installer +) else ( + echo.Updating installer dependencies in %CD%\windows-installer + svn up windows-installer +) + +popd diff --git a/Tools/msi/testrelease.bat b/Tools/msi/testrelease.bat index a989575..96fdf5e 100644 --- a/Tools/msi/testrelease.bat +++ b/Tools/msi/testrelease.bat @@ -1,117 +1,117 @@ -@setlocal enableextensions
-@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 EXE=%~1
-@if not "%EXE:embed=%"=="%EXE%" exit /B 0
-
-@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 enableextensions +@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 EXE=%~1 +@if not "%EXE:embed=%"=="%EXE%" exit /B 0 + +@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 670836b..0873d55 100644 --- a/Tools/msi/uploadrelease.bat +++ b/Tools/msi/uploadrelease.bat @@ -1,76 +1,76 @@ -@setlocal
-@echo off
-
-set D=%~dp0
-set PCBUILD=%D%..\..\PCBuild\
-
-set HOST=
-set USER=
-set TARGET=
-set DRYRUN=false
-set NOGPG=
-set PURGE_OPTION=/p:Purge=true
-set NOTEST=
-
-: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 "%1" EQU "--skip-gpg" (set NOGPG=true) && shift && goto CheckOpts
-if "%1" EQU "--skip-purge" (set PURGE_OPTION=) && shift && godo CheckOpts
-if "%1" EQU "--skip-test" (set NOTEST=true) && shift && godo CheckOpts
-if "%1" EQU "-T" (set NOTEST=true) && shift && godo CheckOpts
-if "%1" NEQ "" echo Unexpected argument "%1" & exit /B 1
-
-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 defined NOGPG (
- set GPG=
- echo Skipping GPG signature generation because of --skip-gpg
-) else (
- 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\windows-installer" 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 %PURGE_OPTION%
-msbuild /v:m /nologo uploadrelease.proj /t:Upload /p:Platform=x64 /p:IncludeDoc=false %PURGE_OPTION%
-if not defined NOTEST (
- msbuild /v:m /nologo uploadrelease.proj /t:Test /p:Platform=x86
- msbuild /v:m /nologo uploadrelease.proj /t:Test /p:Platform=x64
-)
-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 --skip-gpg Does not generate GPG signatures before uploading
-echo --skip-purge Does not perform CDN purge after uploading
-echo --skip-test (-T) Does not perform post-upload tests
-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 +set NOGPG= +set PURGE_OPTION=/p:Purge=true +set NOTEST= + +: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 "%1" EQU "--skip-gpg" (set NOGPG=true) && shift && goto CheckOpts +if "%1" EQU "--skip-purge" (set PURGE_OPTION=) && shift && godo CheckOpts +if "%1" EQU "--skip-test" (set NOTEST=true) && shift && godo CheckOpts +if "%1" EQU "-T" (set NOTEST=true) && shift && godo CheckOpts +if "%1" NEQ "" echo Unexpected argument "%1" & exit /B 1 + +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 defined NOGPG ( + set GPG= + echo Skipping GPG signature generation because of --skip-gpg +) else ( + 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\windows-installer" 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 %PURGE_OPTION% +msbuild /v:m /nologo uploadrelease.proj /t:Upload /p:Platform=x64 /p:IncludeDoc=false %PURGE_OPTION% +if not defined NOTEST ( + msbuild /v:m /nologo uploadrelease.proj /t:Test /p:Platform=x86 + msbuild /v:m /nologo uploadrelease.proj /t:Test /p:Platform=x64 +) +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 --skip-gpg Does not generate GPG signatures before uploading +echo --skip-purge Does not perform CDN purge after uploading +echo --skip-test (-T) Does not perform post-upload tests +echo -h Display this help information +echo. |