From 1a5eb0715c0d0ec994c7a6593b381611f0d11da6 Mon Sep 17 00:00:00 2001 From: Simon Shanks <59612559+sshanks-kx@users.noreply.github.com> Date: Tue, 20 Sep 2022 13:04:08 +0100 Subject: [PATCH] Env variable for dir overrides (#38) (#40) --- install.bat | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/install.bat b/install.bat index 3b8bf0e..a515995 100644 --- a/install.bat +++ b/install.bat @@ -1,19 +1,34 @@ @echo off -IF "%QHOME%"=="" ( - ECHO ERROR: Enviroment variable QHOME is NOT defined - EXIT /B +SETLOCAL +IF NOT DEFINED Q_SHARED_LIB_DIR ( + IF NOT DEFINED QHOME ( + ECHO ERROR: Environment variable QHOME is NOT defined + EXIT /B + ) + SET Q_SHARED_LIB_DIR=%QHOME%\w64 +) +IF NOT DEFINED Q_SCRIPT_DIR ( + IF NOT DEFINED QHOME ( + ECHO ERROR: Environment variable QHOME is NOT defined + EXIT /B + ) + SET Q_SCRIPT_DIR=%QHOME% ) -IF NOT EXIST %QHOME%\w64 ( - ECHO ERROR: Installation destination %QHOME%\w64 does not exist +IF NOT EXIST %Q_SHARED_LIB_DIR% ( + ECHO ERROR: Library installation destination %Q_SHARED_LIB_DIR% does not exist EXIT /B ) +IF NOT EXIST %Q_SCRIPT_DIR% ( + ECHO ERROR: Script installation destination %Q_SCRIPT_DIR% does not exist + EXIT /B +) IF EXIST q ( - ECHO Copying q script to %QHOME% - COPY q\* %QHOME% + ECHO Copying q script to %Q_SCRIPT_DIR% + COPY q\* %Q_SCRIPT_DIR% IF %ERRORLEVEL% NEQ 0 ( ECHO ERROR: Copy failed EXIT /B %ERRORLEVEL% @@ -21,8 +36,8 @@ IF EXIST q ( ) IF EXIST lib ( - ECHO Copying DLL to %QHOME%\w64 - COPY lib\* %QHOME%\w64\ + ECHO Copying DLL to %Q_SHARED_LIB_DIR% + COPY lib\* %Q_SHARED_LIB_DIR% IF %ERRORLEVEL% NEQ 0 ( ECHO ERROR: Copy failed EXIT /B %ERRORLEVEL% @@ -30,4 +45,4 @@ IF EXIST lib ( ) ECHO Installation complete - +ENDLOCAL