4

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.

But I have the following error:

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.

I have tried:

  • Using the same file, and both components use it as Source
  • Copying the file into two project subfolders, one for each component

But stills, WiX refuses to build.

wxs file details:

  • 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>
    
Stein Åsmul
  • 39,960
  • 25
  • 91
  • 164
galinette
  • 8,896
  • 2
  • 36
  • 87
  • The error message is saying that both components try to install the DLLs into the same directory, which is `[TARGETDIR]\plugins`. It means that `RegistrySearch` hasn't find anything and both properties ended up empty, and hence both directories got resolved to `[TARGETDIR]\plugins`, and thus it really attempts to install those components into the same folder. You might want to have some default values for those properties in case nothing is found in the registry (initial install). Besides, it references `appv5plugin.dll`, while the sources say the file names are different... Rebuild the MSI? – Yan Sklyarenko Dec 07 '15 at 15:21
  • Why should RegistrySearch find anything at compile time??? I can understand that something fails at install time if both directories are the same, but there is absolutely no reason it happens at compile time. – galinette Dec 07 '15 at 18:13
  • About the dll file name, that's a mistake. They are the same. Edited – galinette Dec 07 '15 at 18:15
  • Ah, right - sorry about the confusion, it's compile time. – Yan Sklyarenko Dec 08 '15 at 16:41

2 Answers2

0

Try giving each file an explicit ShortName value (unique and different, obviously). I'm not completely sure, but the issue may be a collision of short file names. What are the values of each in the File table in the MSI file?

PhilDW
  • 20,260
  • 1
  • 18
  • 28
0

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...

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

Tom Bogle
  • 464
  • 4
  • 18
  • I have tested it now, and it seems to work fine. Now my only problem is that if I install a particular version of my plugin into Application A and then user subsequently installs application B, my installer (even a subsequent version of it) won't install the plugin feature geared toward application B because (apparently) it thinks it is only supposed to be upgrading the existing A feature. – Tom Bogle Oct 06 '16 at 19:33
  • Did you try the "potential fix" described in this answer: [**WiX ICE30 error but directory is correct**](https://stackoverflow.com/questions/43742564/wix-ice30-error-but-directory-is-correct). – Stein Åsmul Aug 21 '17 at 20:18
  • Or this one: [**WIX multiple copies of same file in msi but only one will be installed**](https://stackoverflow.com/questions/4595595/wix-multiple-copies-of-same-file-in-msi-but-only-one-will-be-installed). – Stein Åsmul Aug 21 '17 at 21:06