Skip to content

Commit d55318b

Browse files
Merge pull request #237 from ISISComputingGroup/error_if_multiple_galil
Error if both galil drivers appear enabled
2 parents 59dcb79 + aa93e3f commit d55318b

File tree

2 files changed

+25
-9
lines changed

2 files changed

+25
-9
lines changed

installation_and_upgrade/instrument_deploy.bat

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,21 @@ set "GALIL_OLD_DIR=C:\Instrument\Apps\EPICS\ioc\master\GALIL-OLD"
6666
if exist "%TEMP%\%GALIL_OLD_FILE%" del "%TEMP%\%GALIL_OLD_FILE%"
6767
if exist "%TEMP%\%GALIL_NEW_FILE%" del "%TEMP%\%GALIL_NEW_FILE%"
6868
if exist "%GALIL_DIR%\%GALIL_OLD_FILE%" (
69-
@echo Detected old Galil driver
70-
robocopy "%GALIL_DIR%" "%TEMP%" "%GALIL_OLD_FILE%" /R:2 /IS /NFL /NDL /NP /NC /NS /LOG:NUL
69+
@echo Detected old Galil driver - %GALIL_OLD_FILE% in %GALIL_DIR%
70+
robocopy "%GALIL_DIR%" "%TEMP%" "%GALIL_OLD_FILE%" /R:2 /IS /NFL /NDL /NP /NC /NS /LOG:NUL
71+
set "DETECT_OLD_GALIL=YES"
7172
)
7273
if exist "%GALIL_OLD_DIR%\%GALIL_OLD_FILE%" (
7374
REM GALIL-OLD has not been renamed to GALIL hence we must be using new driver
74-
@echo Detected new Galil driver
75-
copy /y "%GALIL_OLD_DIR%\%GALIL_OLD_FILE%" "%TEMP%\%GALIL_NEW_FILE%"
75+
@echo Detected new Galil driver - %GALIL_OLD_FILE% in %GALIL_OLD_DIR%
76+
copy /y "%GALIL_OLD_DIR%\%GALIL_OLD_FILE%" "%TEMP%\%GALIL_NEW_FILE%"
77+
set "DETECT_NEW_GALIL=YES"
78+
)
79+
if "%DETECT_OLD_GALIL%" == "YES" (
80+
if "%DETECT_NEW_GALIL%" == "YES" (
81+
@echo ERROR - both NEW and OLD GALIL driver appear enabled, this should not be possible
82+
exit /b 1
83+
)
7684
)
7785

7886
REM Set python as share just for script call

installation_and_upgrade/instrument_install_latest_build_only.bat

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ if exist "%GENIECMDLOGDIR%\%GENIECMDLOGFILE%" (
5656
robocopy "%GENIECMDLOGDIR%" "%TEMP%" "%GENIECMDLOGFILE%" /R:2 /IS /NFL /NDL /NP /NC /NS /LOG:NUL
5757
)
5858

59-
REM Create the "GALIL_OLD.txt" or "GALIL_NEX.txt" file in tmp dir
59+
REM Create the "GALIL_OLD.txt" or "GALIL_NEW.txt" file in tmp dir
6060
REM to inform the IBEX Server installation step which Galil version to use
6161
set "GALIL_OLD_FILE=GALIL_OLD.txt"
6262
set "GALIL_NEW_FILE=GALIL_NEW.txt"
@@ -65,13 +65,21 @@ set "GALIL_OLD_DIR=C:\Instrument\Apps\EPICS\ioc\master\GALIL-OLD"
6565
if exist "%TEMP%\%GALIL_OLD_FILE%" del "%TEMP%\%GALIL_OLD_FILE%"
6666
if exist "%TEMP%\%GALIL_NEW_FILE%" del "%TEMP%\%GALIL_NEW_FILE%"
6767
if exist "%GALIL_DIR%\%GALIL_OLD_FILE%" (
68-
@echo Detected old Galil driver
69-
robocopy "%GALIL_DIR%" "%TEMP%" "%GALIL_OLD_FILE%" /R:2 /IS /NFL /NDL /NP /NC /NS /LOG:NUL
68+
@echo Detected old Galil driver - %GALIL_OLD_FILE% in %GALIL_DIR%
69+
robocopy "%GALIL_DIR%" "%TEMP%" "%GALIL_OLD_FILE%" /R:2 /IS /NFL /NDL /NP /NC /NS /LOG:NUL
70+
set "DETECT_OLD_GALIL=YES"
7071
)
7172
if exist "%GALIL_OLD_DIR%\%GALIL_OLD_FILE%" (
7273
REM GALIL-OLD has not been renamed to GALIL hence we must be using new driver
73-
@echo Detected new Galil driver
74-
copy /y "%GALIL_OLD_DIR%\%GALIL_OLD_FILE%" "%TEMP%\%GALIL_NEW_FILE%"
74+
@echo Detected new Galil driver - %GALIL_OLD_FILE% in %GALIL_OLD_DIR%
75+
copy /y "%GALIL_OLD_DIR%\%GALIL_OLD_FILE%" "%TEMP%\%GALIL_NEW_FILE%"
76+
set "DETECT_NEW_GALIL=YES"
77+
)
78+
if "%DETECT_OLD_GALIL%" == "YES" (
79+
if "%DETECT_NEW_GALIL%" == "YES" (
80+
@echo ERROR - both NEW and OLD GALIL driver appear enabled, this should not be possible
81+
exit /b 1
82+
)
7583
)
7684

7785
if "%1" == "RELEASE" (

0 commit comments

Comments
 (0)