Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

OnMoved() Event fehlt bei InstallShield 2010


2 replies to this topic

Burhan

Burhan
  • Full Members
  • 17 posts

Posted 16 June 2010 - 14:19

Hallo,
ich habe unser altes "Basic MSI" Projekt nach InstallShield 2010 Premier Edition konvertiert. Dabei habe ich festgestellt, dass die ganzen Event Handler OnBegin(), OnMoving(), OnMoved() und OnEnd() nicht mehr unterstützt werden.
Ich habe jetzt einen Knowledgebase Artikel gefunden, der beschreibt, dass man diese Event Handlers in Custom Actions umschreiben muss und dann in die Sequenzen einfügen muss. Das habe ich auch getan, aber nur das OnBegin() hat funktioniert, die anderen nicht. Beim Debuggen ist er nur in das OnBegin() reingesprungen und nicht in die anderen Breakpoints (OnEnd, OnMoving etc.)

Hier ist die Beschreibung (auf Englisch):

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:

•OnBegin
•OnMoving
•OnMoved
•OnEnd
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 2010. Note that these event handler functions still compile in InstallShield 2010; 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 2010. The functions are not called once the converted merge module project is built in InstallShield 2010.

If you have these events in your Basic MSI or InstallScript MSI object project and you upgrade your project to InstallShield 2010, you need to manually schedule custom actions that call the event handler functions. The following instructions explain how to do so.


Task

To manually schedule InstallScript custom actions that call the predefined InstallScript event handler functions:

1.Open the upgraded project in InstallShield 2010.
1.Make the appropriate changes to your InstallScript file:
a.In the View List under Behavior and Logic, click InstallScript.
a.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.
a.Rename the functions to an alternate name to avoid conflicts with existing function prototypes automatically included in ifx.h. For example:
■MyOnBegin
■MyOnMoving
■MyOnMoved
■MyOnEnd
a.Update the existing functions to take a single HWND parameter. For example:
function MyOnBegin(hMSI) begin end;

a.Add appropriate prototypes for these new functions:
export prototype MyOnBegin(HWND);

export prototype MyOnEnd(HWND);

export prototype MyOnMoved(HWND);

export prototype MyOnMoving(HWND);

1.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).
a.In the center pane, right-click the Custom Actions explorer and then click New InstallScript. InstallShield adds an InstallScript custom action.
a.Type a name for the custom action; use the same name that you used to rename the InstallScript functions. For example:
■MyOnBegin
■MyOnMoving
■MyOnMoved
■MyOnEnd
a.Select the new InstallScript custom action that you created.
a.Set the Function Name setting to the name of the InstallScript function.
a.For the In-Script Execution setting, specify the value that is indicated in the table below.
1.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.
a.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.
a.Select the InstallScript custom action that you created. If appropriate, enter a condition in the Condition box for launching the InstallScript event.
a.Click OK.
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
Custom Action
In-Script Execution
Location in the Sequence

MyOnBegin
Immediate (default)
In the Installation User Interface sequence just after the SetupCompleteSuccess dialog. (In previous releases, OnBegin was called as a result of the ISMsiServerStartup custom action being called.)

MyOnMoving
Deferred in system context
In the Installation User Interface sequence just after the SetupCompleteSuccess dialog. (In previous releases, OnBegin was called as a result of the ISMsiServerStartup custom action being called.)

MyOnMoved
Deferred in system context
In the Installation Execute sequence, between the ScheduleReboot and InstallFinalize actions.

MyOnEnd
Deferred in system context
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.)


Irgendeine Idee ???

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 17 June 2010 - 08:19

Schreib doch mal eine Logdatei um zu sehen, ob Windows Installer die Custom Actions überhaupt aufruft. Außerdem würde ich mich nicht auf den Debugger verlassen, sondern füge doch am Anfang jeder Funktion einen MsgBox Aufruf ein.

Burhan

Burhan
  • Full Members
  • 17 posts

Posted 22 June 2010 - 13:55

Die Message Boxen kommen tatsächlich. Ist natürlich trotzdem nicht so toll, dass man diese Aktionen dann nicht debuggen kann.
Vielen Dank nochmal.