我有一个 vanilla .net 类库,其中包含一些 [ComVisible] 类型,并且程序集本身被标记为“注册 COM 互操作”。我正在尝试为该应用程序构建一个 WIX 安装程序,它不仅需要将 .net 程序集复制到目标机器上的 INSTALLATIONDIR,还需要完成注册该对象的工作,以便一些旧版 VB6 应用程序可以使用.net 程序集。
我一直在使用 heat.exe(更准确地说是 heat 文件任务)来收集我通过 componentGroupRef 包含在我的主 wix 文件中的片段。我的问题是 heat.exe 正在收集的文件应该是我的类库输出的 .tlb 文件还是 dll 本身?如果我在 .tlb 上使用 heat.exe,我不会在片段中获得任何注册表元素,但我会使用 dll。如果我应该使用 dll,.tlb 在这个过程中扮演什么角色?
我在 msbuild 中使用以下热任务
<HeatFile
NoLogo="true"
ToolPath="$(WixToolPath)"
TreatWarningsAsErrors="false"
AutogenerateGuids="true"
GenerateGuidsNow="true"
OutputFile="$(MSBuildProjectDirectory)\fragments\DemoTypeLib.wxs"
File="$(SolutionDir)DemoClassLibrary1\bin\Debug\DemoClassLibrary1.dll"
ComponentGroupName="DemoTypeLibComponent"
PreprocessorVariable="var.DemoClassLibrary1.TargetDir"
SuppressCom="false"
DirectoryRefId="INSTALLLOCATION"
SuppressRegistry="false"
SuppressRootDirectory="true" />