“ICE38: Component installs to user profile” error for a specific component

烈酒焚心 提交于 2019-12-08 17:38:13

问题


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?


回答1:


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 - http://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


来源:https://stackoverflow.com/questions/12860316/ice38-component-installs-to-user-profile-error-for-a-specific-component

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!