特定组件的"ICE38:组件安装到用户配置文件"错误

Tor*_*edt 7 windows-installer wix wix3.6

我正在尝试使用每台机器和x64架构设置在WiX 3.6中编写Windows Installer脚本.我有以下项目结构(缩短):

<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>
Run Code Online (Sandbox Code Playgroud)

问题是我ICE38: Component TemplateFiles installs to user profile. It must use a registry key under HKCU as its KeyPath, not a file在编译时收到了TemplateFiles组件的错误.令我困惑的是,我在另一个项目(工作)中使用了类似的结构,并且在我的项目中有几个组件具有完全相同的设置(上面未显示).为什么这个 - 也是唯一的 - 组件坚持在将所有其他人正确安装到用户配置文件时安装到Program Files?

Ili*_*ski 6

看起来和文件夹msi之间存在显着差异.最后一个在您的示例中引用:Program FilesUsers\UserName\Documents

<Directory Id="DataFolder" Name="Data">
Run Code Online (Sandbox Code Playgroud)

我遇到了类似的问题并在博客文章中找到答案 - http://robmensching.com/blog/posts/2007/4/27/How-to-create-an-uninstall-shortcut-and-pass-all -The

简而言之,您需要RegistryKeyHKCUroot 上定义为子元素Component,并将RemoveFolder元素添加为子元素Directory.请参阅上面的链接以获取完整示例.此外:

  • KeyPathComponent元素中删除属性
  • RemoveFolder可能必须为所有文件夹定义.我使用了虚拟组件,里面没有文件