Event Handlers

InstallShield 2014 » InstallScript Language Reference

Project: InstallScript event handlers are available in the following project types:

InstallScript
InstallScript MSI

Some exceptions exist for an InstallScript package that is included in an Advanced UI or Suite/Advanced UI installation. These are described below.

About Event Handlers

InstallScript installations are driven by the InstallScript engine, which generates a series of events in a specific order. These events trigger software handlers that execute installation instructions. For example, shortly after an installation is loaded, it generates an event called Begin, which triggers the execution of an event handler called OnBegin. This handler specifies the instructions to carry out when the Begin event occurs. Other events occur in the installation to trigger other handlers. Together, the event handlers perform the work of installing the application.

A portion of an InstallScript MSI installation is driven by the InstallScript engine, and a portion is driven by the Windows Installer engine. The portion that is driven by the InstallScript engine uses a series of event handlers, similar to InstallScript installations.

Several types of event handlers are available:

Global Event Handlers
Feature Event Handlers
Miscellaneous Event Handlers
Advanced Event Handlers

When you create an InstallScript or InstallScript MSI project, InstallShield generates a set of default global event handlers, each of which is a function that is written in the InstallScript language. Likewise, when you add features to your project, InstallShield generates a set of default event handlers for that feature. You can override or customize any or all of the event handlers.

It is important to note that, in an event-driven script, event-handler functions are called even if they do not explicitly appear in the InstallScript view.

Order of Event Handlers

Global and feature event handlers are always called in a specific order; which event handlers are called depends on the type of installation (normal installation, maintenance installation, administrative installation, or patch installation). Because miscellaneous event handlers respond to events that may not happen during installation, they are not necessarily called in a specific order, if they are called at all.

Project: When an InstallScript MSI major upgrade is uninstalling an earlier version of a product, none of the InstallScript event handlers are called.

First-Time Installations

OnBegin
OnCCPSearch
OnAppSearch
OnFirstUIBefore
OnGeneratingMSIScript (InstallScript MSI only)
OnMoving
feature Installing events
OnInstallFilesActionBefore
OnGeneratedMSIScript (InstallScript MSI only)
OnInstallFilesActionAfter
feature Installed events
OnMoved
OnFirstUIAfter
OnEnd

Resumed Installations

OnResumeUIAfter (InstallScript MSI only)
OnResumeUIBefore (InstallScript MSI only)

Maintenance Installations

OnBegin
OnMaintUIBefore
OnGeneratingMSIScript (InstallScript MSI only)
OnMoving
feature Installing or Uninstalling events
OnInstallFilesActionBefore
OnInstallFilesActionAfter
feature Installed or Uninstalled events
OnMoved
OnGeneratedMSIScript (InstallScript MSI only)
OnMaintUIAfter
OnEnd

Patch Installations

OnPatchUIBefore (InstallScript MSI only)
OnGeneratingMSIScript (InstallScript MSI only)
OnMoving
feature Installing or Uninstalling events
OnInstallFilesActionBefore
OnInstallFilesActionAfter
feature Installed or Uninstalled events
OnMoved
OnGeneratedMSIScript (InstallScript MSI only)
OnPatchUIAfter (InstallScript MSI only)

Exceptions for an InstallScript Package That Is Included in an Advanced UI or Suite/Advanced UI Installation

If you include an InstallScript installation as an InstallScript package in an Advanced UI or Suite/Advanced UI project, the Advanced UI or Suite/Advanced UI installation displays its own user interface (UI) while automatically suppressing the UI of the InstallScript package. To make these changes possible, the Advanced UI or Suite/Advanced UI installation uses several Advanced UI– or Suite/Advanced UI–specific InstallScript events and functions by default, and ignores some of the standard InstallScript events and functions. For more information, see Adding an InstallScript Package to an Advanced UI or Suite/Advanced UI Project.

Thus, depending on the installation state (first-time installation, maintenance, or update), OnSuiteShowUI ignores the UI events such as OnFirstUIBefore and OnFirstUIAfter and instead calls the following events:

First-time installationOnSuiteInstallBefore, OnSuiteInstallAfter
MaintenanceOnSuiteMaintBefore, OnSuiteMaintAfter
UpdateOnSuiteUpdateBefore, OnSuiteUpdateAfter

All other events and event call sequencing in an InstallScript package that is launched from an Advanced UI or Suite/Advanced UI installation remain the same as in an InstallScript installation that is launched separately from an Advanced UI or Suite/Advanced UI installation, or that is launched as an executable package from an Advanced UI or Suite/Advanced UI installation.

See Also