Using Subscriptions in Basic MSI Dialogs

InstallShield 2015

The Windows Installer service provides volumes of information to the installation during the run time. One of the most useful ways to gather information during installation is to use subscriptions. To subscribe to something is commonly defined as entering one’s name for a publication or service. In Windows Installer terms, actions generally publish information, and dialog controls generally subscribe to information.

Examples of Common Uses for Subscriptions

The best example of this relationship centers around progress bars. The InstallFiles action publishes information on the percentage of files moved and the percentage remaining to be moved. When a progress bar subscribes to this information, it is able to accurately display the progress of the installation’s file transfer process.

Windows Installer tracks progress through what are called ticks. When your progress bar subscribes to this information, it is passed the ticksSoFar and totalTicks values. The progress bar uses this information to display the total progress of the installation.

Subscriptions are not used only for progress bars. You might have a custom action that validates a serial number as part of your installation. This action could publish the failure or success of validation. On a dialog, you could have a Next button that subscribes to this information. If the action publishes the failure of the validation, the button remains disabled. If the action publishes success, the button is enabled.

Types of Subscriptions

To set up a subscription for a control, use the Behavior area for a dialog in the Dialogs view. For more information, see Editing Dialog Behavior in Basic MSI Projects.

Following is a list of the available events to which controls can subscribe:

Types of Events to Which Controls Can Subscribe

Event

Description

ActionData

Displays information about the latest action.

A text control can subscribe to this event to display information such as the names of files that are being copied during the installation.

ActionProgress

Displays progress information about an action that is being monitored.

A progress bar control can subscribe to this event.

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

ActionText

Displays the name of the present action.

A text control can subscribe to this event to display a description of the current action that is being performed during the installation.

IgnoreChange

Highlights a folder in the current directory without opening the folder.

ScriptInProgress

Displays informational text while Windows Installer is compiling the installation's execution script.

SelectionAction

Displays a UI string that describes the highlighted item.

A text control can subscribe this event to display the UI string.

SelectionDescription

Displays a UI string in a text control. The UI string describes the feature that is selected in the selection tree control.

SelectionNoItems

Removes description text or disables an unnecessary button.

SelectionPath

Publishes the path of the item that is selected in the selection tree control.

A text control can subscribe this event to display the path.

SelectionPathOn

Publishes a Boolean value that indicates whether a selection path is associated with the currently selected feature.

SelectionSize

Publishes the size of the highlighted item.

SetProgress

Publishes information about the installation’s progress.

TimeRemaining

Publishes the approximate number of seconds that remain for the current progress sequence.

A text control can subscribe this event to display the remaining time.

See Also