【发布时间】:2017-12-15 14:50:36
【问题描述】:
我正在为 WPF 应用程序开发基于 WiX 的安装程序。文件数量巨大且不断变化,因此我使用heat 实用程序来生成组件。
& "$env:WIX\bin\heat.exe" dir $sourceDir -ag -dr INSTALLDIR -srd -sfrag -suid -cg ProductComponents -out Components.wxs
有许多具有相同名称但存储在不同文件夹中的东西。在构建过程中,light 实用程序会打印以下消息之一
warning LGHT1076 : ICE69: Mismatched component reference. Entry 'regCA7432986A287E1C45911B23DB39A11B' of the Registry table belongs to component 'AutoMapper.dll_1'. However, the formatted string in column 'Value' references file 'AutoMapper.dll' which belongs to component 'AutoMapper.dll'. Components are in the same feature.
在生成的文件中有这样的记录
<Component Id="AutoMapper.dll_1" Guid="*">
...
<File Id="AutoMapper.dll_1" KeyPath="yes" Source="SourceDir\Plugins\PluginName\AutoMapper.dll" />
<ProgId Id="Record" />
<RegistryValue Root="HKCR" Key="CLSID\{00ACB8EF-737F-3327-B129-C59300C5D5ED}\Implemented Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}" Value="" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{00ACB8EF-737F-3327-B129-C59300C5D5ED}\InprocServer32\6.1.1.0" Name="Class" Value="AutoMapper.Configuration.MapperConfigurationExpression" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{00ACB8EF-737F-3327-B129-C59300C5D5ED}\InprocServer32\6.1.1.0" Name="Assembly" Value="AutoMapper, Version=6.1.1.0, Culture=neutral, PublicKeyToken=be96cd2c38ef1005" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{00ACB8EF-737F-3327-B129-C59300C5D5ED}\InprocServer32\6.1.1.0" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{00ACB8EF-737F-3327-B129-C59300C5D5ED}\InprocServer32\6.1.1.0" Name="CodeBase" Value="file:///[#AutoMapper.dll]" Type="string" Action="write" />
...
如您所见,代码的最后一行是[#AutoMapper.dll] 而不是[#AutoMapper.dll_1],并且对于其他具有相同名称的文件,此行为是相同的。我可以做些什么来防止这种行为并生成正常的注册表记录?
顺便说一句,这是一个真正的问题还是我可以忽略它?
【问题讨论】:
-
只要文件在两个位置完全相同,忽略 ICE69 是安全的,只要您不会遇到它们具有不同功能并且可能安装带有引用的那个的情况到另一个而不安装另一个包含的功能。
-
您无法生成静态注册表值,因为 [#AutoMapper.dll] 值取决于 dll 的安装位置,这是您实际安装产品时的运行时值。
标签: wix windows-installer registry heat