WIX:对RemoveRegistryKey的错误LGHT0204,但对于RemoveRegistryValue没有

时间:2014-01-31 09:38:12

标签: wix wix3.8

这很好用:

<DirectoryRef Id="INSTALLDIR">
  <Component Id="RegistryValues" Guid="...">

    <RegistryKey Root="HKLM" Key="Software\company\Server" >
      <RegistryValue Type="string" Name="InstallPath" Value="[INSTALLDIR]" KeyPath="yes"/>
    </RegistryKey>

    <RemoveRegistryValue Root="HKCU" Key="SOFTWARE\company\Server" Name="version"/>

  </Component>
</DirectoryRef>

但是这个:

<DirectoryRef Id="INSTALLDIR">
  <Component Id="RegistryValues" Guid="...">

    <RegistryKey Root="HKLM" Key="Software\company\Server" >
      <RegistryValue Type="string" Name="InstallPath" Value="[INSTALLDIR]" KeyPath="yes"/>
    </RegistryKey>

    <RemoveRegistryKey Action="removeOnUninstall"
                       Root="HKCU" Key="SOFTWARE\company\Server\version"/>

  </Component>
</DirectoryRef>

导致错误:

error LGHT0204: ICE57: Component 'RegistryValues' has both per-user and per-machine data with a per-machine KeyPath.

为什么第一种情况不会引发同样的错误?
版本3.8.1128.0

0 个答案:

没有答案