NSIS 执行 exe 但不执行 运行 exe

NSIS executes exe but not running the exe

我目前正在尝试使用 NSIS 编译安装程序,但它无法正常工作。我有代码:

Section "Main" MAIN ; installs the primary

    DetailPrint "Starting setup..."
    SectionIn RO
    File "setup.exe"
    ExecWait "$INSTDIR\setup.exe"
    Delete "$INSTDIR\setup.exe"

SectionEnd

完成的安装程序说它正在执行 setup.exe 但它没有打开,几乎在日志消息之后它说安装程序已经完成。我以前正是使用这段代码来安装示例可执行文件,但现在我无法将其安装到 运行。可执行文件在 NSIS 之外工作正常。有人知道为什么我的安装程序不会 运行 可执行文件吗?

我在任何地方都没有看到对 SetOutPath 的调用,您确定 setup.exe 确实存在吗?

一个最小的例子是:

OutFile test.exe
RequestExecutionLevel user
InstallDir $temp\Test

Section
InitPluginsDir
SetOutPath $pluginsdir
File "setup.exe"
ExecWait "$pluginsdir\setup.exe"
Delete "$pluginsdir\setup.exe"
SetOutPath $Temp ; Don't lock pluginsdir
SectionEnd

ExecWait 可能失败的另一个原因是如果您开始的事情需要提升而您没有提升,那么您必须使用 ExecShell...