Why are we getting the ICE57 error for not advertised labels in every machine setup?

This question asks if one of the ICE57 validation mechanisms generates a false bug report.

I am using WIX 3.9 to create an installer. I want to display ad-free labels on every machine installation.

This WXS example installs a text file and a shortcut to open a text file:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Product Id="*" Name="ShortcutTest" Language="1033" 
           Version="1.0.0.0" Manufacturer="Widget Co" 
           UpgradeCode="--YOUR GUID1--">
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />

    <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
    <MediaTemplate EmbedCab="yes"/>

    <Feature Id="ProductFeature" Title="ShortcutTest" Level="1">
      <ComponentRef Id="TextFile" />
      <ComponentRef Id="ShortCut" />
    </Feature>

    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id="INSTALLFOLDER" Name="ShortcutTest">
          <Component Id="TextFile" Guid="--YOUR GUID2--">
            <File Id="File" Name="TextFile.txt" Source="TextFile.txt" KeyPath="yes"/>
          </Component>
        </Directory>
      </Directory>

      <Directory Id="ProgramMenuFolder">
        <Directory Id="ApplicationProgramsFolder" Name="Shortcut Test">
          <Component Id="ShortCut" Guid="--YOUR GUID3--">
            <RegistryValue Root="HKMU" Key="Software\WidgetCo\ReadMeTextFile\TextFile" Name="Installed" Type="string" Value="yes" KeyPath="yes"/>
            <Shortcut Id="Shortcut"
                Name="Open Text File"
                Description="Opens a text file"
                Target="[INSTALLFOLDER]TextFile.txt"
                WorkingDirectory="INSTALLFOLDER"/>
            <RemoveFolder Id="ApplicationProgramsFolder" Directory="ApplicationProgramsFolder" On="uninstall"/>
          </Component>
        </Directory>
      </Directory>
    </Directory>
  </Product>
</Wix>

      

If you build the above example in an MSI package, you get this Internal Consistency Analysis Error (ICE) :

D: \ Robert \ Documents \ Visual Studio 2013 \ Projects \ ShortcutTest \ Product.wxs (27,0): error LGHT0204: ICE57: Component "ShortCut" has both data for each user and a path to the key, which can be -user or for each machine.

ICE57 implies inconsistency between data for each user and each machine. But the key component path is HKMU, which in every machine installation enables HKLM (HKEY_LOCAL_MACHINE). The location of the shortcut comes from the "ProgramMenuFolder" which switches to C:\ProgramData\Microsoft\Windows\Start Menu\

(in Windows 8.1) every time the machine is installed . None of the component resources have any kind of association for each user.

You can create an installer package in MSI by suppressing ICE57. The resulting MSI package installs without any obvious errors. Multiple users can log in and access the shortcut. Anyone can remove the package and all resources in the package will be removed.

Wix's answer creates a non-advertised label for all users / per machine has an interesting workaround which is to advertise the author's labels and then disable ads. There seems to be a circle around creating non-advertised shortcuts.

A common solution for the ICE57 error is to change the root <RegistryValue...>

to HKCU (HKEY_CURRENT_USER). However, this creates an installer that can leave the user's registry key behind when not installed. For example, if user A installs a package, a registry entry is added to the user. Registry hive. If User B removes the package, the registry entry is not removed from the user's registry hive.

In this case, is the ICE57 error a bug in the internal consistency analyzers? Or is there something I missed - got it?

+3


source to share


2 answers


While researching another issue, I found this comment at http://sourceforge.net/p/wix/mailman/message/26687047/ from Rob Mensching:

IIRC, this is a bug in ICE57. The Windows Installer team did not look at ALLUSERS when assessing these values ​​... it was a long time ago although my memory may have been a little rotted.



Looks like a bug in ICE57.

+2


source


Move the shortcut to a child file and add the attribute Adversite="yes"

. RegistryValue

should do the trick to convert the shortcut from perUser to perMachine.



<Fragment>
    <Directory Id="TARGETDIR" Name="SourceDir">
        <Directory Id="ProgramFilesFolder">
            <Directory Id="INSTALLFOLDER" Name="MyApp" />
        </Directory>

        <Directory Id="ProgramMenuFolder" Name="Programs">
            <Directory Id="ApplicationProgramsFolder" Name="My App Name" />
        </Directory>
    </Directory>
</Fragment>

<Fragment>
    <ComponentGroup Id="ComponentGroup_Core">
        <Component Id="Component_App" Guid="INSERT_GUID_HERE" Directory="INSTALLFOLDER">

            <RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[AppName]" 
                           Name="AppInstalled" Type="string" Value="yes" KeyPath="yes"/>

            <File Id="MyApp" Name="My Test App.txt">
                <Shortcut Id="Shortcut"
                          Name="Open Text File"
                          Description="Opens a text file"
                          Directory="ApplicationProgramsFolder"
                          WorkingDirectory="INSTALLFOLDER" />
            </File>
        </Component>
        <Component Id="Component_MenuFolder" Guid="INSERT_GUID_HERE"
                   Directory="ApplicationProgramsFolder">
            <RegistryValue Root="HKCU" Key="Software\[Manufacturer]\[AppName]"
                           Name="MenuFolderInstalled" Type="string" Value="yes"
                           KeyPath="yes"/>
            <RemoveFolder Id="RemoveFolder_App" On="uninstall" />
        </Component>
    </ComponentGroup>
</Fragment>

      

0


source







All Articles