简体   繁体   中英

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?

属性名称区分大小写,“已安装”: https : //msdn.microsoft.com/zh-cn/library/windows/desktop/aa369297(v=vs.85).aspx

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM