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

Custom Action not executing in Execute Sequence


3 replies to this topic

ConfigControl

ConfigControl
  • Full Members
  • 34 posts

Posted 13 May 2008 - 21:33

I just upgraded my Basic MSI projects to InstallShield 2008 and my Custom Action is not running completely.

The CA is an Installscript type and is set to run as Deferred in the Execute Sequence after the ScheduleReboot Action. I have a message box that does run but none of the other code runs. Also debug for the installscript only works in the User Interface sequence, as soon as the program goes to the Execute Sequence the debug never comes back. The program just continues until Finish dialog comes up. So I have not been able to step into the code in the CA.

I have tried changing the CA to Immediate but it runs before it is suppose to not at the end of the sequence.

I did read about using a special property “CustomActionData” but that does not help either. I set a message box to display the contents of the “CustomActionData” property just at the end to the User Interface sequence to ensure that my data was set and the data is correct.

The code that does not run is to launch an rtf file with wordpad and the dcomcnfg.exe so the user can configure the com object.


Any help would be appreciated,

ConfigControl

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 14 May 2008 - 20:16

QUOTE
I did read about using a special property “CustomActionData” but that does not help either. I set a message box to display the contents of the “CustomActionData” property just at the end to the User Interface sequence to ensure that my data was set and the data is correct.

That sounds like you misunderstood how CustomActionData works. - You shouldn't set CustomActionData, and it's value is not availble in immediate custom actions. Instead you set a property that has the same name as your (deferred) custom action, e.g. MyCustomAction. Then, inside that custom action, you can get this data from the built in property CustomActionData. That is: Windows Installer automatically sets CustomActionData to the value of the MyCustomAction property when it starts the MyCustomAction custom action.

ConfigControl

ConfigControl
  • Full Members
  • 34 posts

Posted 14 May 2008 - 21:02

Ok, I created a CA called MYCADATA and a property called MYCADATA. In the CA I set the Property Name to MYCADATA and the Property Value to CustomActionData.

I then have a CA named LastCA that has a MsiGetProperty for the MYCADATA but the property still returns nothing. The LastCA is a Deferred Execute at the end of the install.

ConfigControl

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 14 May 2008 - 21:18

Custom action MYCADATA:
Type 51 (set a property)
Property name: LastCA
Value: <the data you need in your script>

Custom action LastCA:
Type: InstallScript
Scheduling: Deferred in system context
In your script:
MsiGetProperty(..., "CustomActionData", ...)