I’ve several long-standing apps written in Delphi that persist their settings in the registry. I’ve used HKEY_LOCAL_MACHINE for ‘hard’ settings such as configuration preferences and HKEY_CURRENT_USER for ‘soft’ info such as window positions, MRU lists etc.
Now my users are telling me that in non-admin (standard user) mode the apps dont work. Looking, I see that I’m not able to read a setting put into HKEY_LOCAL_MACHINE when the app was in admin mode.
What are my options for this? I know little about standard mode and how this affects access to the registry at all. Any info appreciated.
You can read from HKLM as a non-admin user; you just can’t write to it.
Use TRegistry.Create(KEY_READ) when constructing it, and set the RootKey to HKLM.
You can also use TRegistry.OpenKeyReadOnly() when opening a specific registry key; this helps with non-admin access to areas of the registry as well.