Hello,
I'm attempting to add some validation into the install process so that if batch files fail due to missing files or Database servers failure etc the Installer will abort and rollback.
I assumed that by checking the return code, an invalid code would cause an error to be raised - however I think I may be confused as to whether it is viewer.exe returning the code or if it is the batch file.
The result of the actions specified below result in the pause of the batch file being hit, but after a key is pressed the installer carrys on regardless.
So, in the Commit section of the install sequence I have a "file attached to installation" action (source path: viewer.exe, source type: exe).
Command line: "[#install_lis.bat]" [APPDIR] [J2SDK_DIRECTORY]
And I've tried to add some protection in the batch file as follows:
@echo off
set APP_DIR=%1
set J2SDK_DIR=%2
set jintegra_jar=%APP_DIR%Sapphire\JIntegra\lib\jintegra.jar
cd %APP_DIR%Sapphire\JIntegra\lib
set classpath=%jintegra_jar%
set JAVA_HOME=%J2SDK_DIR%\bin
set path=%JAVA_HOME%
IF NOT EXIST jintegra.xml GOTO ERROR
echo Installing JIntegra License
java -cp jintegra.jar com.intrinsyc.license.JintegraLicenseTool clean
java -cp jintegra.jar com.intrinsyc.license.JintegraLicenseTool install
java -cp jintegra.jar com.intrinsyc.license.JintegraLicenseTool view
:END
REM No problem
exit 0
:ERROR
echo Problem found Installing JIntegra License
pause
exit 1
Thanks! And apologies for the long post.