DoAction Method (action, actionData)

Microsoft Deployment Compression & Installer

Copy image CopyHover image
Deployment Tools Foundation DoAction Method (action, actionData)
Deployment Tools Foundation NamespacesMicrosoft.Deployment.WindowsInstallerSessionDoAction(String, CustomActionData)
Executes a built-in action, custom action, or user-interface wizard action.
Declaration Syntax
C# Visual Basic Visual C++
public void DoAction(
	string action,
	CustomActionData actionData
)
Public Sub DoAction ( 
	action As String,
	actionData As CustomActionData
)
public:
void DoAction(
	String^ action, 
	CustomActionData^ actionData
)
Parameters
action (String)
Name of the action to execute. Case-sensitive.
actionData (CustomActionData)
Optional data to be passed to a deferred custom action.
Remarks

The DoAction method executes the action that corresponds to the name supplied. If the name is not recognized by the installer as a built-in action or as a custom action in the CustomAction table, the name is passed to the user-interface handler object, which can invoke a function or a dialog box. If a null action name is supplied, the installer uses the upper-case value of the ACTION property as the action to perform. If no property value is defined, the default action is performed, defined as "INSTALL".

Actions that update the system, such as the InstallFiles and WriteRegistryValues actions, cannot be run by calling MsiDoAction. The exception to this rule is if DoAction is called from a custom action that is scheduled in the InstallExecuteSequence table between the InstallInitialize and InstallFinalize actions. Actions that do not update the system, such as AppSearch or CostInitialize, can be called.

If the called action is a deferred, rollback, or commit custom action, then the supplied actionData will be available via the CustomActionData property of that custom action's session.

Win32 MSI API: MsiDoAction

Exceptions
Exception Condition
InvalidHandleException the Session handle is invalid
InstallCanceledException the user exited the installation

Assembly: Microsoft.Deployment.WindowsInstaller (Module: Microsoft.Deployment.WindowsInstaller.dll) Version: 3.0.0.0 (3.9.1006.0)