"ICE38: Component installs to user profile" error for a specific component
Asked Answered
R

1

10

I am trying to write a Windows Installer script in WiX 3.6 with a per-machine and x64 architecture only setting. I have the following project structure (shortened):

<Directory Id="ProgramFiles64Folder" Name="PFiles">
    <Directory Id="APPLICATIONFOLDER" Name="My Company">
      <Directory Id="ProductFolder" Name="My Product">
        <Component Id="MainComponent" Guid="" Win64="yes" KeyPath="yes">
            ...
        </Component>
        <Directory Id="DataFolder" Name="Data">
          <Directory Id="Machine" Name="Machine" >
            <Directory Id="MachinesFolder" Name="Machines">
              <Component Id="Machine1" Guid="{74341536-72DF-48C3-95E8-2851D9FA8318}" Win64="yes" KeyPath="yes">
                        ...
              </Component>
            </Directory>
            <Directory Id="TemplateFolder" Name="Template">
              <Component Id="TemplateFiles" Guid="{A0D0C225-D604-4B84-971D-41687A30EC36}" Win64="yes" KeyPath="yes">
                <File Id="Template1.rsbak" Source="$(var.SolutionDir)bin\Release\File1.rsbak" />
                            ...
              </Component>
            </Directory>
          </Directory>
        </Directory>
      </Directory>
    </Directory>
</Directory>

The problem is that I receive the error ICE38: Component TemplateFiles installs to user profile. It must use a registry key under HKCU as its KeyPath, not a file for the TemplateFiles component when I compile. What confuses me is that I use a similar structure in another project (working), and have several components with the exact same setup in my project (not shown above). Why does this - and this only - component insist on installing to the user profile when all others get installed correctly, to Program Files?

Reproduce answered 12/10, 2012 at 13:37 Comment(0)
I
9

Looks like there's significant difference for msi between Program Files and Users\UserName\Documents folders. The last is referenced in your example:

<Directory Id="DataFolder" Name="Data">

I came to the similar problem and found an answer in the blog post - https://robmensching.com/blog/posts/2007/4/27/how-to-create-an-uninstall-shortcut-and-pass-all-the/

In short you need to define RegistryKey on HKCU root as subelement to Component and add RemoveFolder element as subelement to Directory. See the link above for full example. In addition:

  • Remove KeyPath attribute from Component element
  • RemoveFolder possibly have to be defined for all folders. I used dummy component with no file inside for that
Inosculate answered 11/12, 2012 at 8:33 Comment(3)
Thank you. Although my problem solved itself(!?) when we were forced to re-structure our folders, I believe your answer is the right way to do it.Ufo
Pleasure. I had this same problem myself. So added a solution for the next guys that will have it.Inosculate
That link was down for me today. I'm not sure if that's temporary, but here is an archive link in case not: web.archive.org/web/20190916230607/https://robmensching.com/…Leelah

© 2022 - 2024 — McMap. All rights reserved.