如何在nsis中获取其他应用程序的退出代码 [英] how to get the exit code of other application in nsis

查看:158
本文介绍了如何在nsis中获取其他应用程序的退出代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的.nsi文件中,我正在调用ExecWait '"$INSTDIR\application.exe" ' $0.在application.exe中,我将返回成功和失败的退出代码.如何在.nsi文件中捕获这些退出代码.

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.

推荐答案

如果执行ExecWait时出错,则传入的用户变量的内容不确定.

If there is an error performing ExecWait, then the contents of the user variable passed in is undefined.

要简单地检查程序是否正确执行,请检查错误标志. (顺便说一下,NSIS期望成功为零,错误为非零)

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:

这篇关于如何在nsis中获取其他应用程序的退出代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆