From 190dbd9ba20610bfd19b2f3544ec9d9d3fd92b0b Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Sat, 3 Dec 2016 11:18:53 -0800 Subject: Issue #28846: Various installer fixes --- PCbuild/build.bat | 4 ++++ PCbuild/pythoncore.vcxproj | 12 +++++++++--- Tools/msi/buildrelease.bat | 7 ++++--- Tools/msi/bundle/bundle.wxs | 6 ++++-- Tools/msi/make_zip.proj | 4 ++-- Tools/nuget/make_pkg.proj | 3 +-- 6 files changed, 24 insertions(+), 12 deletions(-) diff --git a/PCbuild/build.bat b/PCbuild/build.bat index 88b1f06..98fa267 100644 --- a/PCbuild/build.bat +++ b/PCbuild/build.bat @@ -105,6 +105,9 @@ if "%platf%"=="x64" ( ) ) +if not exist "%HG%" where hg > "%TEMP%\hg.loc" 2> nul && set /P HG= < "%TEMP%\hg.loc" & del "%TEMP%\hg.loc" +if not exist "%HG%" echo Cannot find Mercurial on PATH && exit /B 1 + rem Setup the environment call "%dir%env.bat" %vs_platf% >nul @@ -142,6 +145,7 @@ msbuild "%dir%pcbuild.proj" /t:%target% %parallel% %verbose%^ /p:IncludeExternals=%IncludeExternals%^ /p:IncludeSSL=%IncludeSSL% /p:IncludeTkinter=%IncludeTkinter%^ /p:UseTestMarker=%UseTestMarker%^ + /p:HG="%HG%"^ %1 %2 %3 %4 %5 %6 %7 %8 %9 @echo off diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj index e5e96ad..dc5c670 100644 --- a/PCbuild/pythoncore.vcxproj +++ b/PCbuild/pythoncore.vcxproj @@ -399,9 +399,15 @@ - - - + + hg + <_HG>$(HG) + <_HG Condition="$(HG.Contains(` `))">"$(HG)" + + + + + $([System.IO.File]::ReadAllText('$(IntDir)hgbranch.txt').Trim()) $([System.IO.File]::ReadAllText('$(IntDir)hgversion.txt').Trim()) diff --git a/Tools/msi/buildrelease.bat b/Tools/msi/buildrelease.bat index 1fa2dcb..f296e61 100644 --- a/Tools/msi/buildrelease.bat +++ b/Tools/msi/buildrelease.bat @@ -64,6 +64,9 @@ 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 "%HG%" where hg > "%TEMP%\hg.loc" 2> nul && set /P HG= < "%TEMP%\hg.loc" & del "%TEMP%\hg.loc" +if not exist "%HG%" echo Cannot find Mercurial on PATH && exit /B 1 + call "%D%get_externals.bat" :builddoc @@ -77,8 +80,6 @@ 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 "%EXTERNALS%\" dlltool > "%TEMP%\dlltool.loc" 2> nul && set /P _DLLTOOL_PATH= < "%TEMP%\dlltool.loc" & del "%TEMP%\dlltool.loc" @@ -187,7 +188,7 @@ msbuild "%D%bundle\releaseweb.wixproj" /t:Rebuild /p:Platform=%1 %BUILDOPTS% %CE if errorlevel 1 exit /B if defined BUILDZIP ( - msbuild "%D%make_zip.proj" /t:Build %BUILDOPTS% %CERTOPTS% + msbuild "%D%make_zip.proj" /t:Build %BUILDOPTS% %CERTOPTS% /p:OutputPath="%BUILD%en-us" if errorlevel 1 exit /B ) diff --git a/Tools/msi/bundle/bundle.wxs b/Tools/msi/bundle/bundle.wxs index 38307e0..eda0884 100644 --- a/Tools/msi/bundle/bundle.wxs +++ b/Tools/msi/bundle/bundle.wxs @@ -1,6 +1,7 @@  + xmlns:bal="http://schemas.microsoft.com/wix/BalExtension" + xmlns:dep="http://schemas.microsoft.com/wix/DependencyExtension"> + Compressed="no" + dep:ProviderKey="CPython-$(var.MajorVersionNumber).$(var.MinorVersionNumber)$(var.PyArchExt)$(var.PyTestExt)"> diff --git a/Tools/msi/make_zip.proj b/Tools/msi/make_zip.proj index 13f75ba..1af6dd2 100644 --- a/Tools/msi/make_zip.proj +++ b/Tools/msi/make_zip.proj @@ -13,10 +13,10 @@ false python-$(PythonVersion)-embed-$(ArchName) .zip - $(OutputPath)\en-us\$(TargetName)$(TargetExt) + $(OutputPath)\$(TargetName)$(TargetExt) rmdir /q/s "$(IntermediateOutputPath)\zip_$(ArchName)" "$(PythonExe)" "$(MSBuildThisFileDirectory)\make_zip.py" - $(Arguments) -e -o "$(TargetPath)" -t "$(IntermediateOutputPath)\zip_$(ArchName)" -b "$(OutDir.TrimEnd('\'))" + $(Arguments) -e -o "$(TargetPath)" -t "$(IntermediateOutputPath)\zip_$(ArchName)" -b "$(BuildPath.TrimEnd('\'))" set DOC_FILENAME=python$(PythonVersion).chm set VCREDIST_PATH=$(VS140COMNTOOLS)\..\..\VC\redist\$(Platform)\Microsoft.VC140.CRT diff --git a/Tools/nuget/make_pkg.proj b/Tools/nuget/make_pkg.proj index d1fc649..81b84f9 100644 --- a/Tools/nuget/make_pkg.proj +++ b/Tools/nuget/make_pkg.proj @@ -18,13 +18,12 @@ false $(OutputName).$(NuspecVersion) .nupkg - $(OutputPath)\$(TargetName)$(TargetExt) $(IntermediateOutputPath)\nuget_$(ArchName) rmdir /q/s "$(IntermediateOutputPath)" "$(PythonExe)" "$(MSBuildThisFileDirectory)\..\msi\make_zip.py" - $(PythonArguments) -t "$(IntermediateOutputPath)" -b "$(OutDir.TrimEnd('\'))" + $(PythonArguments) -t "$(IntermediateOutputPath)" -b "$(BuildPath.TrimEnd('\'))" "$(IntermediateOutputPath)\python.exe" -B -c "import sys; sys.path.append(r'$(PySourcePath)\Lib'); import ensurepip; ensurepip._main()" "$(IntermediateOutputPath)\python.exe" -B -m pip install -U $(Packages) -- cgit v0.12