Hi all,

I am trying to detect whether a user cancels within a custom action by doing
the following

UINT __stdcall CA()
{
    int retVal = 0;
    PMSIHANDLE hRecord = MsiCreateRecord(1);
    ...
     SomeLongOperation(); // trigger cancellation while this function is
running

    MsiRecordSetString(hRecord, 0, L"[1]");
    MsiRecordSetString(hRecord, 1, L"Some Message");
    retVal = MsiProcessMessage(hInstall, INSTALLMESSAGE_INFO, hRecord);
    if(retVal == IDCANCEL)
    {
        MsiLogWrapper(L"User cancellation is detected!");
        return ERROR_USER_EXIT;
    }
    else
    {
        MsiLogWrapper(L"MsiProcessMessage() returned %d", retVal);
    }
    ...
}

The problem is that the value returned by MsiProcessMessage() is always 0.
And I've confirmed that the installation was cancelled during the
SomeLongOperation() was running,
and the string L"Some Message" is properly logged. What is wrong in this
case? am I missing anything?
The CA is scheduled to be a deferred and no-impersonate action.
------------------------------------------------------------------------------
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to