Moves Windows installer externals onto SVN and updates the build proc… · pythoncapi/cpython@d28a8a9 · GitHub
Skip to content

Commit d28a8a9

Browse files
committed
Moves Windows installer externals onto SVN and updates the build process to grab them automatically.
1 parent de6e800 commit d28a8a9

8 files changed

Lines changed: 100 additions & 70 deletions

File tree

Tools/msi/README.txt

Lines changed: 51 additions & 8 deletions

Tools/msi/build.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ if "%~1" EQU "--pack" (set BUILDPACK=1) && shift && goto CheckOpts
1919

2020
if not defined BUILDX86 if not defined BUILDX64 (set BUILDX86=1) && (set BUILDX64=1)
2121

22+
call "%D%get_externals.bat"
23+
2224
call "%PCBUILD%env.bat" x86
2325

2426
if defined BUILDX86 (
@@ -48,12 +50,10 @@ if defined BUILDPACK (
4850
)
4951

5052
if defined BUILDX86 (
51-
"%PCBUILD%win32\python.exe" "%D%get_wix.py"
5253
msbuild %BUILD_CMD%
5354
if errorlevel 1 goto :eof
5455
)
5556
if defined BUILDX64 (
56-
"%PCBUILD%amd64\python.exe" "%D%get_wix.py"
5757
msbuild /p:Platform=x64 %BUILD_CMD%
5858
if errorlevel 1 goto :eof
5959
)

Tools/msi/buildrelease.bat

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ set DOWNLOAD_URL=https://www.python.org/ftp/python/{version}/{arch}{releasename}
2929

3030
set D=%~dp0
3131
set PCBUILD=%D%..\..\PCBuild\
32+
set EXTERNALS=%D%..\..\externals\windows-installer\
3233

3334
set BUILDX86=
3435
set BUILDX64=
@@ -59,12 +60,15 @@ if "%1" NEQ "" echo Invalid option: "%1" && exit /B 1
5960

6061
if not defined BUILDX86 if not defined BUILDX64 (set BUILDX86=1) && (set BUILDX64=1)
6162

63+
call "%D%get_externals.bat"
64+
6265
:builddoc
6366
if "%SKIPBUILD%" EQU "1" goto skipdoc
6467
if "%SKIPDOC%" EQU "1" goto skipdoc
6568

6669
if not defined PYTHON where py -q || echo Cannot find py on path and PYTHON is not set. && exit /B 1
6770
if not defined SPHINXBUILD where sphinx-build -q || echo Cannot find sphinx-build on path and SPHINXBUILD is not set. && exit /B 1
71+
6872
call "%D%..\..\doc\make.bat" htmlhelp
6973
if errorlevel 1 goto :eof
7074
:skipdoc
@@ -73,7 +77,7 @@ where hg /q || echo Cannot find Mercurial on PATH && exit /B 1
7377

7478
where dlltool /q && goto skipdlltoolsearch
7579
set _DLLTOOL_PATH=
76-
where /R "%D%..\..\externals" dlltool > "%TEMP%\dlltool.loc" 2> nul && set /P _DLLTOOL_PATH= < "%TEMP%\dlltool.loc" & del "%TEMP%\dlltool.loc"
80+
where /R "%EXTERNALS%\" dlltool > "%TEMP%\dlltool.loc" 2> nul && set /P _DLLTOOL_PATH= < "%TEMP%\dlltool.loc" & del "%TEMP%\dlltool.loc"
7781
if not exist "%_DLLTOOL_PATH%" echo Cannot find binutils on PATH or in external && exit /B 1
7882
for %%f in (%_DLLTOOL_PATH%) do set PATH=%PATH%;%%~dpf
7983
set _DLLTOOL_PATH=
@@ -170,8 +174,6 @@ if not "%SKIPBUILD%" EQU "1" (
170174
@echo off
171175
)
172176

173-
"%BUILD%python.exe" "%D%get_wix.py"
174-
175177
set BUILDOPTS=/p:Platform=%1 /p:BuildForRelease=true /p:DownloadUrl=%DOWNLOAD_URL% /p:DownloadUrlBase=%DOWNLOAD_URL_BASE% /p:ReleaseUri=%RELEASE_URI%
176178
if "%PGO%" NEQ "" set BUILDOPTS=%BUILDOPTS% /p:PGOBuildPath=%BUILD%
177179
msbuild "%D%bundle\releaselocal.wixproj" /t:Rebuild %BUILDOPTS% %CERTOPTS% /p:RebuildAll=true

Tools/msi/get_externals.bat

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
@echo off
2+
setlocal
3+
rem Simple script to fetch source for external tools
4+
5+
where /Q svn
6+
if ERRORLEVEL 1 (
7+
echo.svn.exe must be on your PATH to get external tools.
8+
echo.Try TortoiseSVN (http://tortoisesvn.net/^) and be sure to check the
9+
echo.command line tools option.
10+
popd
11+
exit /b 1
12+
)
13+
14+
if not exist "%~dp0..\..\externals" mkdir "%~dp0..\..\externals"
15+
pushd "%~dp0..\..\externals"
16+
17+
if "%SVNROOT%"=="" set SVNROOT=http://svn.python.org/projects/external/
18+
19+
if not exist "windows-installer\.svn" (
20+
echo.Checking out installer dependencies to %CD%\windows-installer
21+
svn co %SVNROOT%windows-installer
22+
) else (
23+
echo.Updating installer dependencies in %CD%\windows-installer
24+
svn up windows-installer
25+
)
26+
27+
popd

Tools/msi/get_wix.py

Lines changed: 0 additions & 49 deletions
This file was deleted.

Tools/msi/msi.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
<OutputPath Condition="!HasTrailingSlash($(OutputPath))">$(OutputPath)\</OutputPath>
5454
<OutDir>$(OutputPath)</OutDir>
5555
<ReuseCabinetCache>true</ReuseCabinetCache>
56-
<CRTRedist Condition="'$(CRTRedist)' == ''">$(ExternalsDir)\redist</CRTRedist>
56+
<CRTRedist Condition="'$(CRTRedist)' == ''">$(ExternalsDir)\windows-installer\redist</CRTRedist>
5757
<CRTRedist Condition="!Exists($(CRTRedist))"></CRTRedist>
5858
<DocFilename>python$(MajorVersionNumber)$(MinorVersionNumber)$(MicroVersionNumber)$(ReleaseLevelName).chm</DocFilename>
5959

Tools/msi/uploadrelease.bat

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ set HOST=
88
set USER=
99
set TARGET=
1010
set DRYRUN=false
11+
set NOGPG=
1112

1213
:CheckOpts
1314
if "%1" EQU "-h" goto Help
@@ -18,6 +19,7 @@ if "%1" EQU "--user" (set USER=%~2) && shift && shift && goto CheckOpts
1819
if "%1" EQU "-t" (set TARGET=%~2) && shift && shift && goto CheckOpts
1920
if "%1" EQU "--target" (set TARGET=%~2) && shift && shift && goto CheckOpts
2021
if "%1" EQU "--dry-run" (set DRYRUN=true) && shift && goto CheckOpts
22+
if "%1" EQU "--no-gpg" (set NOGPG=true) && shift && goto CheckOpts
2123

2224
if not defined PLINK where plink > "%TEMP%\plink.loc" 2> nul && set /P PLINK= < "%TEMP%\plink.loc" & del "%TEMP%\plink.loc"
2325
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"
@@ -31,10 +33,15 @@ if not defined PSCP where /R "%ProgramFiles(x86)%" pscp > "%TEMP%\pscp.loc" 2> n
3133
if not defined PSCP echo Cannot locate pscp.exe & exit /B 1
3234
echo Found pscp.exe at %PSCP%
3335

34-
if not defined GPG where gpg2 > "%TEMP%\gpg.loc" 2> nul && set /P GPG= < "%TEMP%\gpg.loc" & del "%TEMP%\gpg.loc"
35-
if not defined GPG where /R "%PCBUILD%..\externals" gpg2 > "%TEMP%\gpg.loc" 2> nul && set /P GPG= < "%TEMP%\gpg.loc" & del "%TEMP%\gpg.loc"
36-
if not defined GPG echo Cannot locate gpg2.exe. Signatures will not be uploaded & pause
37-
echo Found gpg2.exe at %GPG%
36+
if defined NOGPG (
37+
set GPG=
38+
echo Skipping GPG signature generation because of --no-gpg
39+
) else (
40+
if not defined GPG where gpg2 > "%TEMP%\gpg.loc" 2> nul && set /P GPG= < "%TEMP%\gpg.loc" & del "%TEMP%\gpg.loc"
41+
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"
42+
if not defined GPG echo Cannot locate gpg2.exe. Signatures will not be uploaded & pause
43+
echo Found gpg2.exe at %GPG%
44+
)
3845

3946
call "%PCBUILD%env.bat" > nul 2> nul
4047
pushd "%D%"

Tools/msi/wix.props

Lines changed: 3 additions & 3 deletions

0 commit comments

Comments
 (0)