WiX GAC 安装和同一 dll 的 regasm 不起作用

发布于 2024-09-26 00:12:41 字数 898 浏览 0 评论 0原文

我正在使用 WiX 创建一个安装程序,其中包含一些 dll。在原始脚本中,首先调用 gacutil.exe,然后调用每个 dll 的 regasm。我在将这个想法转移到 WiX 时遇到了问题。以下是安装到 GAC 中的代码片段:

<文件 Id="my.dll" Source="my_src" Assembly=".net" KeyPath="yes" Checksum="yes"/>

现在的问题是 WiX 将如何执行程序集注册?我的问题是:

  1. 我无法在同一组件中创建另一个 因为必须只有一个keyPath="yes" 属性/组件。
  2. 我无法将 keyPath="yes" 放在组件级别,因为它会破坏组件引用计数系统。
  3. 如果没有 keyPath="Yes",我无法创建 ,因为它会生成编译错误。
  4. 我无法创建单独的组件,因为两个组件将尝试安装相同的文件。

我知道使用 heat 时不需要调用 regasmregsvr32。在组件代码中: 应该足以进行注册。 我正在使用热量,现在我陷入困境,因为我还必须进行程序集注册。

I am creating an installer using WiX which contains few dlls. In the original script first gacutil.exe and then regasm for each dll is called. I am having a problem when transfering this idea into WiX. Here is the code fragment for installing into GAC :

<Component Id="GMAG.Core.Serialization.dll" Directory="_2.2.8.0" Guid="{my_guid}">
<File Id="my.dll" Source="my_src" Assembly=".net" KeyPath="yes" Checksum="yes"/>
</Component>

Now the question is how WiX will perform the assembly registration? My problem is:

  1. I can't create another <File Id="my.dll" Source="my_src" KeyPath="yes"/> in the same component cause there must be only one keyPath="yes" attribute/component.
  2. I can't put keyPath="yes" in component level, as it breaks component reference counting system.
  3. I can't create <File Id="my.dll" Source="my_src"/> without keyPath="Yes", as it generates compilation error.
  4. I can't create a seperate component as two components will try to install same file.

I know I don't need to call regasm or regsvr32 when using heat. In the component code :<File Id="my.dll" Source="my_src" KeyPath="yes"/> should be enough for the registration.
I'm using heat and now I'm stuck as I have to do assembly registration also.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

终止放荡 2024-10-03 00:12:41

Assembly=".net" 会将您的程序集放入 GAC 中,然后您将需要用于 COM 注册的注册表项。如果您对程序集运行 Heat,它应该会生成您需要的代码片段。

Assembly=".net" will put you assembly in the GAC, you will then need registry keys for the COM registration. If you run Heat against your assembly it should generate the code fragment you require.

有深☉意 2024-10-03 00:12:41

这就是我们通过 WIX 3.5 在 GAC 中注册 DLL 的方式:

<Component Id="Level0GAC" Guid="21735A8C-DD0C-4f4e-8AB5-B5BB8C55726B" DiskId='1'>
                    <File Id='Level0' Name='DLLFileName.dll' DiskId='1' KeyPath="yes"
                      Source='DLLFileName.dll'
                      Checksum="yes" Assembly=".net" AssemblyManifest="Level0">
                    </File>
</Component>

事实上,一个组件内只能有一个文件,其 KeyPath 设置为“yes”,这就是为什么对于多个 DLL,您应该创建多个组件。

That's how we register DLL in GAC via WIX 3.5:

<Component Id="Level0GAC" Guid="21735A8C-DD0C-4f4e-8AB5-B5BB8C55726B" DiskId='1'>
                    <File Id='Level0' Name='DLLFileName.dll' DiskId='1' KeyPath="yes"
                      Source='DLLFileName.dll'
                      Checksum="yes" Assembly=".net" AssemblyManifest="Level0">
                    </File>
</Component>

Indeed, there can be only one file inside a Component with a KeyPath set ot "yes", that's why for several DLLs you should create several Components.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文