Custom Action Type 2

From wixwiki.com

Jump to: navigation, search

A type 2 custom action runs an executable, and the executable is stored in the Binary table/stream. The CustomAction Element documentation and the MSDN documentation are very helpful.

Attributes

BinaryKeyThe Id of an entry in the binary table
ExeCommandThe command line arguments

Notes

The EXE is actually stored in the binary table, and if the EXE is unusually large this will have a considerable impact on the resulting .MSI size.

The EXE should not depend upon any external DLLs or other EXEs other than system DLLs, and even then these should only be ones that are common to all operating systems.

The "ExeCommand" attribute specifies the command line arguments.

Sample

<!--
  Copy an EXE into the binary table
-->
<Binary 
    Id="SampleEXE" 
    SourceFile="CustomActions\Sample.exe" />

<!--
  Define the custom action
-->
<CustomAction 
    Id="SampleExe" 
    BinaryKey="SampleExe" 
    ExeCommand="-CommandLine Switches -Go Here" />

<!--
  Invoke the custom action
-->
<InstallExecuteSequence>
  <Custom 
      Action="SampleExe" 
      After="AppSearch" />
</InstallExecuteSequence>

Guide to CustomActions

Personal tools