summaryrefslogtreecommitdiff
path: root/Doc/make.bat
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2015-02-07 22:20:48 -0800
committerSteve Dower <steve.dower@microsoft.com>2015-02-07 22:20:48 -0800
commit56c347cea3e4e1d5567926f7c0488efaf5bec34b (patch)
treef4b8364b9be054b935af0d43d2bce2b1530beca2 /Doc/make.bat
parent81d6af8202723ee501e5b5ebf19362815c5e1380 (diff)
downloadcpython-56c347cea3e4e1d5567926f7c0488efaf5bec34b.tar.gz
Improve Windows release scripts
Diffstat (limited to 'Doc/make.bat')
-rw-r--r--Doc/make.bat18
1 files changed, 11 insertions, 7 deletions
diff --git a/Doc/make.bat b/Doc/make.bat
index fd54cb86be..6aae34a7e2 100644
--- a/Doc/make.bat
+++ b/Doc/make.bat
@@ -8,13 +8,17 @@ set this=%~n0
if "%SPHINXBUILD%" EQU "" set SPHINXBUILD=sphinx-build
if "%PYTHON%" EQU "" set PYTHON=py
-if "%HTMLHELP%" EQU "" (
- where hhc 2>nul >"%TEMP%\hhc.loc"
- if errorlevel 1 dir "..\externals\hhc.exe" /s/b > "%TEMP%\hhc.loc"
- if errorlevel 1 echo Cannot find HHC on PATH or in externals & exit /B 1
- set /P HTMLHELP= < "%TEMP%\hhc.loc"
- del "%TEMP%\hhc.loc"
-)
+if "%1" NEQ "htmlhelp" goto :skiphhcsearch
+if exist "%HTMLHELP%" goto :skiphhcsearch
+
+rem Search for HHC in likely places
+set HTMLHELP=
+where hhc /q && set HTMLHELP=hhc && goto :skiphhcsearch
+where /R ..\externals hhc > "%TEMP%\hhc.loc" 2> nul && set /P HTMLHELP= < "%TEMP%\hhc.loc" & del "%TEMP%\hhc.loc"
+if not exist "%HTMLHELP%" where /R "%ProgramFiles(x86)%" hhc > "%TEMP%\hhc.loc" 2> nul && set /P HTMLHELP= < "%TEMP%\hhc.loc" & del "%TEMP%\hhc.loc"
+if not exist "%HTMLHELP%" where /R "%ProgramFiles%" hhc > "%TEMP%\hhc.loc" 2> nul && set /P HTMLHELP= < "%TEMP%\hhc.loc" & del "%TEMP%\hhc.loc"
+if not exist "%HTMLHELP%" echo Cannot find HHC on PATH or in externals & exit /B 1
+:skiphhcsearch
if "%DISTVERSION%" EQU "" for /f "usebackq" %%v in (`%PYTHON% tools/extensions/patchlevel.py`) do set DISTVERSION=%%v