diff --git a/build_scripts/win/build.cmd b/build_scripts/win/build.cmd index 46a9d72..c88a9f3 100644 --- a/build_scripts/win/build.cmd +++ b/build_scripts/win/build.cmd @@ -25,6 +25,7 @@ IF NOT DEFINED project_dir ( REM Change dir to the project dir, otherwise qmake doesn't know where it is. CD %project_dir% +REM QT_LOC is a directory, it can't be in the path, no reason to check using WHERE. ECHO %current_activity%: Testing if all required build environment values are set: IF NOT DEFINED QT_LOC ( ECHO %current_activity%: QT_LOC not defined. Using default value. @@ -43,7 +44,17 @@ IF NOT DEFINED VS_LOC ( SET VS_LOC="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" ) ECHO %current_activity%: VS_LOC set to '%VS_LOC%'. -IF EXIST %VS_LOC% ( + +REM EXIST won't find items in the PATH. WHERE will. +SET VS_VALID=0 +IF EXIST %VS_LOC% SET VS_VALID=1 +REM Prevents error message spam if it doesn't find it in PATH. +IF NOT %VS_VALID% EQU 1 ( + WHERE /Q %VS_LOC% + IF NOT ERRORLEVEL 1 SET VS_VALID=1 +) + +IF %VS_VALID% EQU 1 ( ECHO %current_activity%: VS_LOC exists. ) ELSE ( ECHO %current_activity%: VS_LOC directory does not exist. Exiting. diff --git a/build_scripts/win/deploy.cmd b/build_scripts/win/deploy.cmd index 3a78495..91fc32a 100644 --- a/build_scripts/win/deploy.cmd +++ b/build_scripts/win/deploy.cmd @@ -29,6 +29,7 @@ IF NOT DEFINED QT_LOC ( ECHO %current_activity%: QT_LOC not defined. Using default value. SET QT_LOC="C:\Qt\5.11.1\msvc2017_64\bin\" ) +REM QT_LOC is a directory, it can't be in the path, no reason to check using WHERE. ECHO %current_activity%: QT_LOC set to '%QT_LOC%'. IF EXIST %QT_LOC% ( ECHO %current_activity%: QT_LOC exists. diff --git a/build_scripts/win/package.cmd b/build_scripts/win/package.cmd index 59901fd..a1d7320 100644 --- a/build_scripts/win/package.cmd +++ b/build_scripts/win/package.cmd @@ -36,8 +36,10 @@ ECHO %current_activity%: ZIP_LOC set to '%ZIP_LOC%'. REM EXIST won't find items in the PATH. WHERE will. SET ZIP_VALID=0 IF EXIST %ZIP_LOC% SET ZIP_VALID=1 -WHERE /Q %ZIP_LOC% -IF NOT ERRORLEVEL 1 SET ZIP_VALID=1 +IF %ZIP_VALID% EQU 0 ( + WHERE /Q %ZIP_LOC% + IF NOT ERRORLEVEL 1 SET ZIP_VALID=1 +) IF %ZIP_VALID% EQU 1 ( ECHO %current_activity%: ZIP_LOC exists. @@ -52,10 +54,14 @@ IF NOT DEFINED NSIS_LOC ( ) ECHO %current_activity%: NSIS_LOC set to '%NSIS_LOC%'. +REM EXIST won't find items in the PATH. WHERE will. SET NSIS_VALID=0 IF EXIST %NSIS_LOC% SET NSIS_VALID=1 -WHERE /Q %NSIS_LOC% -IF NOT ERRORLEVEL 1 SET NSIS_VALID=1 +REM Prevents error message spam if it doesn't find it in PATH. +IF %NSIS_VALID% EQU 0 ( + WHERE /Q %NSIS_LOC% + IF NOT ERRORLEVEL 1 SET NSIS_VALID=1 +) IF %NSIS_VALID% EQU 1 ( ECHO %current_activity%: NSIS_LOC exists.