3

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>
Yan Sklyarenko
  • 31,557
  • 24
  • 104
  • 139
Fetchez la vache
  • 4,940
  • 4
  • 36
  • 55

1 Answers1

1

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

BryanJ
  • 8,485
  • 1
  • 42
  • 61
  • That causes a compilation error like `The CustomAction/@Return attribute's value, 'asyncNoWait', cannot be specified without attribute ExeCommand present. ` – escist Apr 23 '14 at 06:38
  • A little late to mark this as the answer, so apologies. @escist - will update my original question with my working custom action. – Fetchez la vache Apr 23 '14 at 15:01