安装程序等待 EXE 为 运行 作为安装期间的自定义操作

Installer waiting when EXE is run as custom action during installation

我正在使用 WIX 安装 Mosquitto,复制文件后,我正在尝试使用自定义操作 运行 mosquitto.exe。它会启动一个新的命令提示符,安装会在那里暂停。只有当我终止该命令提示符时它才会恢复。下面是我的代码。

<Feature Id="ProductFeature" Title="MosquittoInstaller" Level="1">
  <ComponentGroupRef Id="MosquittoFilesGroup"/>
    </Feature>
<InstallExecuteSequence>
  <Custom Action="RunMosquitto" Before="InstallFinalize" />
</InstallExecuteSequence>


  <Directory Id="TARGETDIR" Name="SourceDir">
  <Directory Id="INSTALLLOCATION">
    <Directory Id="KubeInstallDir" Name="Kube2.0">
      <Directory Id="MyProgramDir" Name="Mosquitto" />
    </Directory>
  </Directory>
</Directory>
<CustomAction Id='RunMosquitto'  FileKey="fil7D28AEF774656849395A2FA20A5C963D"  Execute="deferred" ExeCommand='-v' Return="check" HideTarget="no" Impersonate="no"/>

我在这里做错了什么?请指教

安装暂停,因为在您的自定义操作中,您有 Return="check"。有关 Return 属性的更多信息,请参阅 CustomAction documentation

Return="asyncNoWait"就是你想要的。

然而,the WiX documentation for running a program after install显示了不同的方式:

<Property Id="WixShellExecTarget" Value="[#myapplication.exe]" />
<CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />