diff --git a/PCbuild/build.bat b/PCbuild/build.bat
index 88b1f060ab1..98fa2671f63 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 e5e96ad65e2..dc5c6703c79 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 1fa2dcb5340..f296e613ac1 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 38307e063cb..eda088404fa 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 13f75ba8493..1af6dd2868a 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 d1fc649da79..81b84f98846 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)