Alex Rivera | Logout

how to get the exit code of other application in nsis

Asked 2012-01-30T10:35:49.660
8

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.

Edit
Report

1 Answer

11

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:
answered 2012-02-02T16:37:43.073

Your Answer