You can't do this in C#. You need a C++ uninstall custom action that has code something like this:
PMSIHANDLE hRec = MsiCreateRecord(2); MsiRecordSetString(hRec,0,"your message"); UINT uiRet = MsiProcessMessage(hInstall,INSTALLMESSAGE(INSTALLMESSAGE_USER |dwOptions),hRec);
The first handle is the one that Windows gives you asa C++ custom action parameter, the second is the handle from creating a record containing the message. MSI is nothing to do with C# or .NET. It's a Win32 framework that Visual Studio adds some help to for calling .NET code.
I don't know why you're doing this anyway. The standard rule is that user-created data stays behind, so just leave it behind. If I uninstalled Word it wouldn't be asking me about uninstalling all my Word documents.
Phil Wilson |