Reputation: 496
I have c++ console application and i want to get the msi installed application INSTALLDIR(the value where is software actually installed). I have applications product code.
What is the correct way to do this?
Upvotes: 1
Views: 549
Reputation: 20780
MsiGetProductInfo for the location only if your setup has a type 51 custom action that sets ARPINSTALLLOCATION to the actual installation folder. Not all of them do.
Upvotes: 1
Reputation: 496
It seems that this code works just fine:
wchar_t installDirPrev[4096];
DWORD isBuffer = 4096;
MsiGetProductInfo(productCode, INSTALLPROPERTY_INSTALLLOCATION, installDirPrev, &isBuffer);
Upvotes: 1