T
T
tangro2010-09-14 16:15:43
Windows
tangro, 2010-09-14 16:15:43

Where to write general data to the Windows registry with UAC enabled?

Starting with Windows Vista, this OS introduced User Account Control, which, when enabled, prohibits writing to the HKLM registry branch even for applications launched by the administrator. Our application stored general settings (independent of users) in HKLM\Software\OurCompany\OurProduct\Settings. Now you can't write there. I don’t feel like writing in HKCU - the general settings are the same for all users.
Question: so where to write? Somewhere there is a partition available for reading and writing for all users? (Please do not offer to write to files - there are reasons for that).

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
amirul, 2010-09-15
@tangro

In general, the application of such settings should always ask permission from the administrator (via UAC). But if you really want to, you can break the guidelines and just change the ACLs for your key in HKLM during installation.
For this you will someday be written in The Old New Thing

A
Aux, 2010-09-14
@Aux

If the settings are unchanged for the entire time of using the application, then you need to write them using the installer. The installer in any case asks for elevation of rights through UAC.
If one of the users wants to change these settings, it will affect all other users of this computer and this program. Therefore, without UAC, again, nowhere - the user must be aware of what he is doing.
The answer is no. Be friends with UAC and do not invent crutches.

B
belk, 2010-09-14
@belk

What about virtualization? HKLM\Software is included in the list of virtualized locations.
OSzone: Protecting System Files with UAC Virtualization
Microsoft: Article for Windows Vista Developers: Application Development Requirements for User Account Control (UAC) → Help File → User Account Control → References

X
xn__p2a, 2010-09-14
@xn__p2a

And why not in the config file in% appdata%?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question