Quiet Execution CustomAction

WiX Help

Quiet Execution CustomAction

There is a qtexec custom action that is part of the wixca that can run arbitrary command lines.

Immediate execution

<Property Id="QtExecCmdLine" Value="command line to run"/>
<CustomAction Id="QtExec" BinaryKey="wixca" DllEntry="CAQuietExec" Execute="immediate" Return="check"/>
<Binary Id="wixca" src="wixca.dll"/>
.
.
.
<InstallExecuteSequence>
    <Custom Action="QtExec" After="TheActionYouWantItAfter"/>
</InstallExecuteSequence>

This will result in running the command line in the immediate sequence. If the exit code of the command line is an error (not 0) then because Return is set to “check" it will cause the install to fail. You can change this value to “ignore" if you don’t want it to cause an install failure (it will be logged still).

If you want to run more than one command line in the immediate sequence then you’ll need schedule QtExec multiple times and set the QtExecCmdLine property (using a type 51 custom action) right before you want each of them executed.

Deferred execution

You can also run command lines in the differed script using this tool by setting the custom action data property. If the code is running in immediate mode it will try to execute the value of the QtExecCmdLine if it is running in deferred (or rollback) mode it will try to execute the value of the custom action data. The custom action data is a property that is named the same as the custom action. Here’s an example of authoring deferred command line execution:

<Property Id="QtExecDeferred" Value="command line to run"/>
<CustomAction Id="QtExecDeferred" BinaryKey="wixca" DllEntry="CAQuietExec" Execute="deferred" Return="check"/>
<Binary Id="wixca" src="wixca.dll"/>
.
.
.
<InstallExecuteSequence>
    <Custom Action="QtExecDeferred" After="TheActionYouWantItAfter"/>
</InstallExecuteSequence>