Run DLL attributes (MSI)

Reference information
Project page Action Sequences, Dialogs and Billboards
Related topics Working with attribute panes
External links External link Windows Installer documentation

Introduction

A Run DLL action executes a subroutine in separate DLL. The subroutine must have the following prototype:

UINT __stdcall FuncName(MSIHANDLE hSession);

The hSession parameter is a handle to the current MSI installation session. The function must return one of the following values:

Return value Meaning
ERROR_SUCCESS (0) Action completed successfully.
ERROR_NO_MORE_ITEMS (259) Action succeeded, but skip remaining actions.
ERROR_INSTALL_USEREXIT (1602) Action was cancelled by the user.
ERROR_INSTALL_FAILURE (1603) Action failed.
ERROR_FUNCTION_NOT_CALLED (1626) Action was not executed.

Note: This action combines the functionality of MSI custom actions #1 and #17.

Tarma note The Tarma Installer equivalent is Run DLL.

Attributes

This pane contains the following attributes and options.

Attribute Description
Name

Enter the name of the action. This name must be unique among all actions in the same action sequence and must not be the name of a standard action or dialog box.

Description Enter the localizable description of the action. This description is displayed in progress messages in the installer while the action is executing.
Stored file

Select this option and enter the path to the external DLL that must be stored in the current package for subsequent execution, or click ... (browse) to open a standard Open dialog box that allows you to browse for the desired DLL. (This option corresponds to MSI custom action #1.)

Install file

Select this option and enter the (symbolic) path to the installation file that must be executed, or click ... (browse) to open the Select Installation File or Folder dialog box that allows you to browse for the desired file. (This option corresponds to MSI custom action #17.)

Entry point

Enter the name of the DLL entry point to call. If the DLL function is called FuncName, then the entry point's name will be _FuncName@4 (decorated according to the __stdcall convention) unless you specifically export the function under a different name.

Condition

Enter the conditional expression that determines if the action will be executed, or leave empty for unconditional execution.

Note: Windows Installer does not accept the Tarma-specific extended syntax in conditional expressions. In particular, you can not use the symbolic execution context <...> to refer to variables, registry values, INI file values, or to perform runtime functions.

Run

Select the action's scheduling option from the drop-down list:

  • Always - Action is executed in each action sequence in which it appears.
  • Once - Action is executed only in the first action sequence in which it appears.
  • Once per process - Action is executed only in the first action sequence in which it appears, if the action sequences run in the same process.
  • If UI has run - Action is executed only if a user interface action sequence has already been run.
Execution

Select the action's in-script scheduling option from the drop-down list:

  • Immediate - Execute immediately
  • Deferred - Queue for execution in the installation script
  • Rollback - Queue for execution during a rollback of the installation script
  • Commit - Queue for execution during a committal of the installation script
  • Deferred, System - As Deferred, but runs in system context
  • Rollback, System - As Rollback, but runs in system context
  • Commit, System - As Commit, but runs in system context
  • Deferred, TS-aware - As Deferred, but runs with user impersonation on Terminal Server systems
  • Rollback, TS-aware - As Rollback, but runs with user impersonation on Terminal Server systems
  • Commit, TS-aware - As Commit, but runs with user impersonation on Terminal Server systems
Asynchronous Check this box to run the DLL function asynchronously; clear it for synchronous execution. With synchronous execution, the installer waits for the DLL function to complete before continuing with the next action; with asynchronous execution the installer immediately continues with the next action.
Ignore return value Check this box to ignore the DLL function's return value; clear it to respond to its return value. In particular, if the DLL function returns a nonzero return value and this option is cleared, the action will fail. A return value of ERROR_SUCCESS (0) indicates success.