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

Retrieving a message from the error table


2 replies to this topic

anthonyh

anthonyh
  • Full Members
  • 93 posts

Posted 03 October 2002 - 14:42

What's the best way to get a message from the error table in a custom action written in C.  Should I use the open database view, and view execute api's? Or is there s simplier way using one of the other record api's?
  I want to get the string so that I can display it in a messagebox with the yes/no buttons.


Thanks,
Anthony
Product Availability Developer
Avantis
Invensys Process Systems

Using InstallShield Developer 7.04 - Basic Project

Ian Blake

Ian Blake
  • Members
  • 483 posts

Posted 03 October 2002 - 16:16

Maybe you can create your message like this.

PMSIHANDLE hRec = MsiCreateRecord(NumberOfParams+1);
MsiSetRecordInt(hRec, 1, ErrorNumber);
MsiSetRecordString(hRec, 2, Param1);
...
...
MsiSetRecordString(hRec, N+1, ParamN);
Result =MsiProcessMessage(hMsi,INSTALLMESSAGE_USER | MB_YESNO, hRec);
if (Result == IDYES)
{
 // User responded yes
}
else if (Result == IDNO)
{
 // User responder no
}
Ian Blake
(Currently Unemployed)

anthonyh

anthonyh
  • Full Members
  • 93 posts

Posted 03 October 2002 - 20:21

Thanks, that works great. Much better then what I had.

The command wasn't completely right, but close enough, I figured out the rest. The correct one is:
MsiProcessMessage( hInstall, INSTALLMESSAGE( INSTALLMESSAGE_USER | MB_YESNO | MB_DEFBUTTON2 ), hRec );



Anthony
Product Availability Developer
Avantis
Invensys Process Systems

Using InstallShield Developer 7.04 - Basic Project