Visual Studio Walkthrough - using end-user modified configuration settings in a desktop application.


can recommend good visual studio walkthrough details how install , use *.config file within the  vista / windows 7 security model?

i've got c# application reads configuration file @ application startup: myapp.exe.config. xp installed *.config file in same folder executable - typically c:\program files\company name\product name. before running application first time, end-users (technical folks) open application's *config file (using notepad), change various settings match run-time environment, save *.config file, run applicaiton , application read *.config file current directory (the directory *.exe file located).

the trouble - when application is installed into to a vista or windows 7 environment, end-users permissions error when trying save *.config file c:\program files\company name\product name folder. around this, end-user typically changes permissions on folder allow end-user account to save updated *.config file c:\program files\company name\product name folder.

but i'm guessing not microsoft recommended approach handling desktop application *.config files.

so tried modifying application expect its *.config file reside in new vista / windows 7 c:\programdata folder - specifically: c:\programdata\company name\product name. in folder, while end-user can create new files end-user still gets permissions error when attempting save updated version of *.config file installed application.

so maybe answer store application's *.config file in sub-folder of %userprofile%? approach lead additional problems:

  • on computer used more single end-user windows account; into end-user's %userprofile% folder application installer place application's *.config file? maybe end-user's, in case ever decide run application?

in event, rather continue guess how should done, i'm wondering if microsoft has provided vs walkthrough or white paper explains, in detail, how should done. i'm looking both example of application project + example of application's installer project.

thank you.


tech_net_user

at time suspect users administrators application not being run administrator , not have required permissions.

assigning granular permissions %program files%\your program\ users work, but, not practice.

from reading these forums (and experience) proper place put file in users application data directory.

 

to around configuration users run "stub" each existing , new user of machine...that msi thing.

the stub have user settings , deploy everytime there new user (think of ie doing set first time log machine)

the configuration users should done on installation , not afterwards.

 

hope helps.....does sound workable?

 

countrystyle

ps: see thread proper locations of storing of programs files (another item not discussed in post)

http://social.msdn.microsoft.com/forums/en-us/csharpgeneral/thread/8d23162a-c580-466f-a8e6-b9eb0b9a0b04

 

 






Visual Studio Languages  ,  .NET Framework  >  Visual C#



Comments

Popular posts from this blog

Azure DocumentDB Owner resource does not exist

job syspolicy_purge_history job fail in sqlserver 2008

Trying to register with public marketplace error with 'Get-AzureStackStampInformation'