how to get the exit code of other application in nsis

为君一笑 提交于 2019-12-12 12:34:04

问题


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.


回答1:


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:



回答2:


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



来源:https://stackoverflow.com/questions/9062518/how-to-get-the-exit-code-of-other-application-in-nsis

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!