Event Handlers
InstallShield 2020 » InstallScript Language Reference
Project:InstallScript event handlers are available in the following project types:
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:
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
|
•
|
feature Installing events |
|
•
|
feature Installed events |
Resumed Installations
Maintenance Installations
|
•
|
feature Installing or Uninstalling events |
|
•
|
feature Installed or Uninstalled events |
Patch Installations
|
•
|
feature Installing or Uninstalling events |
|
•
|
feature Installed or Uninstalled events |
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:
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
Dialog Functions
Dialog Customization Functions