DoAction Method (action)

Microsoft Deployment Compression & Installer

Copy image CopyHover image
Deployment Tools Foundation DoAction Method (action)
Deployment Tools Foundation NamespacesMicrosoft.Deployment.WindowsInstallerSessionDoAction(String)
Executes a built-in action, custom action, or user-interface wizard action.
Declaration Syntax
C# Visual Basic Visual C++
public void DoAction(
	string action
)
Public Sub DoAction ( 
	action As String
)
public:
void DoAction(
	String^ action
)
Parameters
action (String)
Name of the action to execute. Case-sensitive.
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.

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)