Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to get the exit code of other application in nsis

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.

like image 479
user1234 Avatar asked Jan 30 '12 10:01

user1234


2 Answers

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:
like image 134
Daniel N Avatar answered Nov 15 '22 20:11

Daniel N


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

like image 23
Paul Hunt Avatar answered Nov 15 '22 18:11

Paul Hunt