Wix - 该目录位于用户配置文件中,但未在RemoveFile表中列出

时间:2012-02-27 14:59:20

标签: installer wix windows-installer

我想在开始菜单中创建一个子文件夹,在我的情况下PMFCompanyFolder已经存在且包含链接,我不想在卸载产品时删除。

所以我没有推送RemoveFolder属性,我得到了:

ICE64: The directory PMFCompanyFolder is in the user profile but is not listed in the RemoveFile table.

<Directory Id="TARGETDIR" Name="SourceDir">
  <Directory Id="ProgramMenuFolder">
    <Directory Id="PMFCompanyFolder" Name="MyCompany">
      <Directory Id="PMFProductFolder" Name="MyProduct"/>
    </Directory>
  </Directory>
</Directory>

<DirectoryRef Id="PMFProductFolder">
  <Component Id="PMFProductFolderComponent" Guid="A13A7784-4C82-4CBE-9018-CEC6F266743B">
    <RemoveFolder Id="null" On="uninstall"/>
    <RegistryValue Root="HKCU" Key="Software\Microsoft\MyCompany\MyProduct" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
  </Component>
</DirectoryRef>

<Feature Id="ProductFeature" Title="" Level="1">
  <ComponentRef Id="PMFProductFolderComponent"/>
</Feature>

1 个答案:

答案 0 :(得分:11)

您应该传递文件夹ID:

 <RemoveFolder Id="PMFCompanyFolder" On="uninstall"/>

在卸载时将其删除是安全的 - 不会删除预先存在的项目。