Replace prepare_ghostscript.bat with Python script to fix nested for/if batch parser bug

This commit is contained in:
2026-02-24 11:52:42 +02:00
parent f7833ed4b9
commit f67e1fb0da
3 changed files with 121 additions and 2 deletions

View File

@@ -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" (