简体   繁体   English

EXE作为自定义操作在安装过程中运行时,安装程​​序正在等待

[英]Installer waiting when EXE is run as custom action during installation

I am installing Mosquitto using WIX and once the files are copied I'm trying to run the mosquitto.exe using a custom action. 我正在使用WIX安装Mosquitto,一旦文件被复制,我将尝试使用自定义操作运行mosquitto.exe。 It launches a new command prompt and the installation pauses there. 它启动一个新的命令提示符,安装在那里暂停。 It resumes only when I terminate that command prompt. 仅当我终止该命令提示符时,它才会恢复。 Below is my code. 下面是我的代码。

<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"/>

What am I doing wrong here? 我在这里做错了什么? Please advice. 请指教。

The installation pauses because in your custom action, you have Return="check" . 安装暂停是因为在您的自定义操作中,您具有Return="check" See the CustomAction documentation for more information regarding the Return attribute. 有关Return属性的更多信息,请参见CustomAction文档

Return="asyncNoWait" is what you want. Return="asyncNoWait"是您想要的。

However, the WiX documentation for running a program after install shows a different way: 但是, 用于在安装后运行程序的WiX文档显示了另一种方式:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM