Skip to content

Commit fcea9d0

Browse files
committed
Issue #28846: Various installer fixes
1 parent 23021dd commit fcea9d0

File tree

6 files changed

+24
-12
lines changed

6 files changed

+24
-12
lines changed

PCbuild/build.bat

+4
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ if "%platf%"=="x64" (
105105
)
106106
)
107107

108+
if not exist "%HG%" where hg > "%TEMP%\hg.loc" 2> nul && set /P HG= < "%TEMP%\hg.loc" & del "%TEMP%\hg.loc"
109+
if not exist "%HG%" echo Cannot find Mercurial on PATH && exit /B 1
110+
108111
rem Setup the environment
109112
call "%dir%env.bat" %vs_platf% >nul
110113

@@ -142,6 +145,7 @@ msbuild "%dir%pcbuild.proj" /t:%target% %parallel% %verbose%^
142145
/p:IncludeExternals=%IncludeExternals%^
143146
/p:IncludeSSL=%IncludeSSL% /p:IncludeTkinter=%IncludeTkinter%^
144147
/p:UseTestMarker=%UseTestMarker%^
148+
/p:HG="%HG%"^
145149
%1 %2 %3 %4 %5 %6 %7 %8 %9
146150

147151
@echo off

PCbuild/pythoncore.vcxproj

+9-3
Original file line numberDiff line numberDiff line change
@@ -399,9 +399,15 @@
399399
<ImportGroup Label="ExtensionTargets">
400400
</ImportGroup>
401401
<Target Name="_GetBuildInfo" BeforeTargets="PrepareForBuild">
402-
<Exec Command="hg id -b &gt; &quot;$(IntDir)hgbranch.txt&quot;" ContinueOnError="true" />
403-
<Exec Command="hg id -i &gt; &quot;$(IntDir)hgversion.txt&quot;" ContinueOnError="true" />
404-
<Exec Command="hg id -t &gt; &quot;$(IntDir)hgtag.txt&quot;" ContinueOnError="true" />
402+
<PropertyGroup>
403+
<HG Condition="$(HG) == ''">hg</HG>
404+
<_HG>$(HG)</_HG>
405+
<_HG Condition="$(HG.Contains(` `))">"$(HG)"</_HG>
406+
</PropertyGroup>
407+
<Message Text="Getting build info from $(_HG)" Importance="high" />
408+
<Exec Command="$(_HG) id -b &gt; &quot;$(IntDir)hgbranch.txt&quot;" ContinueOnError="true" />
409+
<Exec Command="$(_HG) id -i &gt; &quot;$(IntDir)hgversion.txt&quot;" ContinueOnError="true" />
410+
<Exec Command="$(_HG) id -t &gt; &quot;$(IntDir)hgtag.txt&quot;" ContinueOnError="true" />
405411
<PropertyGroup>
406412
<HgBranch Condition="Exists('$(IntDir)hgbranch.txt')">$([System.IO.File]::ReadAllText('$(IntDir)hgbranch.txt').Trim())</HgBranch>
407413
<HgVersion Condition="Exists('$(IntDir)hgversion.txt')">$([System.IO.File]::ReadAllText('$(IntDir)hgversion.txt').Trim())</HgVersion>

Tools/msi/buildrelease.bat

+4-3
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@ if "%1" NEQ "" echo Invalid option: "%1" && exit /B 1
6464

6565
if not defined BUILDX86 if not defined BUILDX64 (set BUILDX86=1) && (set BUILDX64=1)
6666

67+
if not exist "%HG%" where hg > "%TEMP%\hg.loc" 2> nul && set /P HG= < "%TEMP%\hg.loc" & del "%TEMP%\hg.loc"
68+
if not exist "%HG%" echo Cannot find Mercurial on PATH && exit /B 1
69+
6770
call "%D%get_externals.bat"
6871

6972
:builddoc
@@ -77,8 +80,6 @@ call "%D%..\..\doc\make.bat" htmlhelp
7780
if errorlevel 1 goto :eof
7881
:skipdoc
7982

80-
where hg /q || echo Cannot find Mercurial on PATH && exit /B 1
81-
8283
where dlltool /q && goto skipdlltoolsearch
8384
set _DLLTOOL_PATH=
8485
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
187188
if errorlevel 1 exit /B
188189

189190
if defined BUILDZIP (
190-
msbuild "%D%make_zip.proj" /t:Build %BUILDOPTS% %CERTOPTS%
191+
msbuild "%D%make_zip.proj" /t:Build %BUILDOPTS% %CERTOPTS% /p:OutputPath="%BUILD%en-us"
191192
if errorlevel 1 exit /B
192193
)
193194

Tools/msi/bundle/bundle.wxs

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
<?xml version="1.0"?>
22
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
3-
xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">
3+
xmlns:bal="http://schemas.microsoft.com/wix/BalExtension"
4+
xmlns:dep="http://schemas.microsoft.com/wix/DependencyExtension">
45
<Bundle Name="!(loc.FullProductName)"
56
UpgradeCode="$(var.CoreUpgradeCode)"
67
Version="$(var.Version)"
78
IconSourceFile="bundle.ico"
89
Manufacturer="!(loc.Manufacturer)"
910
AboutUrl="http://www.python.org/"
1011
DisableModify="button"
11-
Compressed="no">
12+
Compressed="no"
13+
dep:ProviderKey="CPython-$(var.MajorVersionNumber).$(var.MinorVersionNumber)$(var.PyArchExt)$(var.PyTestExt)">
1214
<BootstrapperApplication Id="PythonBA" SourceFile="$(var.BootstrapApp)">
1315
<Payload Compressed='yes' SourceFile='Default.thm' />
1416
<Payload Compressed='yes' SourceFile='Default.wxl' />

Tools/msi/make_zip.proj

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313
<SignOutput>false</SignOutput>
1414
<TargetName>python-$(PythonVersion)-embed-$(ArchName)</TargetName>
1515
<TargetExt>.zip</TargetExt>
16-
<TargetPath>$(OutputPath)\en-us\$(TargetName)$(TargetExt)</TargetPath>
16+
<TargetPath>$(OutputPath)\$(TargetName)$(TargetExt)</TargetPath>
1717
<CleanCommand>rmdir /q/s "$(IntermediateOutputPath)\zip_$(ArchName)"</CleanCommand>
1818
<Arguments>"$(PythonExe)" "$(MSBuildThisFileDirectory)\make_zip.py"</Arguments>
19-
<Arguments>$(Arguments) -e -o "$(TargetPath)" -t "$(IntermediateOutputPath)\zip_$(ArchName)" -b "$(OutDir.TrimEnd('\'))"</Arguments>
19+
<Arguments>$(Arguments) -e -o "$(TargetPath)" -t "$(IntermediateOutputPath)\zip_$(ArchName)" -b "$(BuildPath.TrimEnd('\'))"</Arguments>
2020
<Environment>set DOC_FILENAME=python$(PythonVersion).chm
2121
set VCREDIST_PATH=$(VS140COMNTOOLS)\..\..\VC\redist\$(Platform)\Microsoft.VC140.CRT</Environment>
2222
</PropertyGroup>

Tools/nuget/make_pkg.proj

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,12 @@
1818
<SignOutput>false</SignOutput>
1919
<TargetName>$(OutputName).$(NuspecVersion)</TargetName>
2020
<TargetExt>.nupkg</TargetExt>
21-
<TargetPath>$(OutputPath)\$(TargetName)$(TargetExt)</TargetPath>
2221
<IntermediateOutputPath>$(IntermediateOutputPath)\nuget_$(ArchName)</IntermediateOutputPath>
2322

2423
<CleanCommand>rmdir /q/s "$(IntermediateOutputPath)"</CleanCommand>
2524

2625
<PythonArguments>"$(PythonExe)" "$(MSBuildThisFileDirectory)\..\msi\make_zip.py"</PythonArguments>
27-
<PythonArguments>$(PythonArguments) -t "$(IntermediateOutputPath)" -b "$(OutDir.TrimEnd('\'))"</PythonArguments>
26+
<PythonArguments>$(PythonArguments) -t "$(IntermediateOutputPath)" -b "$(BuildPath.TrimEnd('\'))"</PythonArguments>
2827

2928
<PipArguments>"$(IntermediateOutputPath)\python.exe" -B -c "import sys; sys.path.append(r'$(PySourcePath)\Lib'); import ensurepip; ensurepip._main()"</PipArguments>
3029
<PackageArguments Condition="$(Packages) != ''">"$(IntermediateOutputPath)\python.exe" -B -m pip install -U $(Packages)</PackageArguments>

0 commit comments

Comments
 (0)