In my .nsi file I am calling ExecWait '"$INSTDIR\application.exe" ' $0
. In application.exe I am returning exit codes for success and failures. How to catch those exit codes in .nsi file.
If there is an error performing ExecWait, then the contents of the user variable passed in is undefined.
To simply check if the program executed correctly or not, check the error flag. (btw, NSIS expects zero for success and non-zero for error)
ClearErrors
ExecWait '"$INSTDIR\application.exe"'
IfErrors 0 noError
; Handle error here
noError:
The exit code of the application will be stored in the variable that is passed as the 2nd argument to ExecWait, so $0 in your example.
http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.1.4
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With