Using Control Events in Basic MSI Dialogs

InstallShield 2015

Control events enable you to provide custom functionality for each control on your dialogs. With control events, you can launch custom actions, spawn new dialogs, or display a progress bar. Many control events make use of published information. In some cases, your controls must subscribe to control-event information in order to make use of it.

To associate an event with a control, use the Behavior area for a dialog in the Dialogs view. For more information, see Editing Dialog Behavior in Basic MSI Projects. To learn about subscriptions for controls, see Using Subscriptions in Basic MSI Dialogs.

To specify a condition for any event, click the ellipsis button (...) in the event setting.

Following is a list of the available control events:

Types of Events for Controls

Control Event

Description

AddLocal

Sets the specified feature (or all features, if ALL is specified) to be installed locally.

To specify the feature, configure this setting's subsetting.

AddSource

Sets the specified feature (or all features, if ALL is specified) to be installed to run from source.

To specify the feature, configure this setting's subsetting.

CheckExistingTargetPath

Verifies that the specified path can be written to, and prevents additional control events from being triggered unless the specified path exists.

To specify the property that contains the path, configure this setting's subsetting.

CheckTargetPath

Prevents additional control events from being triggered unless the specified value is a valid path.

To specify the property that contains the path, configure this setting’s subsetting.

DirectoryListNew

Notifies the directory list control that a new folder must be created. The installer then creates a new folder and allows the user to enter a new name for the folder.

DirectoryListOpen

Notifies the directory list control to open the selected directory. If none is selected, it prevents additional control events from being triggered.

DirectoryListUp

Notifies the directory list control to go up a level, selecting the parent of the current directory.

DoAction

Triggers a custom action when the selected control is activated.

To specify the custom action, configure this setting’s subsetting.

EnableRollback

Enables or disables rollback functionality for the installation.

To specify whether you want the event to enable rollback, configure this setting’s subsetting. A value of True enables rollback; False disables it.

EndDialog

Dismisses a modal dialog. You can use this event for a push button control or a selection tree control.

To specify the behavior that should occur for this event, configure this setting’s subsetting.

For regular dialogs, available options are:

Exit—The dialog sequence closes and control is returned to the installer with the UserExit value. This option cannot be used with child windows.
Retry—The dialog sequence closes and control is returned to the installer with the Suspend value. This option cannot be used with child windows.
Ignore—The dialog sequence closes and control is returned to the installer with the Finished value. This option cannot be used with child windows.
Return—The dialog exits and control is returned to the parent window. If no parent exists, control is returned to the installer with the Success value.

For error dialogs, available options are:

ErrorOK
ErrorCancel
ErrorAbort
ErrorRetry
ErrorIgnore
ErrorYes
ErrorNo

MsiLaunchApp

Note: Windows Installer 5 includes support for this event. Earlier versions of Windows Installer ignore this event. Therefore, if your installation is run on a system that has Windows Installer 4.5 or earlier and you want to use this event, add a condition to the dialog control so that it is not displayed on systems that have Windows Installer 4.5 or earlier.

Runs a specified file.

This event is typically used for a check box control on the SetupCompleteSuccess dialog. The check box enables end users to choose whether to run the application at the end of the installation. The check box control should include a condition that prevents the control from being displayed during uninstallation.

To specify the command line for launching the file, configure this setting’s subsetting.

MsiPrint

Note: Windows Installer 5 includes support for this event. Earlier versions of Windows Installer ignore this event. Therefore, if your installation is run on a system that has Windows Installer 4.5 or earlier and you want to use this event, add a condition to the dialog control so that it is not displayed on systems that have Windows Installer 4.5 or earlier.

Enables end users to print the contents of the control.

You can add this event to a push button control that is on a dialog that has a scrollable text control. When an end user clicks the push button control, the contents of the scrollable text control are printed.

NewDialog

Advances to another dialog.

To specify the new dialog, configure this setting’s subsetting.

Reinstall

Reinstalls the specified feature (or all features, if ALL is specified).

To specify the feature, configure this setting’s subsetting.

Remove

Indicates that the specified feature (or all features, if ALL is specified) is selected for removal.

To specify the feature, configure this setting’s subsetting.

Reset

Resets all of the property changes that all of the controls on the dialog have performed to their original values.

RMShutdownAndRestart

Indicates that the Restart Manager should shut down all applications that have files in use and restart them at the end of the installation.

SelectionBrowse

Launches the specified Browse dialog that enables the end user to modify the path of the highlighted item.

To specify the dialog, configure this setting’s subsetting.

SetInstallLevel

Sets the INSTALLLEVEL property to the specified value.

To specify the appropriate installation level, configure this setting’s subsetting.

SetProperty

Sets the value of a property.

To specify the property and value, configure this setting’s subsettings.

SetTargetPath

Checks and sets the selected path.

To specify the property that contains the path, configure this setting’s subsetting.

SpawnDialog

Launches the specified dialog of a modal dialog without closing the current dialog.

SpawnWaitDialog

Launches a dialog that waits until the conditional expression evaluates as True; then the dialog closes.

ValidateProductID

Sets the ProductID property.

See Also