Using Standard Actions
[This is preliminary documentation and subject to change.]
You execute an action in the Microsoft® Windows® installer by calling the MsiDoAction function or by including the action in a sequence table. Since most actions encapsulate a single purpose, the most common way to use actions is to order a series of actions into a sequence to accomplish a larger task. The installer has three standard actions, called top-level actions, that call sequence tables. The three associated sequence tables can contain standard actions, custom actions, and user-interface elements. Each action in a sequence table has a condition and a sequence number. All actions in a sequence table are visited in order and are executed if the condition evaluates to True.
Many of the installer standard actions have sequence restrictions. For example, before calling the FileCost action, you must first call the CostInitialize action. Actions can be ordered in any manner in a sequence table as long as they follow all the sequencing restrictions. For more information on restrictions, see the individual action topic in Standard Actions Reference.
The INSTALL action is a top-level action that uses the sequence tables.
Example
When the INSTALL action is executed, a typical installation sequence would have the following execution flow:
-
LaunchConditions action is executed. All of the launch conditions must be satisfied for the installation to proceed.
-
AppSearch action is executed. This action determines if an application specified in the AppSearch table is installed on the computer. This action can be used to determine the presence of a previous version of the application to be installed.
-
CostInitialize action is executed. This action loads the Component table and the Feature table into memory to determine disk space requirements.
-
FileCost action is executed. This action uses the loaded Feature table and Component table to determine the size of all files to be installed.
-
CostFinalize action is executed. This action finalizes the costing information, taking into account the installation levels and conditions for selected features.
-
First installation dialog box displays.
If the entry in the sequence is not a standard action, the installer queries the CustomAction table to check whether the action is a registered custom action. If it is not a standard action or a custom action, the installer queries the user interface handler to check whether the action is a user interface element to be displayed.
-
Progress dialog box displays.
-
RegisterProduct action is executed. The product information is registered with the configuration manager.
-
InstallValidate action is executed. This action verifies that all volumes for which the cost has been determined have sufficient space for installation.
-
RegisterUser action is executed. This action registers user information in the configuration manager.
-
CreateFolders action is executed. This action creates empty folders for components set to be installed.
-
RemoveFiles action is executed. If there are files from a previous version, they are removed.
-
InstallFiles action is executed. All files from components set to be installed are copied to the appropriate directory.
-
MoveFiles action is executed. This action locates files that already exist on the user's computer and moves or copies those files to a new location.
-
WriteRegistryValues action is executed. This action writes application registry information into the registry.
-
CreateShortcuts action is executed. This action uses the Shortcut table to determine the shortcuts that must be copied to the computer.
-
ProcessComponents action is executed. This action registers the component information for the components set to be installed.
-
InstallFinalize action is executed. This action runs a script containing all operations spooled since the start for the installation.