如何从批处理文件中获取 exitCode(以及写入 DetailView 窗口的输出)?
从文档:
如果您想获取退出代码,请使用“等待”调用。(/NOUNLOAD 是强制性的!)
所以像这样:
ExecDos::wait /NOUNLOAD /DETAILED "$INSTDIR\bin\checkJavaVersion.bat"
(我还没有处理指定输出到哪个窗口)
我如何访问退出代码?
你先是exec
你wait
。wait
不会启动该进程,因此您无法将命令行传递给它。您链接到的文档有一个示例:
ExecDos::exec /NOUNLOAD /ASYNC "$EXEDIR\consApp.exe" "test_login$\ntest_pwd$\n" "$EXEDIR\execdos.log"
Pop $0 # thread handle for wait
# you can add some installation code here to execute while application is running.
ExecDos::wait $0
Pop $1 # return value
MessageBox MB_OK "Exit code $1"
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句