我有一个基本的 WIX 自定义操作:
UINT __stdcall MyCustomAction(MSIHANDLE hInstaller)
{
DWORD dwSize=0;
MsiGetProperty(hInstaller, TEXT("MyProperty"), TEXT(""), &dwSize);
return ERROR_SUCCESS;
}
添加到安装程序:
<CustomAction Id="CustomActionId" FileKey="CustomDll" DllEntry="MyCustomAction"/>
<InstallExecuteSequence>
<Custom Action="CustomActionId" Before="InstallFinalize" />
</InstallExecuteSequence>
问题是,无论我做什么,句柄 hInstaller 都无效。我已将操作设置为提交、延迟、更改 InstallExecute 序列中的位置,hInstaller 始终无效。
任何帮助,将不胜感激。谢谢。