Hi all,
I'm writing a Windows application using .NET (C#). This application needs to have a file in which settings are stored. These settings are to do with which features of the application have been unlocked, and are hence editable at run-time. I don't want the settings to be user-dependent, as I want the features to be available to all users of the computer, not just the user that unlocked them.
I'd like the settings file to be installed at deploy-time (using the setup project available in Visual Studio), and then accessible (with read/write permissions) to all users at run-time.
Does anyone have any suggestions how this can be done, and in such a way that it will work on all newer versions of Windows (XP/Vista/7)? I'd also like to adhere to recommended security practices, in that the application should run fine under normal user permissions (although it will need to be deployed under administrator permissions).
Thanks in advance for your help/suggestions,
Steve.
P.S. Thoughts I've had so far:
I've noticed that the setup project exposes the a " Common Files Folder" "special folder" which could be of use to me, although this deploys to 'C:\Program Files\Common Files' which doesn't have write permissions for all users.
I've also noticed that .NET exposes the following enum item available in C#: Environment.SpecialFolder.CommonApplicationData. This sounds perfect, but I'm not sure how to access this using the setup project? Will this folder provide the permissions I need?
Is there some way I can add user write permissions to a folder (or a sub-folder I create) at deploy-time? Instead, should I be looking at using a registry key to hold the text I intended on storing in the settings/ini file?