Action Editor

Each event represents something that can happen at run time. When an event is triggered, any actions that were added to it will be performed.

Note: Some events contain special event variables that are local to the event and contain more information about the event.

There are three categories of events in Setup Factory:

 

Project Events

The following describes the four main project events that are fired at different points in the install as well as an error event. You can access these events by choosing Project > Actions... from the program menu.

On Startup

This event is fired at the start of the setup, before any screens are shown. If you want to provide some visible feedback, you can use Dialog or StatusDlg actions, or instead, create the actions on a screen event.

On Pre Install

This event is fired after all of the Before Installing screens have been shown and before the installation of the files begin. No screen is visible during this process. If you want to provide some visible feedback, you can use Dialog or StatusDlg actions, or instead, create the actions on a screen event.

On Install Error

This event is fired when an error occurs during the setup allowing you to handle it in a custom way. If you would like to ignore the error that just occurred, you can call the Application.IgnoreLastError action on this event to ignore the last error that occurred. The following setup errors can be handled on this event: 120, 121, 123, 125, 126, 127, 129, 130, 140, 142, 143, 144, 145, 146, 147 and 148.

Note: This event will NOT be fired if the setup is exited through script or if the user aborted the setup.

The following event variables are automatically set whenever this event is triggered:

e_ErrorCode

(number) The numeric error code that was returned by the setup.

e_ErrorMsgID

(string) The error message string identifier of the error that was returned by the setup.

Note: In order to retrieve the message text for the error, you need to call the SetupData.GetLocalizedString action and pass it the value of e_ErrorMsgID.

On Post Install

This event is fired after all of the files have been installed - after the While Installing screen has been shown, but before the After Installing screens. No screen is visible during this process.  If you want to provide some visible feedback, you can use Dialog or StatusDlg actions, or instead, create the actions on a screen event.

On Shutdown

This event is fired on completion of the install, after all of the After Installing screens have been shown. No screen is visible during this process. If you want to provide some visible feedback, you can use Dialog or StatusDlg actions, or instead, create the actions on a screen event.

Screen Events

The following describes all of the possible events that may be fired from a screen. You can find these events on the Actions tab of each screen's properties dialog.

Note: Some events will already contain action script and should not be modified unless you want to customize the default behavior of the screen.

On Back

This event is fired when the Back button is clicked. Normally the Screen.Back action is used here.

On Cancel

This event is fired when the Cancel button, the close button on the title bar, or the Esc key is pressed. Normally the Application.Exit action is used here.

On Ctrl Message

This event is fired when any control on the screen fires a message. You can use this event to respond to any control message. To respond to the message, event variables need to be consulted.

The following event variables are automatically set whenever this event is triggered:

e_CtrlID

(number) The control id of the control that spawned the event.

e_MsgID

(number) The id of the notification message that was fired from the screen control. Each type of control contains its own unique message IDs. These message ids are defined under each control type's topic.

e_Details

(table) An optional table of details that the control might include.  In order to respond to this properly you must consult the specific control type in order to determine what the contents of this table will be.  If no details are included, this table will be passed as nil.

On Finish

This event is fired when a progress type of screen has completed its progress actions.

On Help

This event is fired when the Help button is clicked.

On Next

This event is fired when the Next button is clicked. Normally the Screen.Next action is used here.

On Preload

This event is fired before the screen is displayed.

Note: At this point the screen and its controls have been created so they can be accessed via Dlg***.SetProperties and Dlg***.GetProperties actions. During that process any session variables used on the screen were expanded, therefore any changes made to the session variables on the On Preload event have no effect on the screen. All changes to session variables must be made earlier in the install, or by re-setting the control's text using the Dlg***.SetProperties actions.

On Progress

This event is fired every time progress is made while installing or uninstalling files during the setup.

The following event variables are automatically set whenever this event is triggered:

e_Stage

(number) The progress stage that the install/uninstall is currently in. One of the following stages will be returned:

CONSTANT

VALUE

DESCRIPTION

INSTALL_STAGE_PREPARING

1

The setup is preparing to install the files.

INSTALL_STAGE_INSTALLING_FILES

2

The setup is in the process of installing the files.

INSTALL_STAGE_CREATING_UNINSTALL

3

The setup is creating the uninstall for the application.

INSTALL_STAGE_CREATING_SHORTCUTS

4

The setup is creating shortcuts on the user's system.

UNINSTALL_STAGE_REMOVING_FILES

1

The uninstall is removing files from the user's system.

UNINSTALL_STAGE_REMOVING_SHORTCUTS

2

The uninstall is removing shorcuts from the user's system.

e_CurrentItemText

(string) A string containing the current item's details. This text is normally displayed above the progress meter as a description of what is currently occurring in the install. For example, this text may contain the name of the current file that is being installed.

e_CurrentItemPct

(number) A value (between 1 and 100) that represents the percentage of the current process that has been completed. For example, when installing files, each file being installed will have its own percentage value returned.

e_StagePct

(number) A value (between 1 and 100) that represents the percentage of the install/uninstall stage that has been completed so far. Possible install/uninstall stages can be found in the e_Stage table above.

On Start

This event is fired from a progress type screen to start its progress actions.

Uninstall Events

On Startup

This event is fired at the start of the uninstall process, before any screens are shown. If you want to provide some visible feedback, you can use Dialog or StatusDlg actions, or instead, create the actions on a screen event.

On Pre Uninstall

This event is fired after all of the Before Uninstalling screens have been shown and before the uninstallation of the files begin. No screen is visible during this process. If you want to provide some visible feedback, you can use Dialog or StatusDlg actions, or instead, create the actions on a screen event.

On Uninstall Error

This event is fired when an error occurs during the setup's uninstall, allowing you to handle it in a custom way. If you would like to ignore the error that just occurred, you can call the Application.IgnoreLastError action on this event to ignore the last error that occurred. The following setup errors can be handled on this event: 120, 121, 123, 125, 126, 127, 129, 130, 140, 142, 143, 144, 145, 146, 147 and 148.

Note: This event will NOT be fired if the setup is exited through script or if the user aborted the setup.

The following event variables are automatically set whenever this event is triggered:

e_ErrorCode

(number) The numeric error code that was returned by the uninstall.

e_ErrorMsgID

(string) The error message string identifier of the error that was returned by the uninstall.

Note: In order to retrieve the message text for the error, you need to call the SetupData.GetLocalizedString action and pass it the value of e_ErrorMsgID.

On Post Uninstall

This event is fired after all of the files have been uninstalled - after the While Uninstalling screen has been shown but before the After Uninstalling screens. No screen is visible during this process.  If you want to provide some visible feedback, you can use Dialog or StatusDlg actions, or instead, create the actions on a screen event.

On Shutdown

This event is fired on completion of the uninstall, after all of the After Uninstalling screens have been shown. No screen is visible during this process. If you want to provide some visible feedback, you can use Dialog or StatusDlg actions, or instead, create the actions on a screen event.