Mike
2004-04-02 21:51:46 UTC
I have written a custom action that uses MsiProcessMessage to write an item to
the log file. This custom action successfully writes to the log when I
sequence it in one of the sequence tables. However, when calling this custom
action from a dialog event, the action runs successfully but no message is
logged. I wrote a sample function to investigate this behavior further. Here
is the function I used for testing.
UINT __stdcall WriteToLog(MSIHANDLE hInstall)
{
MSIHANDLE hRecord;
UINT uiStat;
hRecord = MsiCreateRecord(1);
uiStat = MsiRecordSetString(hRecord,1,"Mike's Test Log Message");
uiStat = MsiRecordSetString(hRecord,0,"[1]");
uiStat = MsiProcessMessage(hInstall,INSTALLMESSAGE_INFO,hRecord);
MsiCloseHandle(hRecord);
return ERROR_SUCCESS;
}
When it runs from a sequence table, uiStat=1 after the MsiProcessMessage call,
indicating success. When called from a dialog event the return is 0,
indicating no action was taken. Any insight into the cause of this behavior
would be appreciated.
Thanks,
Mike
the log file. This custom action successfully writes to the log when I
sequence it in one of the sequence tables. However, when calling this custom
action from a dialog event, the action runs successfully but no message is
logged. I wrote a sample function to investigate this behavior further. Here
is the function I used for testing.
UINT __stdcall WriteToLog(MSIHANDLE hInstall)
{
MSIHANDLE hRecord;
UINT uiStat;
hRecord = MsiCreateRecord(1);
uiStat = MsiRecordSetString(hRecord,1,"Mike's Test Log Message");
uiStat = MsiRecordSetString(hRecord,0,"[1]");
uiStat = MsiProcessMessage(hInstall,INSTALLMESSAGE_INFO,hRecord);
MsiCloseHandle(hRecord);
return ERROR_SUCCESS;
}
When it runs from a sequence table, uiStat=1 after the MsiProcessMessage call,
indicating success. When called from a dialog event the return is 0,
indicating no action was taken. Any insight into the cause of this behavior
would be appreciated.
Thanks,
Mike