帮助!我需要在我的 Wix 3.5 设置项目中执行托管自定义操作,无论我尝试了什么,我都无法让它工作。
我在 Visual Studio 2010 中使用 Votive 集成。我的 Wix Product.wxs 文件与 Visual Studio 模板基本没有变化,除了一些文本更改:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="666ffc07-90b2-4608-a9f0-a0cc879f2ad0" Name="Product Name" Language="1033" Version="5.5.0002" Manufacturer="TiGra Astronomy" UpgradeCode="d17a5991-b404-4095-9e93-08d2db984cfd">
<Package InstallerVersion="200" Compressed="yes" />
<Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLLOCATION" Name="Directory Name">
<!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
<!-- <Component Id="ProductComponent" Guid="3ea5ade7-9b7b-40da-9e83-13e066a000ef"> -->
<!-- TODO: Insert files, registry keys, and other resources here. -->
<!-- </Component> -->
</Directory>
</Directory>
</Directory>
<Feature Id="ProductFeature" Title="ASCOM Driver" Level="1">
<!-- TODO: Remove the comments around this ComponentRef element and the Component above in order to add resources to this installer. -->
<!-- <ComponentRef Id="ProductComponent" /> -->
<!-- Note: The following ComponentGroupRef is required to pull in generated authoring from project references. -->
<ComponentGroupRef Id="Product.Generated" />
</Feature>
</Product>
我已设置对我的托管自定义操作项目的引用,将 HARVEST 属性设置为 true。该项目被调用WIX.CustomActions
并产生WIX.CustomActions.dll
和WIX.CustomActions.CA.dll
我看到 Wix 在构建期间正在处理引用,并且WIX.CustomActions.dll
程序集显示在最终设置项目的二进制表中,但WIX.CustomActions.CA.dll
没有。
我有一个CustomActions.wxs
应该打包并调用自定义操作:
<?xml version="1.0" encoding="UTF-8" ?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<Binary Id="DriverRegistrationCA" SourceFile="$(var.WIX.CustomActions.TargetDir)\$(var.WIX.CustomActions.TargetName).CA.dll" />
<CustomAction Id="RegisterDriver" BinaryKey="DriverRegistrationCA" DllEntry="RegisterAscomDriver" Execute="deferred" Return="check" />
<CustomAction Id="UnregisterDriver" BinaryKey="DriverRegistrationCA" DllEntry="UnregisterAscomDriver" Execute="immediate" Return="check" />
<InstallExecuteSequence>
<Custom Action="RegisterDriver" After="InstallFinalize" />
<Custom Action="UnregisterDriver" Before="RemoveFiles" />
</InstallExecuteSequence>
</Fragment>
</Wix>
我查看了互联网上的各种“howto”资源,它们充其量是令人困惑的,并带有相互矛盾的建议。据我了解,该WIX.CustomActions.CA.dll
文件是一个非托管 dll,它加载 .NET 框架并将控制权传递给“真正的”托管自定义操作。但是,WIX.CustomActions.CA.dll
它没有打包在我的 MSI 文件中。我已尽我所能遵循示例,但我看不出有什么问题。
请问,有没有人在 Votive 有这个工作?你能给我一个实际的工作例子吗?