WiX CAQuietExec CustomAction停止安装

时间:2012-10-22 16:02:52

标签: installation wix burn wix3.6

我有一个带有一系列包的WiX Burn安装。

更新以/被动模式运行,无需用户交互。

最后一个包只在更新时运行,唯一的目的是运行一个可执行文件,它使用以下代码执行...

<!-- Quiet Execution Deferred execution with qtExec-->
<Property Id="QtExecDeferredExample" Value="&quot;C:\Program Files (x86)\Acme Inc\MyApp.exe&quot;"/>
<CustomAction Id="QtExecDeferredExample" BinaryKey="WixCA" DllEntry="CAQuietExec"
              Execute="deferred" Return="ignore" Impersonate="no"/>

<InstallExecuteSequence>
  <Custom Action="QtExecDeferredExample" Before="InstallFinalize"/>
</InstallExecuteSequence>

但是,尽管MyApp.exe启动,但在MyApp.exe退出之前,安装不会终止。显然,我希望应用程序启动,安装程序终止自己。

我无法修改CustomAction以在安装完成后运行..

<Custom Action="QtExecDeferredExample" After="InstallFinalize"/>

由于以下原因:

ICE77: QtExecDeferredExample is a in-script custom action.  
It must be sequenced in between the InstallInitialize action and the InstallFinalize action in the InstallExecuteSequence table

任何想法都赞赏。

更新: BrianJ的回答引导我回答。正如@escist所询问的那样,我的CA的相关部分如下:

    <!-- CA To set the property of the process to start-->
    <CustomAction
              Id        ="SetProcessToStart"
              BinaryKey ="WiXCustomActions"
              DllEntry  ="GetProcessToStart"
              Execute   ="immediate" />

    <!-- CA to start the process-->
    <CustomAction
              Id         ="StartApp"
              Directory  ="APPLICATIONROOTDIRECTORY"
              ExeCommand ="[PROCESSTOSTART]"
              Execute    ="deferred"
              Return     ="asyncNoWait"/>

  </Fragment>
</Wix>

和其他地方(有很多我的应用程序可以启动此过程,因此它的路径存储在注册表中)..

<Property Id="PROCESSTOSTART">[Not Set]</Property>
<InstallExecuteSequence>
  <!-- Use our Custom Action to set the PROCESSTOSTART property-->
  <!-- Custom Action to get the value from registry of the App that started the bootstrapper-->
  <Custom Action="SetProcessToStart" Before="LaunchConditions">NOT Installed</Custom>

  <!-- NOT installed ensures that the CA does not get fired on an uninstall -->
  <Custom Action="StartApp" Before="InstallFinalize">NOT Installed</Custom>
</InstallExecuteSequence>

1 个答案:

答案 0 :(得分:1)

将自定义操作中的“返回”值更改为Return="asyncNoWait"