2

WIX を使用して、2 つの同じアセンブリ (1 つは.Net35用、もう 1 つは.Net40用) をインストールしようとしています。2 つの別個のコンポーネントを使用していますが、WIX がプロジェクトのコンパイルを妨げています。

        <Directory Id="GAC40" Name="GAC">
            <Component Id="MyDllServicesModuleGac40Component" Guid="307675AA-8AEC-473B-A78A-FB362CCEDE2A" Win64="yes">
                <File Id="MyDllNet40DllGac" Name="MyDll.dll" KeyPath="yes" Assembly=".net" Source="..\MyDll\bin\Net40\MyDll.dll" />
            </Component>
        </Directory>
        <Directory Id="GAC35" Name="GAC">
            <Component Id="MyDllServicesModuleGac35Component" Guid="47E6BD1B-25CD-466D-945E-06DCF0F2A269" Win64="yes">
                <File Id="MyDllNet35DllGac" Name="MyDll.dll" KeyPath="yes" Assembly=".net" Source="..\MyDll\bin\Net35\MyDll.dll" />
            </Component>
        </Directory>

私が受け取るエラーは次のとおりです。

エラー 29 ICE30: ターゲット ファイル 'MyDll.dll' は、SFN システム上の 2 つの異なるコンポーネントによって '[TARGETDIR]\GAC\' にインストールされています: 'MyDllServicesModuleGac40Component.DDD7D974_FE9C_4BA3_BDD3_A1A3A23F8057' および 'MyDllServicesModuleGac35Component.DDD7D974_FE9C03A5A7'F8057.8 これにより、コンポーネントの参照カウントが中断されます。D:\PROJECTS\MyDll.Experimental.3.0.0\Project\MyDll\MyDll.Wix.Services\MergeModule.wxs 34 1 MyDll.Wix.Services

インストーラーは、.Net35 dll が GAC の C:\Windows\assembly にインストールされ、.Net40 dll が GAC の C:\Windows\Microsoft.NET\assembly にインストールされることを検出できるはずです。

DLL の名前を変更することはできません。

ありがとう!

アップデート

当然、投稿した直後に解決策を思いつきました。コンポーネントを追加の要素でラップすることで、これを機能させることができたようです。後で Tom Blodget の投稿を読んだので、それは正しいです。

        <Directory Id="GAC1" Name="GAC">
            <Directory Id="GAC40" Name="GAC">
                <Component Id="MyDllServicesModuleGac40Component" Guid="307675AA-8AEC-473B-A78A-FB362CCEDE2A" Win64="yes">
                    <File Id="MyDllNet40DllGac" Name="MyDll.dll" KeyPath="yes" Assembly=".net" Source="..\MyDll\bin\Net40\MyDll.dll" />
                </Component>
            </Directory>
        </Directory>
        <Directory Id="GAC2">
            <Directory Id="GAC35" Name="GAC">
                <Component Id="MyDllServicesModuleGac35Component" Guid="FD74504A-6FE9-488E-9086-9DAD3024B35D" Win64="yes">
                    <File Id="MyDllNet35DllGac" Name="MyDll.dll" KeyPath="yes" Assembly=".net" Source="..\MyDll\bin\Net35\MyDll.dll" />
                </Component>
            </Directory>
        </Directory>

まあ、それが誰かを助けることを願っています!

4

1 に答える 1

8

As explained by Aaron Stebner,

When you use the attribute Assembly=".net" for a file in WiX, it will create entries in the MsiAssembly and MsiAssemblyName table for this component and mark it as a GAC component. That means that the file will only be installed to the GAC by this component, and it will not install to the directory that the component is a child of. That directory will only be used by Windows Installer to stage a copy of that file when creating an administrative install point.

So the directories for your two components must be different since the file names are the same. If nothing else is targeted for those directories, they won't even be created. I put my GAC components under a subdirectory of my install folder:

<Directory Id="tmp_to_GAC" Name="tmp_to_GAC"> 

You'd need one for each GAC.

于 2013-06-13T17:17:17.420 に答える