I am busy working on a piece of software which stores a .config file within the installation folder (C:/Program Files/...). This config file needs to be updated when the software is used which currently works fine when the user has Admin rights, however when a non-admin user attempts to use the software exceptions occur since they don't have permission to update files within C:/Program Files/.
The code used to update the config file is as follows:
Configuration config = ConfigurationManager.OpenExeConfiguration(fileName);
config.AppSettings.Settings.Add("New Setting");
config.Save();
Is there anyway to allow a non-admin user to update this config file? Maybe by changing something in the actual config file or changing the way in which I update it?
Ideally I would move the file to the App Data folder but this could be a fair bit of work so I would prefer to avoid having to do this.
Any help would be greatly appreciated.
Thanks in advance