Description
Specifies a custom action to be added to the MSI CustomAction table.
Derived By
Extending string
Attributes
| Name |
Type |
Required? |
Default |
Description |
| Id |
string |
No |
|
The identifier of the custom action.
|
| BinaryKey |
string |
No |
|
This attribute is a reference to a Binary element with matching Id attribute.
|
| FileKey |
string |
No |
|
This attribute specifies a reference to a File element with matching Id attribute that will execute the custom action code in the file after the file is installed.
|
| Property |
string |
No |
|
This attribute specifies a reference to a Property element with matching Id attribute that specifies the Property to be used or updated on execution of this custom action.
|
| Directory |
string |
No |
|
This attribute specifies a reference to a Directory element with matching Id attribute containing a directory path.
|
| DllEntry |
string |
No |
|
This attribute specifies the name of a function in a custom action to execute.
|
| ExeCommand |
string |
No |
|
This attribute specifies the command line parameters to supply to an externally run executable.
|
| JScriptCall |
string |
No |
|
This attribute specifies the name of the JScript function to execute in a script.
|
| VBScriptCall |
string |
No |
|
This attribute specifies the name of the VBScript Subroutine to execute in a script.
|
| Script |
NMTOKEN (restriction) |
No |
|
Creates a type 37 or 38 custom action.
|
| SuppressModularization |
YesNoType |
No |
|
Use to suppress modularization of this custom action name in merge modules.
|
| Value |
string |
No |
|
This attribute specifies a string value to use in the custom action.
|
| Error |
string |
No |
|
This attribute specifies an index in the MSI Error table to use as an error message for a type 19 custom action that displays the error message and aborts a product's installation.
|
| Return |
NMTOKEN (restriction) |
No |
|
Set this attribute to set the return behavior of the custom action.
|
| Execute |
NMTOKEN (restriction) |
No |
|
This attribute indicates the scheduling of the custom action.
|
| Impersonate |
YesNoType |
No |
|
This attribute specifies whether the Windows Installer, which executes as LocalSystem, should impersonate the user context of the installing user when executing this custom action.
|
| PatchUninstall |
YesNoType |
No |
|
This attribute specifies that the Windows Installer, execute the custom action only when a patch is being uninstalled.
|
| Win64 |
YesNoType |
No |
|
Specifies that a script custom action targets a 64-bit platform.
|
| TerminalServerAware |
YesNoType |
No |
|
This attribute specifies controls whether the custom action will impersonate the installing user during per-machine installs on Terminal Server machines.
|
| HideTarget |
YesNoType |
No |
|
Ensures the installer does not log the CustomActionData for the deferred custom action.
|
Content Model
Contains text only.
Referenced By
Remarks
Various combinations of the attributes for this element correspond to different custom action types. For more information about custom actions see the Custom Action Types topic on MSDN.
Definition
<xs:element name="CustomAction">
<xs:annotation>
<xs:appinfo>
<xse:seeAlso ref="Custom" xmlns:xse="http://schemas.microsoft.com/wix/2005/XmlSchemaExtension" />
<xse:seeAlso ref="CustomActionRef" xmlns:xse="http://schemas.microsoft.com/wix/2005/XmlSchemaExtension" />
<xse:msiRef table="CustomAction" href="http://msdn.microsoft.com/library/aa368062.aspx" xmlns:xse="http://schemas.microsoft.com/wix/2005/XmlSchemaExtension" />
</xs:appinfo>
<xs:documentation>
Specifies a custom action to be added to the MSI CustomAction table. Various combinations of the attributes for this element
correspond to different custom action types. For more information about custom actions see the
<html:a href="http://msdn.microsoft.com/library/aa372048.aspx" target="_blank" xmlns:html="http://www.w3.org/1999/xhtml">
Custom Action Types</html:a> topic on MSDN.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:annotation>
<xs:documentation>
The text node is only valid if the Script attribute is specified. In that case, the text node contains the script to embed.
</xs:documentation>
</xs:annotation>
<xs:attribute name="Id" type="xs:string">
<xs:annotation>
<xs:documentation>
The identifier of the custom action.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<!-- CustomAction Source specification, sets source Attribute bits -->
<xs:attribute name="BinaryKey" type="xs:string">
<xs:annotation>
<xs:documentation>
This attribute is a reference to a Binary element with matching Id attribute. That binary stream contains
the custom action for use during install. The custom action will not be installed into a target directory. This attribute is
typically used with the DllEntry attribute to specify the custom action DLL to use for a type 1 custom action, with the ExeCommand
attribute to specify a type 17 custom action that runs an embedded executable, or with the VBScriptCall or JScriptCall attributes
to specify a type 5 or 6 custom action.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="FileKey" type="xs:string">
<xs:annotation>
<xs:documentation>
This attribute specifies a reference to a File element with matching Id attribute that
will execute the custom action code in the file after the file is installed. This
attribute is typically used with the ExeCommand attribute to specify a type 18 custom action
that runs an installed executable, with the DllEntry attribute to specify an installed custom
action DLL to use for a type 17 custom action, or with the VBScriptCall or JScriptCall
attributes to specify a type 21 or 22 custom action.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="Property" type="xs:string">
<xs:annotation>
<xs:documentation>
This attribute specifies a reference to a Property element with matching Id attribute that specifies the Property
to be used or updated on execution of this custom action. This attribute is
typically used with the Value attribute to create a type 51 custom action that parses
the text in Value and places it into the specified Property. This attribute is also used with
the ExeCommand attribute to create a type 50 custom action that uses the value of the
given property to specify the path to the executable. Type 51 custom actions are often useful to
pass values to a deferred custom action.
See <html:a href="http://msdn.microsoft.com/library/aa370543.aspx" target="_blank" xmlns:html="http://www.w3.org/1999/xhtml">
http://msdn.microsoft.com/library/aa370543.aspx</html:a>
for more information.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="Directory" type="xs:string">
<xs:annotation>
<xs:documentation>
This attribute specifies a reference to a Directory element with matching Id attribute containing a directory path.
This attribute is typically used with the ExeCommand attribute to specify the source executable for a type 34
custom action, or with the Value attribute to specify a formatted string to place in the specified Directory
table entry in a type 35 custom action.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<!-- CustomAction Target specification, sets target Attribute bits -->
<xs:attribute name="DllEntry" type="xs:string">
<xs:annotation>
<xs:documentation>
This attribute specifies the name of a function in a custom action to execute.
This attribute is used with the BinaryKey attribute to create a type 1 custom
action, or with the FileKey attribute to create a type 17 custom action.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="ExeCommand" type="xs:string">
<xs:annotation>
<xs:documentation>
This attribute specifies the command line parameters to supply to an externally
run executable. This attribute is typically used with the BinaryKey attribute for a type 2 custom action,
the FileKey attribute for a type 18 custom action, the Property attribute for a type 50 custom action,
or the Directory attribute for a type 34 custom action that specify the executable to run.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="JScriptCall" type="xs:string">
<xs:annotation>
<xs:documentation>
This attribute specifies the name of the JScript function to execute in a script. The script must be
provided in a Binary element identified by the BinaryKey attribute described above. In other words, this
attribute must be specified in conjunction with the BinaryKey attribute.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="VBScriptCall" type="xs:string">
<xs:annotation>
<xs:documentation>
This attribute specifies the name of the VBScript Subroutine to execute in a script. The script must be
provided in a Binary element identified by the BinaryKey attribute described above. In other words, this
attribute must be specified in conjunction with the BinaryKey attribute.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="Script">
<xs:annotation>
<xs:documentation>
Creates a type 37 or 38 custom action. The text of the element should contain the script to be embedded in the package.
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="jscript" />
<xs:enumeration value="vbscript" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="SuppressModularization" type="YesNoType">
<xs:annotation>
<xs:documentation>
Use to suppress modularization of this custom action name in merge modules.
This should only be necessary for table-driven custom actions because the
table name which they interact with cannot be modularized, so there can only
be one instance of the table.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="Value" type="xs:string">
<xs:annotation>
<xs:documentation>
This attribute specifies a string value to use in the custom action. This attribute
must be used with the Property attribute to set the property as part of a
type 51 custom action or with the Directory attribute to set a directory path in that
table in a type 35 custom action. The value can be a literal value or derived from a
Property element using the <html:a href="http://msdn.microsoft.com/library/aa368609.aspx" target="_blank" xmlns:html="http://www.w3.org/1999/xhtml">Formatted</html:a>
syntax.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="Error" type="xs:string">
<xs:annotation>
<xs:documentation>
This attribute specifies an index in the MSI Error table to use as an error message for a
type 19 custom action that displays the error message and aborts a product's installation.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<!-- Other CustomAction type attributes -->
<xs:attribute name="Return">
<xs:annotation>
<xs:documentation>
Set this attribute to set the return behavior of the custom action.
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="asyncNoWait">
<xs:annotation>
<xs:documentation>
Indicates that the custom action will run asyncronously and execution may continue after the installer terminates.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="asyncWait">
<xs:annotation>
<xs:documentation>
Indicates that the custom action will run asynchronously but the installer will wait for the return code at sequence end.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="check">
<xs:annotation>
<xs:documentation>
Indicates that the custom action will run synchronously and the return code will be checked for success. This is the default.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="ignore">
<xs:annotation>
<xs:documentation>
Indicates that the custom action will run synchronously and the return code will not be checked.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="Execute">
<xs:annotation>
<xs:documentation>
This attribute indicates the scheduling of the custom action.
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="commit">
<xs:annotation>
<xs:documentation>
Indicates that the custom action will run after successful completion of the installation script (at the end of the installation).
</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="deferred">
<xs:annotation>
<xs:documentation>
Indicates that the custom action runs in-script (possibly with elevated privileges).
</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="firstSequence">
<xs:annotation>
<xs:documentation>
Indicates that the custom action will only run in the first sequence that runs it.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="immediate">
<xs:annotation>
<xs:documentation>
Indicates that the custom action will run during normal processing time with user privileges. This is the default.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="oncePerProcess">
<xs:annotation>
<xs:documentation>
Indicates that the custom action will only run in the first sequence that runs it in the same process.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="rollback">
<xs:annotation>
<xs:documentation>
Indicates that a custom action will run in the rollback sequence when a failure
occurs during installation, usually to undo changes made by a deferred custom action.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="secondSequence">
<xs:annotation>
<xs:documentation>
Indicates that a custom action should be run a second time if it was previously run in an earlier sequence.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="Impersonate" type="YesNoType">
<xs:annotation>
<xs:documentation>
This attribute specifies whether the Windows Installer, which executes as LocalSystem,
should impersonate the user context of the installing user when executing this custom action.
Typically the value should be 'yes', except when the custom action needs elevated privileges
to apply changes to the machine.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="PatchUninstall" type="YesNoType">
<xs:annotation>
<xs:documentation>
This attribute specifies that the Windows Installer, execute the custom action only when
a patch is being uninstalled. These custom actions should also be conditioned using the
MSIPATCHREMOVE property to ensure proper down level (less than Windows Installer 4.5)
behavior.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="Win64" type="YesNoType">
<xs:annotation>
<xs:documentation>
Specifies that a script custom action targets a 64-bit platform. Valid only when used with
the Script, VBScriptCall, and JScriptCall attributes.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="TerminalServerAware" type="YesNoType">
<xs:annotation>
<xs:documentation>
This attribute specifies controls whether the custom action will impersonate the
installing user during per-machine installs on Terminal Server machines.
Deferred execution custom actions that do not specify this attribute, or explicitly set it 'no',
will run with no user impersonation on Terminal Server machines during
per-machine installations. This attribute is only applicable when installing on the
Windows Server 2003 family.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="HideTarget" type="YesNoType">
<xs:annotation>
<xs:documentation>Ensures the installer does not log the CustomActionData for the deferred custom action.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:anyAttribute namespace="##other" processContents="lax">
<xs:annotation>
<xs:documentation>
Extensibility point in the WiX XML Schema. Schema extensions can register additional
attributes at this point in the schema.
</xs:documentation>
</xs:annotation>
</xs:anyAttribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
</xs:element>