hModule was passed via DllMain
PMSIHANDLE hDatabase = MsiGetActiveDatabase(hModule);
UINT u = MsiGetProperty(hModule, "INSTALLDIR",buffer,&cch);
and
MsiGetTargetPath(hModule, "INSTALLDIR",buffer,&cch);
Thanks
"oregonduckman" <oregon...@discussions.microsoft.com> wrote in message
news:532140F2-0822-406F...@microsoft.com...
char cReturn[MAX_PATH] = {0};
char buffer[MAX_PATH] = {0};
DWORD dwLength = MAX_PATH;
UINT u = MsiGetProperty(hModule, "[TARGETDIR]",buffer,&dwLength);
"oregonduckman" <oregon...@discussions.microsoft.com> wrote in message
news:8B741E46-A00F-43DB...@microsoft.com...
For a simple example of this in InstallScript, checkout:
http://www.installsite.org/pages/en/msi/ca.htm
Porting it to C++ shouldn't be too difficult.
Thanks for your help on this.
Type 51 CA MyCustomAction_CAD MyCustomAction [TARGETDIR] //
Immeadiate execution. Format [TARGETDIR] and assign it to the
property MyCustomAction
Type 1 CA: MyCustomAction Deferred NoImpersonation Msi Standard
Call DFF
When MyCustomAction is running access CustomActionData to see the
formatted value of [TARGETDIR]
For examples in InstallScript, see my article:
http://www.installsite.org/pages/en/msi/ca.htm ( Decode the
CustomActionData property in InstallScript )
Sorry Phil, Google posted that message out of sequence. I was
replying to the OP not you. You are correct, in this context the API
already knows it's being given a property name as an argument. In the
case of Formattable types/API's you would need brackets.