Add extra checks for environment vars

This commit is contained in:
Vasily
2018-12-26 20:23:16 +01:00
parent 8d0277f6cf
commit de8dffe40f
3 changed files with 23 additions and 5 deletions
+12 -1
View File
@@ -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.
+1
View File
@@ -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.
+10 -4
View File
@@ -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.