【问题标题】:WiX CAQuietExec CustomAction halts installationWiX CAQuietExec CustomAction 停止安装
【发布时间】:2012-10-22 16:02:52
【问题描述】:

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

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

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

<!-- 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>

【问题讨论】:

  • 您能找到解决此问题的方法吗?

标签: installation wix burn wix3.6


【解决方案1】:

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

【讨论】:

  • 这会导致像The CustomAction/@Return attribute's value, 'asyncNoWait', cannot be specified without attribute ExeCommand present. 这样的编译错误
  • 将其标记为答案有点晚了,所以很抱歉。 @escist - 将使用我的自定义操作更新我的原始问题。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2019-01-27
  • 1970-01-01
  • 1970-01-01
  • 2023-04-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多