WiX - 在两个不同的位置安装相同的文件 [英] WiX - Install the same file at two different locations

查看:23
本文介绍了WiX - 在两个不同的位置安装相同的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的安装程序中,我有两个可选功能,它们是同一软件第 5 版和第 6 版的插件.他们将相同的文件(相同的名称,相同的二进制内容)安装到应用程序的插件"文件夹中.

In my installer, I have two optional features, which are plugins for versions 5 and 6 of the same software. They install the same file (same name, same binary content) into the "plugins" folder of the applications.

但我有以下错误:

C:\Users\FooBar\Documents\project\project.wxs(281):错误LGHT0204:ICE30:目标文件0egx-0x3.dll|appv5plugin.dll"是由两个不同的组件安装在 '[TARGETDIR]\plugins\'LFN 系统:Comp_ThisAppV5_plugin"和'Comp_ThisAppV6_plugin'.这会破坏组件引用计数.

C:\Users\FooBar\Documents\project\project.wxs(281) : error LGHT0204 : ICE30: The target file '0egx-0x3.dll|appv5plugin.dll' is installed in '[TARGETDIR]\plugins\' by two different components on an LFN system: 'Comp_ThisAppV5_plugin' and 'Comp_ThisAppV6_plugin'. This breaks component reference counting.

我试过了:

  • 使用同一个文件,并且两个components都使用它作为Source
  • 将文件复制到两个项目子文件夹中,每个组件
  • Using the same file, and both components use it as Source
  • Copying the file into two project subfolders, one for each component

但是,WiX 拒绝构建.

But stills, WiX refuses to build.

  • 在注册表中搜索 TheApp v5 和 v6 的安装目录:

  • Install directories for TheApp v5 and v6 are searched for in the registry:

<Property Id="PROP_APPV5PATH">
    <RegistrySearch Id='RegSearch_AppV5Path' Type='raw' Root='HKLM' Key='SOFTWARE\TheCompany\TheApp\5.0' Name='Installdir' Win64="yes"/>
</Property>
<Property Id="PROP_APPV6PATH">
    <RegistrySearch Id='RegSearch_3AppV6Path' Type='raw' Root='HKLM' Key='SOFTWARE\TheCompany\TheApp\6.0' Name='Installdir' Win64="yes"/>
</Property>

  • 单独的组件:

  • Separate components:

    <Directory Id="DIR_APPV5">
        <Directory Id="Dir_AppV5Plugins" Name="plugins">
            <Component Id="Comp_ThisAppV5_plugin" Guid="*">
                <File Id="appv5plugin_dll" Source="files\plugins\appv5\app_plugin.dll" KeyPath="yes"/>
            </Component>
        </Directory>
    </Directory>
    
    <Directory Id="DIR_APPV6">
        <Directory Id="Dir_AppV6Plugins" Name="plugins">
            <Component Id="Comp_ThisAppV6_plugin" Guid="*">
                <File Id="appv6plugin_dll" Source="files\plugins\appv6\app_plugin.dll" KeyPath="yes"/>
            </Component>
        </Directory>
    </Directory>
    

  • 两个安装目录:

  • Two install directories:

    <SetDirectory Id="DIR_APPV5" Value="[PROP_APPV5PATH]" /> 
    <SetDirectory Id="DIR_APPV6" Value="[PROP_APPV6PATH]" /> 
    

  • 两个独立的功能

  • Two separate features

    <Feature Id="Feat_ThisAppV5_plugin" Title="Plugin for App V5" ConfigurableDirectory="DIR_APPV5" Level="1000" AllowAdvertise='no' InstallDefault='local' Absent='allow'>
        <ComponentRef Id="Comp_ThisAppV5_plugin"/>
    </Feature>
    <Feature Id="Feat_ThisAppV6_plugin" Title="Plugin for App V6" ConfigurableDirectory="DIR_APPV6" Level="1000" AllowAdvertise='no' InstallDefault='local' Absent='allow'>
        <ComponentRef Id="Comp_ThisAppV6_plugin"/>
    </Feature>
    

  • 推荐答案

    在给所有组件唯一的 GUID 和每个文件一个唯一的 Id 和 ShortName 之后,我仍然收到所有这些错误.我通过抑制 ICE30 的 ICE 验证来修复"它.我还没有测试过,所以我不确定在为应用程序的多个版本安装和卸载我的插件时它是否会正常工作...

    After giving all components unique GUIDs and every file a unique Id and ShortName, I was still getting all these errors. I "fixed" it by suppressing the ICE validation for ICE30. I haven't tested it yet, so I'm not whether it will work correctly when installing and uninstalling my plugin for multiple versions of the application...

    注意:忽略 ICE 错误的设置位于工具设置选项卡下的项目属性中.

    Note: The setting to ignore ICE errors is found in the Project Properties under the Tool Settings tab.

    这篇关于WiX - 在两个不同的位置安装相同的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    相关文章
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆