这很好用:
<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