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

How to terminate installation from DLL


4 replies to this topic

David Bajgar

David Bajgar
  • Members
  • 33 posts

Posted 05 February 2002 - 15:27

Hello,
My installation calls the DLL function. In a special case I need to terminate the installation in the DLL code. How can I do this? Is there any msi function?

Thanks in advance.


Kurt Schneider

Kurt Schneider
  • Members
  • 98 posts

Posted 05 February 2002 - 15:37

Make a call to MsiSetProperty and set a property to some value.  Call up the exit dialog if the property is = to the value you set for failure.  This is easiest if the dll is called from within the UI part of the sequence, because it can be set up as part of a dialog controls behavior, but the same logic should work during the execute sequence.  I just haven't tried it.

Kurt Schneider


David Bajgar

David Bajgar
  • Members
  • 33 posts

Posted 06 February 2002 - 09:04

Yes, I think it will work, but it is not very good solution for me, because I am creating the merge module and I don't want to perform any actions after inserting this merge module. I only want to call this DLL function and that is all.

Thanks anyway for your reply


Ian Blake

Ian Blake
  • Members
  • 483 posts

Posted 06 February 2002 - 10:05

return ERROR_INSTALL_FAILURE;

Is the normal way for a DLL to terminate unsuccessfully.  I normally end a problem with something like this.

PMSIHANDLE hError;
hError=MsiCreateRecord(2);
MsiRecordSetInteger(hError, 1, MyErrorCode );
MsiProcessMessage(hInstaller, INSTALLMESSAGE_FATALEXIT, hError);
return ERROR_INSTALL_FAILURE;


David Bajgar

David Bajgar
  • Members
  • 33 posts

Posted 06 February 2002 - 16:12

It works fine.
Thanks a lot for your help.