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

CA 1 DLL detecting ERROR_SUCCESS?


3 replies to this topic

jonty

jonty
  • Members
  • 6 posts

Posted 26 March 2003 - 14:48

I have a DLL that performs my custom action to determine if a particular service is running. If it find the service then it returns ERROR_SUCCESS, but if the service is not running then it returns -1. Now that I have the DLL loaded in the Binary table and declared in the CustomAction table, how do I detect the return status?

I would like to have a dialog box that says that it is checking for the service. If the service if found then the next dialog should be displayed, but if it is not found then I need to display a message saying that it was not found then jump to the finished dialog box.

Any help would be appreciated.

rmadassery77

rmadassery77
  • Members
  • 52 posts

Posted 26 March 2003 - 19:21

hi there,
1)
If you could have your DLL set a property with the return value, you can terminate the install (jump to Finish dialog) in this way:

In the CA table enter a CA Type 19, Source=blank, Target=Your message

In any Sequence Table call the CA and give the condition eg., MYDLLRETURNVAL=-1
2)
In case you want a dialog to be dispayed while installation of the msi, like service check in progress, you can create a custom dialog and introduce between any standard dialog (preferably after InstallProgress) and then call the CA (of above) in the dialog as :

If you have a pushbutton control in your custom dialog, write an event DoAction like
Event       : DoAction
Argument  : your CA name
Condition  : 1

In this case you shouldnt be adding the CA in Sequence table as in 1), ie sequence shoule be none.

While install your custom dialog appears and if the service check fails CA will terminate the install and jump to finish dialog.
Rajiv Madassery
Galway Scripting Center
Digital GlobalSoft Ltd.
(Subsidiary of Hewlett-Packard Company)

jonty

jonty
  • Members
  • 6 posts

Posted 31 March 2003 - 11:09

Rajiv,

I understood that the condition column of the InstallExecuteSequence was processed before the action takes place to determine whether or not to execute the action. Your suggestion is that the condition column can be used to determine the result of the action. Is this correct? Can you give me an example of where this has worked for you? I don't want to ask the developers to change the CA unless I can be sure that this will work.

As for using the dialog controls, that was very useful, but is there a control that I can use which will automatically execute rather than expecting the user to click a button, and if so how?

Thanks,

Jonty Lovell

rmadassery77

rmadassery77
  • Members
  • 52 posts

Posted 31 March 2003 - 19:14

Hi Jonty,

1) I think that you daont have to modify ur dll a lot. You said it returns -1 on failure (service not running). Just use the MsiSetProperty function to set a public property to your return value from dll. CA Type 19 is guaranteed to work. Let me tell you a real time scenario : I had an msi that should run on NT only with SP 6 installed. So I check for MDAC (MS Data Access Comp) on the machine, if not msi should terminate install. I use a reg search using Reglocator and get the result in a property (default=0). Then I check the condition in CA Type 19 and force a termination if the property is still 0. It works.

2) I suppose you already have a custom dialog. You can therefore sequence the above CA Type 19 in InstallUISequence after this dialog, the CA will execute and stop install when reqd. Just let go all the event driven logic in my prev tip and call the CA in a sequence.

I hope this helps.
Rajiv Madassery
Galway Scripting Center
Digital GlobalSoft Ltd.
(Subsidiary of Hewlett-Packard Company)