Script by Der-Matze
Comments and improvements welcome
Tested with opsi 4.0.1
Tested with opsi-winst 4.10.x - 4.11.1.6
Tested with Windows XP Professional and Windows 7 Enterprise x64
Subscript that checks all available nullsoft exitcodes, writes the definition of the encountered exitcode to the logfile and determines if the installation was successful or not.
Makes debugging installations easier and assures that failed installations show up as failed in configed.
Usage:
Winbatch_Install sub "%ScriptDrive%\install\check_exitcode\check_nullsoft-exitcode.ins"
;Den ExitCode des Installers abfragen set $ExitCode$ = getLastExitCode ;Loglevel anpassen setLogLevel = 4 ;Den ExitCode auswerten if ($ExitCode$ = "0") setLogLevel = 5 comment "ExitCode = "+$ExitCode$+" Normal execution (no error)" setLogLevel = 4 endif if ($ExitCode$ = "1") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" Installation aborted by user (cancel button)" isFatalError endif if ($ExitCode$ = "2") setLogLevel = 5 logError "ExitCode = "+$ExitCode$+" Installation aborted by script" isFatalError endif ;Loglevel anpassen setLogLevel = 6