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

Behavior of MsiProcessMessage?


2 replies to this topic

antyagi

antyagi
  • Full Members
  • 121 posts

Posted 04 June 2007 - 07:13

Behavior of MsiProcessMessage looked strange to me.
I have a CA that looks like
CODE
UINT WINAPI MyMessenger ( MSIHANDLE hMsi )
{
MSIHANDLE hRecord = MsiCreateRecord ( 1 );
MsiRecordSetInteger ( hRecord, 1, 25001 );

int iRet = MsiProcessMessage ( hMsi, INSTALLMESSAGE(INSTALLMESSAGE_USER|MB_OK), hRecord );
if ( iRet == 0 )
 MessageBox ( NULL, _T("0 no action taken"), _T("info"), 0 );
else if ( iRet == IDOK )
 MessageBox ( NULL, _T("ok"), _T("info"), 0 );

MsiCloseHandle ( hRecord );

return ERROR_SUCCESS;
}

When this CA is placed in Sequence (UI or Execute) it works fine. And log looks like
QUOTE
MSI © (E0:38) [10:26:58:781]: Doing action: MyMessenger
Action 10:26:58: MyMessenger.
Action start 10:26:58: MyMessenger.
MSI © (E0:38) [10:26:58:859]: Creating MSIHANDLE (1) of type 790542 for thread 568
MSI © (E0:D4) [10:26:58:890]: Invoking remote custom action. DLL: C:\DOCUME~1\antyagi\LOCALS~1\Temp\MSI17A8.tmp, Entrypoint: MyMessenger
MSI © (E0:A8) [10:26:58:921]: Cloaking enabled.
MSI © (E0:A8) [10:26:58:937]: Attempting to enable all disabled priveleges before calling Install on Server
MSI © (E0:A8) [10:26:58:968]: Connected to service for CA interface.
MSI © (E0!10) [10:26:59:109]: Creating MSIHANDLE (2) of type 790531 for thread 3600
This message is coming from MyMessenger thru MsiProcessMessage.
MSI © (E0!10) [10:27:08:859]: Closing MSIHANDLE (2) of type 790531 for thread 3600
MSI © (E0:D4) [10:27:08:890]: Closing MSIHANDLE (1) of type 790542 for thread 568
Action ended 10:27:08: MyMessenger. Return value 1.

When this CA is placed in Event of Next button (of say Welcome dialog) it fails silently. And log looks like
QUOTE
MSI © (E0:BC) [10:27:10:000]: Doing action: MyMessenger
Action 10:27:10: MyMessenger.
Action start 10:27:10: MyMessenger.
MSI © (E0:BC) [10:27:10:078]: Creating MSIHANDLE (3) of type 790542 for thread 4028
MSI © (E0:B8) [10:27:10:140]: Invoking remote custom action. DLL: C:\DOCUME~1\antyagi\LOCALS~1\Temp\MSI17A9.tmp, Entrypoint: MyMessenger
MSI © (E0!FC) [10:27:10:218]: Creating MSIHANDLE (4) of type 790531 for thread 508
MSI © (E0!FC) [10:27:11:546]: Closing MSIHANDLE (4) of type 790531 for thread 508
MSI © (E0:B8) [10:27:11:593]: Closing MSIHANDLE (3) of type 790542 for thread 4028
Action ended 10:27:11: MyMessenger. Return value 1.

In the second case, when the CA is placed on Next button Event, the MsiProcessMessgae's return code is 0(ZERO) means No action was taken.

MSDN has no documentation for this behavior. Do you guyz have some idea?

  ankur tyagi

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 04 June 2007 - 10:58

From the help topic for the DoCation control event (which I guess you are using to call your custom action):
QUOTE
Note that custom actions launched by a DoAction ControlEvent can send a message with the Message Method, but cannot send a message with MsiProcessMessage. On systems prior to Windows Server 2003 family, custom actions launched by a DoAction ControlEvent cannot send messages with MsiProcessMessage or Message Method.


antyagi

antyagi
  • Full Members
  • 121 posts

Posted 04 June 2007 - 11:18

Oh! I should have looked at different side of help.

Anyways, in that case what could be the other way to show message from a CA (when called from DoAction event). Right now I am using MessageBox(). Because I can not pass window handle to a Windows Installer CA. to do this I have to make a std dll CA.
  ankur tyagi