如何从批处理文件中获取exitCode(以及写入DetailView窗口的输出)?
来自documention:
使用'等待'如果你想获得退出代码,请打电话。 (/ NOUNLOAD是强制性的!)
这样的事情:
ExecDos::wait /NOUNLOAD /DETAILED "$INSTDIR\bin\checkJavaVersion.bat"
(我还没有处理指定输出到哪个窗口)
如何访问exitCode? p>
答案 0 :(得分:1)
您首先是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"