Why is it not recommended to use HKCR registry root key in Inno Setup?

依然范特西╮ 提交于 2021-02-19 08:06:29

问题


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:

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?

Also, I've noticed that in the examples in the documentation they use HKEY_AUTO instead of HKA. Are those the same?


回答1:


It is probably based on Microsoft recommendations for avoiding use of HKEY_CLASSES_ROOT:

It is primarily intended for compatibility with the registry in 16-bit Windows.

To change the settings for the interactive user, store the changes under HKEY_CURRENT_USER\Software\Classes rather than HKEY_CLASSES_ROOT.

To change the default settings, store the changes under HKEY_LOCAL_MACHINE\Software\Classes

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.



来源:https://stackoverflow.com/questions/61524556/why-is-it-not-recommended-to-use-hkcr-registry-root-key-in-inno-setup

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!