Ajay
Ajay

Reputation: 18411

How to get "INSTALLED" property in Custom Action DLL (MSI/Wix)?

In my custom DLL I need to check if product is being installed or uninstalled, and hence need to get value of "INSTALLED" property (just like in WiX script). Here is what I am doing in C++ DLL:

WCHAR propValue[MAX_PATH];
DWORD propValLen = MAX_PATH;
// MSIHANDLE msiHandle; 
MsiGetProperty(msiHandle, L"INSTALLED", propValue, &propValLen);
propValue[propValLen] = 0;

But the outcome is always an empty string (for both installation and uninstallation)! How check if product is being installed or uninstalled?

Upvotes: 0

Views: 590

Answers (1)

dvorn
dvorn

Reputation: 3147

Property name is case-sensitive, it is "Installed": https://msdn.microsoft.com/en-us/library/windows/desktop/aa369297(v=vs.85).aspx

Upvotes: 3

Related Questions