为什么不建议在Inno Setup中使用HKCR注册表根密钥? [英] Why is it not recommended to use HKCR registry root key in Inno Setup?
问题描述
我必须将一个值写入 HKEY_CLASSES_ROOT
键.为此,我会写:
I have to write a value to the HKEY_CLASSES_ROOT
key. In order to do that I would write:
RegWriteStringValue(HKCR, '<Root>', '<SubKey>', '<Value>');
但是当我查看文档时,我看到了:
But when I looked in the documentation I saw this:
不建议使用HKCR,而是将HKCA的Subkey参数设置为"Software \ Classes".
Using HKCR is not recommended, use HKA with the Subkey parameter set to "Software\Classes" instead.
我想知道两者之间有什么区别?
I'd like to know what's the difference between the two?
我还注意到,在文档的示例中,它们使用 HKEY_AUTO
而不是 HKA
.那些都一样吗?
Also, I've noticed that in the examples in the documentation they use HKEY_AUTO
instead of HKA
. Are those the same?
推荐答案
It is probably based on Microsoft recommendations for avoiding use of HKEY_CLASSES_ROOT
:
它主要是为了与16位Windows中的注册表兼容.
It is primarily intended for compatibility with the registry in 16-bit Windows.
要更改交互式用户的设置,请将更改存储在 HKEY_CURRENT_USER \ Software \ Classes 下,而不是 HKEY_CLASSES_ROOT 下.
要更改默认设置,请将更改存储在 HKEY_LOCAL_MACHINE \ Software \ Classes
在交互式用户以外的安全上下文中运行的进程不应将 HKEY_CLASSES_ROOT 键与注册表功能一起使用.
Processes running in a security context other than that of the interactive user should not use the HKEY_CLASSES_ROOT key with the registry functions.
这篇关于为什么不建议在Inno Setup中使用HKCR注册表根密钥?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!