我有一个数据驱动的自定义操作,我将它与表数据一起定义在它自己的文件中。当我运行我的安装时,它会失败,因为缺少自定义表(我已经和Orca检查过了,它不在那里)。
我意识到需要以某种方式引用这个片段,我在问题10339055和6344608中注意到了这个建议。
按照6344608中的建议,我将自定义操作定义移动到与表数据相同的片段中,如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?include $(sys.CURRENTDIR)\Config.wxi?>
<Fragment>
<CustomTable Id="AscomDeviceProfiles">
<Column Id="ProgId" Type="string" PrimaryKey="yes" Category="Text" />
<Column Id="ChooserName" Type="string" />
<Row>
<Data Column="ProgId">ASCOM.Driver.Type</Data>
<Data Column="ChooserName">$(var.InstallName)</Data>
</Row>
</CustomTable>
<!-- Define the custom actions that will process the above table data -->
<Binary Id="binRegAscomDeviceProfiles" SourceFile="$(var.Wix.RegisterAscomDeviceProfiles.TargetDir)\$(var.Wix.RegisterAscomDeviceProfiles.TargetName).CA.dll" />
<!-- Register and check the return code - must run as "immediate" in order to access session data -->
<CustomAction Id="caRegisterAscomDeviceProfiles" BinaryKey="binRegAscomDeviceProfiles" DllEntry="RegisterAscomDeviceProfiles" Execute="immediate" Return="check" />
<!-- Unregister and ignore return code (allows uninstall to succeed even if ASCOM is broken) -->
<CustomAction Id="caUnregisterAscomDeviceProfiles" BinaryKey="binRegAscomDeviceProfiles" DllEntry="UnregisterAscomDeviceProfiles" Execute="immediate" Return="ignore" />
</Fragment>
</Wix>在我的Product.wxs文件中,我通过调度自定义操作来引用它,如下所示:
<InstallExecuteSequence>
<Custom Action="PreventDowngrading" After="FindRelatedProducts">NEWERPRODUCTFOUND AND NOT Installed</Custom>
<RemoveExistingProducts Before='InstallInitialize' />
<!-- Elevate to admin if required -->
<Custom Action='IsPrivileged' Before='LaunchConditions'>Not Privileged</Custom>
<!-- Create ASCOM device profiles during install finalize phase, but not if already installed -->
<Custom Action="caRegisterAscomDeviceProfiles" Before="InstallFinalize">NOT Installed</Custom>
<!-- Remove ASCOM device profiles during uninstall (but not maintenance mode) -->
<Custom Action="caUnregisterAscomDeviceProfiles" Before="RemoveFiles">REMOVE ~= "ALL"</Custom>
</InstallExecuteSequence>这正确地引入了自定义操作,并且在输出MSI文件中创建了二进制文件,InstallExecuteSequence条目也是这样:


但是定制的桌子却无处可见。我肯定我错过了一些显而易见的东西,但我看不出是什么。你能?
发布于 2013-07-29 11:47:43
我发现了问题。Wix源代码没有任何问题,有一个构建问题阻止了输出的正确重建。
我想我们要做的是删除这个问题,因为它真的是一条鲱鱼。我不确定是否要删除它,所以我会把它留给社区。如果有人想投票删除它,我没有异议。
https://stackoverflow.com/questions/17922362
复制相似问题