下面的单个组件应该分成两个组件吗?
<Component Id="cmpSoftwareDLL" Guid="8401EA84-0A93-43A5-83D0-472B63418F92" Win64="$(var.MyWin64)">
<File Id="SoftwareDLL" Source="$(var.Software.TargetDir)\..\Release Obfuscated\Software.dll" KeyPath="yes" />
<Class Id="{2593B03A-8833-43EC-8F4F-A71E35CB58E6}" Context="InprocServer32" Description="Software"
ThreadingModel="both" ForeignServer="mscoree.dll">
<ProgId Id="$(var.ProgId)" Description="Software" />
</Class>
<!--Writes to Registry-->
<RegistryValue Root="HKCR" Key="CLSID\{2593B03A-8833-43EC-8F4F-A71E35CB58E6}\Implemented Categories\{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}" Value="" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{2593B03A-8833-43EC-8F4F-A71E35CB58E6}\InprocServer32\1.0.0.0" Name="Class" Value="Software.Addin" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{2593B03A-8833-43EC-8F4F-A71E35CB58E6}\InprocServer32\1.0.0.0" Name="Assembly" Value="Software, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{2593B03A-8833-43EC-8F4F-A71E35CB58E6}\InprocServer32\1.0.0.0" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{2593B03A-8833-43EC-8F4F-A71E35CB58E6}\InprocServer32\1.0.0.0" Name="CodeBase" Value="file:///[#SoftwareDLL]" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{2593B03A-8833-43EC-8F4F-A71E35CB58E6}\InprocServer32" Name="Class" Value="Software.Addin" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{2593B03A-8833-43EC-8F4F-A71E35CB58E6}\InprocServer32" Name="Assembly" Value="Software, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{2593B03A-8833-43EC-8F4F-A71E35CB58E6}\InprocServer32" Name="RuntimeVersion" Value="v4.0.30319" Type="string" Action="write" />
<RegistryValue Root="HKCR" Key="CLSID\{2593B03A-8833-43EC-8F4F-A71E35CB58E6}\InprocServer32" Name="CodeBase" Value="file:///[#SoftwareDLL]" Type="string" Action="write" />
我应该在其中一个注册表设置中包含KeyPath =“yes”吗?忘记在部署的MSI文件中包含KeyPath =“yes”的后果是什么?如果Windows升级路径发生或类似,它们可以被删除吗?
<Component Id="cmpCustomerRegistry" Guid="BD933C43-A40A-4DBA-8645-F5E80F9134F1" Win64="$(var.MyWin64)">
<RegistryKey Root="HKLM" Key="SOFTWARE\Policies\MySoftware">
<RegistryValue Type="integer" Name="Name1" Value =0 />
<RegistryValue Type="string" Name="Name2" Value ="value" />
....
</RegistryKey>
答案 0 :(得分:3)
在决定是否合并或拆分组件内容时要回答的典型核心问题是:
例如,指南告诉我们将每个PE文件分开,因此每个.dll或.exe应该接收自己的组件,即使.exe在没有所有.dll依赖项的情况下可能没用。相比之下,外部.config或.manifest文件不能独立存在,因此应该在单个组件中使用相应的.dll或.exe文件。
我认为没有COM服务器本身,COM服务器的注册表数据是没有意义的。除了安装程序内容中的错误之外,如果不升级.dll文件,则永远不需要升级注册表数据。并没有相反的指导。因此,除非您有不寻常的需求(比如能够在没有注册的情况下安装COM服务器),请将.dll及其注册保存在单个组件中。