使用 NSIS 的 ExecDos 插件获取批处理脚本 exitCode

Get batch script exitCode with ExecDos Plugin from NSIS

如何从批处理文件中获取 exitCode(以及写入 DetailView window 的输出)?

来自documention

Use 'wait' call if you want to get exit code. (/NOUNLOAD is mandatory!)

所以像这样:

ExecDos::wait /NOUNLOAD /DETAILED "$INSTDIR\bin\checkJavaVersion.bat"

(我还没有处理指定要输出到哪个 window)

如何访问退出代码?

你先exec然后你waitwait 不会启动该进程,因此您无法将命令行传递给它。您链接到的文档有一个示例:

ExecDos::exec /NOUNLOAD /ASYNC "$EXEDIR\consApp.exe" "test_login$\ntest_pwd$\n" "$EXEDIR\execdos.log"
Pop [=10=] # thread handle for wait
# you can add some installation code here to execute while application is running.
ExecDos::wait [=10=]
Pop  # return value
MessageBox MB_OK "Exit code "