Fetchez la vache
Fetchez la vache

Reputation: 5230

WiX CAQuietExec CustomAction halts installation

I have an WiX Burn install with a chain of packages.

Updates are run in /passive mode requiring no user interaction.

The last package is only run on an update, and the sole purpose is to run an executable, which it does using the following code..

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

However, although MyApp.exe starts, the installation will not terminate until MyApp.exe exits. Obviously I want the app to start and the Installer to terminate its self.

I cannot amend the CustomAction to run After Install finalise..

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

Because of the following:

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

Any ideas appreciated.

Update: BrianJ's answer lead me to the answer. As @escist has inquired, The pertinent part of my CA is as follows:

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

and elsewhere (there are a number of my apps that could have started this process, so the path to that is stored in the registry)..

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

Upvotes: 3

Views: 1671

Answers (1)

BryanJ
BryanJ

Reputation: 8563

Change the value of "Return" in your custom action to Return="asyncNoWait".

Upvotes: 1

Related Questions