wix - 将程序集安装到 GAC 时出现问题

标签 wix

我正在尝试使用 WiX 在 GAC 中部署几个第三方程序集。其中一些组件是混合组件。执行此操作的常见方法似乎是将相应文件的程序集属性设置为“net”。但是,这样做会在安装过程中产生错误:

Error 1938. An error occurred during the installation of assembly ...One or more modules of the  assembly could not be found. HRESULT: 0x80131042. assembly interface: IAssemblyCacheItem, function : Commit, component: ...   MSI (s) (A8:B0) [12:32:39:085]:....    assembly .... One or more modules of the assembly could not be found. HRESULT: 0x80131042. assembly interface: IAssemblyCacheItem, function: Commit, component:...

我从供应商处获得的有关将程序​​集安装到 gac 的说明是:

  1. 将所有 dll(d1、d2、d3、...、dn)放在同一目录中。
  2. 对这些 dll 的子集运行 gacutil。

如果我在 gac 中进行“原始”查看,其中一个文件夹内容如下所示:

gac_32\d1\0.0.0.0_271E3736135E91A2\d1.dll gac_32\d1\0.0.0.0_271E3736135E91A2\d2.dll gac_32\d1\0.0.0.0_271E3736135E91A2\d3.dll

gacutil 发现 d2.dll 和 d3.dll 需要放置在与 d1.dll 相同的目录中,并且已自动执行此操作。

我怎样才能用wix做到这一点?我现在看到的唯一方法是将 gacutil 作为自定义操作调用,但这似乎不是一个好的解决方案。

谢谢 斯特凡

最佳答案

如果其他人正在为此苦苦挣扎:

要安装由一个托管程序集和托管程序集引用的一个或多个 native 或混合 dll 组成的多文件程序集,请在 WixSetup 中创建以下结构:

<Component Id="MyMultifileAssembly" Guid="abc">
        <File Id="ManagedAssembly" KeyPath="yes" Source="$(var.ThirdParty)\Managed.dll" Assembly=".net"/>
        <File Id="UnmanagedAssembly1" KeyPath="no" Source="$(var.ThirdParty)\Unmanaged1.dll" />
        <File Id="UnmanagedAssembly2" KeyPath="no" Source="$(var.ThirdParty)\Unmanaged2.dll" />
</Component>

两个非托管程序集都将转到安装托管 dll 的 GAC 文件夹。

关于wix - 将程序集安装到 GAC 时出现问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7555500/

相关文章:

c# - 验证服务是否标记为删除

wix - 如何使用 wix 将多个元素添加到 XML 配置文件中?

com - 使用 WIX Heat(v3.5、v3.6)获取 native (x86 或 x64)COM Dll 的注册信息?

visual-studio-2010 - ProgramFiles64Folder 正在安装到\Program Files (x86)\in WIX Installer

xml - 根据 RegistrySearch 的结果设置目录

visual-studio - 在任何 CPU 解决方案中都会跳过 Wix 安装程序项目构建

.net - 使用 WIX 在 IIS 应用程序池中设置 .NET 版本不起作用

vb6 - 使用 WiX 安装 VB6 二进制文件

Wix Bundle、MsiPackage InstallSize 属性限制为 2,147,483,647(需要 15GB)

WiX 和 ARPINSTALLLOCATION