Creating and Scheduling InstallScript Custom Actions that Call InstallScript Event Handlers for Basic MSI Projects
InstallShield 2016
For InstallShield 12 and later, the predefined InstallScript event handler functions are no longer available in Basic MSI projects with InstallScript custom actions. In InstallShield 11.5 and earlier, the following InstallScript event handler functions were available for Basic MSI projects and InstallScript MSI object projects:
InstallShield no longer supports these event handler functions for Basic MSI projects that have InstallScript custom actions. They are not called once the project is rebuilt with InstallShield 2016. Note that these event handler functions still compile in InstallShield 2016; they are just not called.
Similarly, these same predefined InstallScript event handler functions are not supported in InstallScript MSI object projects that are converted to merge module projects automatically when they are opened in InstallShield 2016. The functions are not called once the converted merge module project is built in InstallShield 2016.
If you have these events in your Basic MSI or InstallScript MSI object project and you upgrade your project to InstallShield 2016, you need to manually schedule custom actions that call the event handler functions. The following instructions explain how to do so.
To manually schedule InstallScript custom actions that call the predefined InstallScript event handler functions:
|
1.
|
Open the upgraded project in InstallShield 2016. |
|
2.
|
Make the appropriate changes to your InstallScript file: |
|
a.
|
In the View List under Behavior and Logic, click InstallScript. |
|
b.
|
Find the OnBegin, OnMoving, OnMoved, and OnEnd event handler functions in your script. You can quickly find a function by clicking the function name in the center pane of the view. |
|
c.
|
Rename the functions to an alternate name to avoid conflicts with existing function prototypes automatically included in ifx.h. For example: |
|
d.
|
Update the existing functions to take a single HWND parameter. For example: |
function MyOnBegin(hMSI) begin end;
|
e.
|
Add appropriate prototypes for these new functions: |
export prototype MyOnBegin(HWND);
export prototype MyOnEnd(HWND);
export prototype MyOnMoved(HWND);
export prototype MyOnMoving(HWND);
|
3.
|
Add InstallScript custom actions that call your renamed InstallScript event handler functions: |
|
a.
|
In the View List under Behavior and Logic, click Custom Actions and Sequences (in Basic MSI projects) or Custom Actions (in merge module projects). |
|
b.
|
In the center pane, right-click the Custom Actions explorer and then click New InstallScript. InstallShield adds an InstallScript custom action. |
|
c.
|
Type a name for the custom action; use the same name that you used to rename the InstallScript functions. For example: |
|
d.
|
Select the new InstallScript custom action that you created. |
|
e.
|
Set the Function Name setting to the name of the InstallScript function. |
|
f.
|
For the In-Script Execution setting, specify the value that is indicated in the table below. |
|
4.
|
Schedule the InstallScript custom action for the appropriate part of the installation: |
|
a.
|
In the View List under Behavior and Logic, click Custom Actions and Sequences. |
|
b.
|
Right-click the action or dialog that you want your InstallScript custom action to follow and click Insert. The Insert Action dialog box opens, providing a list of all the actions and dialogs that are currently associated with your project. |
|
c.
|
Select the InstallScript custom action that you created. If appropriate, enter a condition in the Condition box for launching the InstallScript event. |
To match the previous functionality as closely as possible, set the in-script execution in step 3f and schedule the InstallScript custom actions in step 4b as follows:
Scheduling the Custom Actions
|
|
|
MyOnBegin
|
Immediate (default)
|
One of the first actions in the Installation User Interface sequence.
|
MyOnMoving
|
Deferred in system context
|
In the Installation Execution sequence, between the InstallInitialize and AllocateRegistrySpace actions.
|
MyOnMoved
|
Deferred in system context
|
In the Installation Execute sequence, between the ScheduleReboot and InstallFinalize actions.
|
MyOnEnd
|
Immediate (default)
|
The last event in the Installation Execute sequence after the InstallFinalize action. (In previous releases, OnEnd was called after all other events as a result of the installation completing.)
|
Note the following:
|
•
|
Global variables and pointers are no longer maintained between individual InstallScript custom action calls. In addition, each InstallScript custom action initializes and uses its own individual SUPPORTDIR. Therefore, you cannot share information across individual calls using files in SUPPORTDIR. For more information, see Global Variables, Global Pointers, and SUPPORTDIR. |
Open topic with navigation