summaryrefslogtreecommitdiff
path: root/Tools/msi
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2017-06-19 10:34:25 -0700
committerGitHub <noreply@github.com>2017-06-19 10:34:25 -0700
commit40a23e88994aca92c83c8e84ab8b8cdc11d7ec54 (patch)
tree5a04457af0c0d4be563bf1c153059564bc19c516 /Tools/msi
parenteb81795d7d3a8c898fa89a376d63fc3bbfb9a081 (diff)
downloadcpython-git-40a23e88994aca92c83c8e84ab8b8cdc11d7ec54.tar.gz
bpo-30687: Fixes build scripts to find msbuild.exe and stop relying on vcvarsall.bat (#2252)
* Fixes build scripts to find msbuild.exe and stop relying on vcvarsall.bat Also fixes bdist_wininst.vcxproj to use correct version in generated name.
Diffstat (limited to 'Tools/msi')
-rw-r--r--Tools/msi/build.bat10
-rw-r--r--Tools/msi/buildrelease.bat15
-rw-r--r--Tools/msi/uploadrelease.bat15
3 files changed, 21 insertions, 19 deletions
diff --git a/Tools/msi/build.bat b/Tools/msi/build.bat
index 59e0261c6d..f720ea9a86 100644
--- a/Tools/msi/build.bat
+++ b/Tools/msi/build.bat
@@ -22,8 +22,8 @@ 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
+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%
@@ -44,7 +44,7 @@ if defined BUILDDOC (
)
rem Build the launcher MSI separately
-msbuild "%D%launcher\launcher.wixproj" /p:Platform=x86
+%MSBUILD% "%D%launcher\launcher.wixproj" /p:Platform=x86
set BUILD_CMD="%D%bundle\snapshot.wixproj"
if defined BUILDTEST (
@@ -58,11 +58,11 @@ if defined REBUILD (
)
if defined BUILDX86 (
- msbuild %BUILD_CMD%
+ %MSBUILD% %BUILD_CMD%
if errorlevel 1 goto :eof
)
if defined BUILDX64 (
- msbuild /p:Platform=x64 %BUILD_CMD%
+ %MSBUILD% /p:Platform=x64 %BUILD_CMD%
if errorlevel 1 goto :eof
)
diff --git a/Tools/msi/buildrelease.bat b/Tools/msi/buildrelease.bat
index c432c39d44..e55d81a7f7 100644
--- a/Tools/msi/buildrelease.bat
+++ b/Tools/msi/buildrelease.bat
@@ -69,6 +69,8 @@ if not exist "%GIT%" where git > "%TEMP%\git.loc" 2> nul && set /P GIT= < "%TEMP
if not exist "%GIT%" echo Cannot find Git on PATH && exit /B 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)
:builddoc
if "%SKIPBUILD%" EQU "1" goto skipdoc
@@ -165,28 +167,27 @@ if not "%SKIPBUILD%" EQU "1" (
@echo off
)
-call "%PCBUILD%env.bat"
if "%OUTDIR_PLAT%" EQU "win32" (
- msbuild "%D%launcher\launcher.wixproj" /p:Platform=x86 %CERTOPTS% /p:ReleaseUri=%RELEASE_URI%
+ %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%
+ %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
+%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
+%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"
+ %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"
+ %MSBUILD% "%D%..\nuget\make_pkg.proj" /t:Build /p:Configuration=Release /p:Platform=%1 /p:OutputPath="%BUILD%en-us"
if errorlevel 1 exit /B
)
diff --git a/Tools/msi/uploadrelease.bat b/Tools/msi/uploadrelease.bat
index 0873d55589..610b092b86 100644
--- a/Tools/msi/uploadrelease.bat
+++ b/Tools/msi/uploadrelease.bat
@@ -49,16 +49,17 @@ if defined NOGPG (
echo Found gpg2.exe at %GPG%
)
-call "%PCBUILD%env.bat" > nul 2> nul
+call "%PCBUILD%find_msbuild.bat" %MSBUILD%
+if ERRORLEVEL 1 (echo Cannot locate MSBuild.exe on PATH or as MSBUILD variable & exit /b 2)
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%
+%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: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
+%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