WIX C++ Custom Action
- by Adrian Faciu
Hi,
I have a basic WIX custom action:
UINT __stdcall MyCustomAction(MSIHANDLE hInstaller)
{
DWORD dwSize=0;
MsiGetProperty(hInstaller, TEXT("MyProperty"), TEXT(""), &dwSize);
return ERROR_SUCCESS;
}
Added to the installer:
<CustomAction Id="CustomActionId" FileKey="CustomDll" DllEntry="MyCustomAction"/>
<InstallExecuteSequence>
<Custom Action="CustomActionId" Before="InstallFinalize" />
</InstallExecuteSequence>
The problem is that, no matter what i do, the handle hInstaller is not valid. I've set the action to commit, deferred, changed the place in InstallExecute sequence, hInstaller is always not valid.
Any help would be appreciated. Thanks.