You have an application, and you want users to be able to modify registry keys or files in places that only administrators can change by default.
If you are using Windows 2000 or Windows XP or Windows Vista or Windows 7 or Windows 8, the solution will be the same:
- provide appropriate permissions for these locations
For example, if your program needs to modify files in:
C:\Program Files\Blizzard\World of Warcraft
Then the right action to change permissions in the World of Warcraft folder. This is essentially the pad that Microsoft applied to World of Warcraft . (The next time he started, he provided Everyone Full Control to a folder - how else can WoW be updated, no matter which user is logged in.)
If you want users to be able to modify files in one place: you must grant them permission. If you were a standard user trying to run WoW on Windows XP , you will have the same problem - and you need to apply the same solution.
Your application writes its configuration to:
C:\Program Files (x86)\Hyperion Pro\preferences.ini
then you really do want to give users Full access to this file:

So yours:
- application is not configured to run as administrator
- users cannot modify the executable
- users can modify
Configuration.ini
Granting permissions is not so bad; this is how you administer your server.
There are two solutions:
- Install on
C:\ProgramData\Contoso\Preferences.ini and ACL during installation - Install in
C:\Program Files\Contoso\Preferences.ini and ACL during installation
And if you look at the AppCompat guy's guide at Microsoft:
Where can I write program data instead of program files?
A common distribution of application code is: โmy application used to write files to program files. It was as good as any other. I already had the name of my application, and since my users were admins, this worked fine, but now I see that this may not be as good as I once thought, because even administrators work with UAC with standard user privileges most of the time. are my files instead? "
FOLDERID_ProgramData STRONG>
The user will never want to browse here in Explorer, and the settings changed here should affect every user on the machine. The default installation location is% systemdrive% ProgramData, which is a hidden folder when installing Windows Vista. Youll want to create your directory and install the ACLs that you need during installation.
So you have two solutions:
- create the file at installation time and ACL so that all users can modify it at run time
- create the file at installation time and ACL so that all users can modify it at run time
The only difference is semantic. The Program Files folder is for program files . You do not want to store data here.
- And this is not because Diego Queiroz has a sense of security.
- This is because wherever programs go.
Sometimes machines are displayed again and again with the same Program Files . You do not want the data in the machine displayed on your image. This data belongs to ProgramData strong>.
And this is not a security issue.
Some people need to find out where the security border is.