2

我正在使用 HEAT 为文件目录自动生成 WiX 片段。在创建 --.wxs 文件时,为什么在组件中包含一些不必要的标签?如下

情景 1

 <Component Id="cmpFF03591E2D2B9B2AA2AA444299A693DB" Directory="dir7307A6085BD4ABD9B8955C093FD541F5" Guid="*">
   <Class Id="{00AB5D3B-4FAB-35AB-8916-59EE0247EFF1}" Context="InprocServer32" Description="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.FileConfigurationSourceElement" ThreadingModel="both" ForeignServer="mscoree.dll">
     <ProgId Id="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.FileConfigurationSourceElement" Description="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.FileConfigurationSourceElement" />
   </Class>
   <Class Id="{0ED3627E-5196-3A33-8EDC-7DC7DFCE3A97}" Context="InprocServer32" Description="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ByteArrayTypeConverter" ThreadingModel="both" ForeignServer="mscoree.dll">
     <ProgId Id="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ByteArrayTypeConverter" Description="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ByteArrayTypeConverter" />
   </Class>
   <Class Id="{10FA9802-2D3A-3CE4-95BB-7170AA4AE251}" Context="InprocServer32" Description="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.ConfigurationChangeEventSourceImpl" ThreadingModel="both" ForeignServer="mscoree.dll">
     <ProgId Id="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.ConfigurationChangeEventSourceImpl" Description="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ContainerModel.ConfigurationChangeEventSourceImpl" />
   </Class>

......很多类文件

 <File Id="fil7DC27EB4CA5B9970A7CBD422D919CCFF" KeyPath="yes" Source="$(var.SourcePath)\bin\Microsoft.Practices.EnterpriseLibrary.Common.dll" />
   <ProgId Id="Record" />
   <RegistryValue Root="HKCR" Key="CLSID\{00AB5D3B-4FAB-35AB-8916-59EE0247EFF1}\Implemented Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}" Value="" Type="string" Action="write" />
   <RegistryValue Root="HKCR" Key="CLSID\{00AB5D3B-4FAB-35AB-8916-59EE0247EFF1}\InprocServer32\5.0.414.0" Name="Class" Value="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.FileConfigurationSourceElement" Type="string" Action="write" />
   <RegistryValue Root="HKCR" Key="CLSID\{00AB5D3B-4FAB-35AB-8916-59EE0247EFF1}\InprocServer32\5.0.414.0" Name="Assembly" Value="Microsoft.Practices.EnterpriseLibrary.Common, Version=5.0.414.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" Type="string" Action="write" />
   <RegistryValue Root="HKCR" Key="CLSID\{00AB5D3B-4FAB-35AB-8916-59EE0247EFF1}\InprocServer32\5.0.414.0" Name="RuntimeVersion" Value="v2.0.50727" Type="string" Action="write" />

..........很多注册表项

</Component>
4

2 回答 2

5

我将复制粘贴我的问题的答案(Wix\heat.exe 奇怪的输出),因为它对我有用。正如 Yan Sklyarenko 所说:

Supply heat.exe with -sreg and -scom command line switches. See heat.exe -? for more options
于 2013-09-24T15:04:22.283 回答
1

类和注册表意味着二进制文件是 COM 二进制文件。这是一个 C# COM 二进制文件,因为我可以看到 ForeignServer="mscoree.dll"。

如果您不想要 COM 二进制文件,您可以在项目中指定 assemlyinfo.cs 标记 COMVisible = false。

于 2014-04-16T08:10:41.080 回答