Skip to content

Commit

Permalink
Env variable for dir overrides (#38) (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
sshanks-kx authored Sep 20, 2022
1 parent eb11beb commit 1a5eb07
Showing 1 changed file with 25 additions and 10 deletions.
35 changes: 25 additions & 10 deletions install.bat
Original file line number Diff line number Diff line change
@@ -1,33 +1,48 @@
@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%
)
)

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%
)
)

ECHO Installation complete

ENDLOCAL

0 comments on commit 1a5eb07

Please sign in to comment.