Skip to content

InForm-PE Windows installation script named setup_inform_win.cmd fails with spaces in QB64PE_PATH #4

Description

@tsberry901

The original fails when QB64-PE is installed in a path with spaces.
This updated version adds proper quoting to handle this case.
Example: "C:\Program Files\QB64 Phoenix Edition" now works.

Example (Command line in Windows) usage:
setup.bat "C:\BASIC\QB64 PHOENIX EDITION"
(Note the spaces and the quotation marks with no trailing backslash.)

Tom Berry
10/25/2025
(Copy the code between the dashed lines and save it as setup.bat)
-----------------Setup.bat---------------------

@echo off
rem Check if QB64-PE directory path is provided as an argument
if "%~1" neq "" (
set "QB64PE_PATH=%~1"
) else (
set "QB64PE_PATH=..\QB64pe"
)
cd /d "%~dp0"
echo Compiling InForm-PE release. Please be patient...
rem Attempt build with QB64-PE path
if exist "%QB64PE_PATH%\internal\c\c_compiler\bin\mingw32-make.exe" (
"%QB64PE_PATH%\internal\c\c_compiler\bin\mingw32-make.exe" -f inform.mk clean OS=Windows_NT "QB64PE_PATH=%QB64PE_PATH%"
"%QB64PE_PATH%\internal\c\c_compiler\bin\mingw32-make.exe" -f inform.mk release OS=Windows_NT "QB64PE_PATH=%QB64PE_PATH%"
) else (
mingw32-make.exe -f inform.mk clean OS=Windows_NT "QB64PE_PATH=%QB64PE_PATH%"
mingw32-make.exe -f inform.mk release OS=Windows_NT "QB64PE_PATH=%QB64PE_PATH%"
)
if not errorlevel 1 exit /b
echo Build failed with QB64-PE path: %QB64PE_PATH%
echo Retrying with alternative QB64-PE directory...
rem Retry build with ..\QB64pe as fallback if it exists
set "QB64PE_PATH=..\QB64pe"
if exist "%QB64PE_PATH%" (
if exist "%QB64PE_PATH%\internal\c\c_compiler\bin\mingw32-make.exe" (
"%QB64PE_PATH%\internal\c\c_compiler\bin\mingw32-make.exe" -f inform.mk clean OS=Windows_NT "QB64PE_PATH=%QB64PE_PATH%"
"%QB64PE_PATH%\internal\c\c_compiler\bin\mingw32-make.exe" -f inform.mk release OS=Windows_NT "QB64PE_PATH=%QB64PE_PATH%"
) else (
mingw32-make.exe -f inform.mk clean OS=Windows_NT "QB64PE_PATH=%QB64PE_PATH%"
mingw32-make.exe -f inform.mk release OS=Windows_NT "QB64PE_PATH=%QB64PE_PATH%"
)
)

------------------------End of Setup.bat--------------------------------------

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions