2011-09-26 108 views
2

我正尝试在GAC中使用WiX部署几个第三方程序集。其中一些组件是混合组件。这样做的常见方式似乎是将相应文件的assembly-attribute设置为“net”。然而,这样做的一个错误,这样的产量在安装过程中:安装程序集到GAC的问题

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并且具有automaticaly这样做。

我该如何用wix做到这一点?我现在看到的唯一方法是将gacutil称为自定义动作,但这似乎不是一个好的解决方案。

谢谢 斯特凡

回答

4

万一别人用这种挣扎:

要安装了一个管理组件和一个或多个被引用的多个天然或混合的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文件夹。