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

Msi return code in case custom action dll crashes


3 replies to this topic

saurabhgupta1403

saurabhgupta1403
  • Full Members
  • 17 posts

Posted 28 October 2010 - 15:16

Hello All,

I have made an msi and created some custom actions using windows dll. The custom action type is 1025 which indicated that the return code of custom action is not ignored.

However, in some scenario, my custom action dll crashes (in the sense that some erroneous code executes. e.g. accessing a null assigned pointer etc. ). But still the msi is returning success and says that it has successfully installed the product.

In my opinion, msi should report failure in installation. Any idea of this behavior.

Thanks in advance.

akerl

akerl
  • Full Members
  • 104 posts

Posted 31 October 2010 - 10:57

What kind of returncode send the custom action dll back to installer session?

Andreas Kerl

Inside Windows Installer 4.5
ISBN 3-86645-431-7


Zweitze

Zweitze
  • Full Members
  • 522 posts

Posted 05 November 2010 - 12:43

DLL custom actions have a return value, which determines the next action. Returning 0 means all is OK and the install should continue. 2 means that the CA received a request by the user to cancel the install. 3 means the CA experienced a failure condition which is not communicated to the user yet.
More values exist, for instance a request for an immediate reboot or a request for a reboot at the end.

Make sure your function returns the right value.

VBScab

VBScab
  • Full Members
  • 436 posts

Posted 05 November 2010 - 15:48

You've both missed the point, I think. The OP wants to deal with a catastrophic failure of his CA.

@OP, if you'd like the behaviour of the Windows Installer engine changed, perhaps you should participate in the WI team's MSDN blogs and/or Webinars. I wouldn't expect any change in your lifetime, though, given the need to cater for backwards compatibility with older packages.

I think you need to set up a flag of some kind (something as crude as a registry setting, for example). Your CA's function call would then delete the flag on completion. The package then executes a subsequent CA which checks for the presence of the flag and branches accordingly.

Edited by VBScab, 05 November 2010 - 15:48.

- Don't know why 'x' happened? Want to know why 'y' happened? ProcMon will tell you.
- Try using http://www.google.com before posting.
- I answer questions only via forums. Please appreciate the time I give here and don't send me personal emails.