Replace prepare_ghostscript.bat with Python script to fix nested for/if batch parser bug
This commit is contained in:
@@ -22,6 +22,10 @@ set GS_BIN_SRC=
|
||||
set GS_LIB_SRC=
|
||||
set GS_EXE=
|
||||
|
||||
REM Pre-assign ProgramFiles(x86) to avoid batch parser choking on the parentheses
|
||||
set "PF64=%ProgramFiles%"
|
||||
set "PF32=%ProgramFiles(x86)%"
|
||||
|
||||
echo.
|
||||
echo ============================================================
|
||||
echo GhostScript Bundle Preparation
|
||||
@@ -29,7 +33,7 @@ echo ============================================================
|
||||
echo.
|
||||
|
||||
REM ---- Search for GhostScript in both Program Files locations ----
|
||||
for %%P in ("%ProgramFiles%" "%ProgramFiles(x86)%") do (
|
||||
for %%P in ("%PF64%" "%PF32%") do (
|
||||
if exist "%%~P\gs" (
|
||||
for /d %%V in ("%%~P\gs\gs*") do (
|
||||
if exist "%%~V\bin\gswin64c.exe" (
|
||||
|
||||
Reference in New Issue
Block a user