gpt4 book ai didi

.net - Wix !(bind.AssemblyFullName.fileId) 仅适用于 GACed 程序集?

转载 作者:行者123 更新时间:2023-12-02 00:41:23 24 4
gpt4 key购买 nike

悲哀,悲哀,三次悲哀。为什么 Wix 使安装 .NET 程序集如此困难!

我正在安装一个在.NET 中实现的 COM 进程内服务器,在我的 Wix 安装中,我需要为其创建注册表项。我不想这样做,我宁愿 Wix 有一个相当于 RegAsm 的东西,但他们让我手动做这件事。我厌倦了因为暗示这有点神秘而受到批评,所以我放弃了,并尝试以声明式的方式来做,就像一个好 child 。所以,这就是我的注册表内容现在的样子:

<File Id="filDriverAssembly" Source="$(var.TiGra.Astronomy.AWRDriveSystem.TargetPath)" KeyPath="yes" Vital="yes" Assembly=".net">
<!--<Class Context="InprocServer32" Description="$(var.InstallName)" Id ="$(var.DriverGuid)" ThreadingModel ="both" >
<ProgId Description="$(var.InstallName)" Id ="$(var.DriverId)" />
</Class>-->
</File>
<RegistryKey Root="HKCR" Key="$(var.DriverId)" Action="createAndRemoveOnUninstall">
<RegistryValue Type="string" Value="$(var.DriverTypeName)"/>
<RegistryKey Key="CLSID">
<RegistryValue Type="string" Value="$(var.DriverGuid)" />
<RegistryKey Key="$(var.DriverGuid)">
<RegistryValue Type="string" Value="$(var.DriverTypeName)"/>
<RegistryKey Key="InprocServer32">
<RegistryValue Type="string" Value="mscoree.dll" />
<RegistryValue Type="string" Name="ThreadingModel" Value="Both"/>
<RegistryValue Type="string" Name="Class" Value="$(var.DriverTypeName)"/>
<RegistryValue Type="string" Name="Assembly" Value="!(bind.AssemblyFullName.filDriverAssembly)"/>
<RegistryValue Type="string" Name="RuntimeVersion" Value="2.0.50727"/>
<RegistryValue Type="string" Name="CodeBase" Value="file:///[#filDriverAssembly]" />
<RegistryKey Key="!(bind.fileVersion.filDriverAssembly)" >
<RegistryValue Type="string" Name="Class" Value="$(var.DriverTypeName)"/>
<RegistryValue Type="string" Name="Assembly" Value="!(bind.AssemblyFullName.filDriverAssembly)"/>
<RegistryValue Type="string" Name="RuntimeVersion" Value="2.0.50727"/>
<RegistryValue Type="string" Name="CodeBase" Value="file:///[#filDriverAssembly]" />
</RegistryKey>
</RegistryKey>
<RegistryKey Key="ProgId">
<RegistryValue Type="string" Value="$(var.DriverId)" />
</RegistryKey>
<RegistryKey Key="Implemented Categories">
<RegistryKey Key="{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}" />
</RegistryKey>
</RegistryKey>
</RegistryKey>
</RegistryKey>
<!-- Wow6432Node for x86 compatibility, installed only on x64 systems -->
<!-- HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Wow6432Node -->
<?if $(var.Win64) = "yes" ?>
<RegistryKey Root="HKCR" Key="Wow6432Node" Action="createAndRemoveOnUninstall">
<RegistryKey Key="CLSID">
<RegistryValue Type="string" Value="$(var.DriverGuid)" />
<RegistryKey Key="$(var.DriverGuid)">
<RegistryValue Type="string" Value="$(var.DriverTypeName)"/>
<RegistryKey Key="InprocServer32">
<RegistryValue Type="string" Value="mscoree.dll" />
<RegistryValue Type="string" Name="ThreadingModel" Value="Both"/>
<RegistryValue Type="string" Name="Class" Value="$(var.DriverTypeName)"/>
<RegistryValue Type="string" Name="Assembly" Value="!(bind.AssemblyFullName.filDriverAssembly)"/>
<RegistryValue Type="string" Name="RuntimeVersion" Value="2.0.50727"/>
<RegistryValue Type="string" Name="CodeBase" Value="file:///[#filDriverAssembly]" />
<RegistryKey Key="!(bind.assemblyVersion.filDriverAssembly)" >
<RegistryValue Type="string" Name="Class" Value="$(var.DriverTypeName)"/>
<RegistryValue Type="string" Name="Assembly" Value="!(bind.AssemblyFullName.filDriverAssembly)"/>
<RegistryValue Type="string" Name="RuntimeVersion" Value="2.0.50727"/>
<RegistryValue Type="string" Name="CodeBase" Value="file:///[#filDriverAssembly]" />
</RegistryKey>
</RegistryKey>
<RegistryKey Key="ProgId">
<RegistryValue Type="string" Value="$(var.DriverId)" />
</RegistryKey>
<RegistryKey Key="Implemented Categories">
<RegistryKey Key="{62C8FE65-4EBB-45e7-B440-6E39B2CDBF29}" />
</RegistryKey>
</RegistryKey>
</RegistryKey>
</RegistryKey>
<?endif ?>

RegAsm 适合弱者,是吗?无论如何,请注意,我需要获取程序集全名才能创建一些注册表项。我正在使用 Binder 变量,具体来说,Value="!(bind.AssemblyFullName.filDriverAssembly)"

但是,除非我将属性 Assembly=".net" 添加到文件条目,否则这不起作用。如果我不添加该属性,或者如果我使用 Assembly="no",那么我会得到

Error 2 Unresolved bind-time variable !(bind.AssemblyFullName.filDriverAssembly).

当我将 Assembly=".net" 添加到文件项时, Binder 变量工作得很好,但 Wix 将我的程序集放入全局程序集缓存中,这是 我想要什么!哦,伙计。

如果未进入 GAC,是否无法在 Wix 项目中查询程序集的全名?为什么这两件事相互依赖?

最佳答案

除非文件被标记为程序集,否则它就像任何其他文件一样; WiX 不知道它可能具有装配属性。查看 AssemblyApplication 属性:您可以将其设置为适当的文件并设置 @Assembly=".net",而无需告诉 MSI 该文件会进入 GAC。

关于.net - Wix !(bind.AssemblyFullName.fileId) 仅适用于 GACed 程序集?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6721170/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com