A: 

Afaik the installer can be extended with classes that do things.

On INSTALL-action to do could be to

var path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData),
                    "My app name");
if (!Directory.Exists(path)) Directory.CreateDirectory(path);

And vice-versa on uninstall.

App.config files are related to where the physical assembly is located I think.

Henrik
Yes this is true dude, the config is related to where the physical assembly is located problem i have used the ConfigurationManager class to generate me a config file for my application.There is no need to extend the installer with classes as the VS Installer allows you to add special folders anyways, so it's easy to create the strucutre your application needs on an end client system. Problem is I am stuck with ConfigManager class as that is what I have implemented.
IbrarMumtaz
A: 

Actually, if your app is running on the user's machine- it will have whatever permissions that user has. So most likely, you can expect to be able to write anywhere on the file system.

However it is possible the user would be running under a restricted acct, and thus not have the permissions. So you could just use the registry to store where your config file is (install folder), then when you try to update it, if it fails for permissions, ask the user to grant it.

Or you could use the Windows standard folders, as you were getting at, because doing so also separates out user data from application data.

Use the Environment.GetFolderPath () method to get the 'special folder' paths in your app.

http://www.programmersheaven.com/2/Les_CSharp_15_p2

http://msdn.microsoft.com/en-us/library/14tx8hby.aspx

Bobby
The first link is dead mate???
IbrarMumtaz
For Vista and 7 users, this is the case. The config file cannot be in the same folder as the application source file. As the user will not and windows will not grant permissions to allow the user tp update a config file local to the application. So this seperates functionailty out as expected. Problem is the configuarionmanager class expects the config file to be local and not under the 'Special Folder' UsersAppData folder. Got any ideas?
IbrarMumtaz
+1  A: 

If you are using the VS Settings file to create application setting keys, and have values that the user might want to change in runtime, and save his preferences, just set the scope of those settings to "User" instead of "Application".
That way you will have a setter method for them, and you can edit the Settings.Default instance, and when you are done call the Save() method to persist them to disk.

The file will be saved in the user's "AppData" folder, wherever it is, under some cryptic folder. But you needn't worry about it's location most of the time, since it will be read automatically on the next execute, and persisted to the same location on subsequent runs.

Noam Gal
This is exactly what I am after and many good comments ... I need to do some research ... I always knew this existed but I never used. I just used the ConfigurationManager class to create my own AppSettings.config file.
IbrarMumtaz
This is the ideal and accepted solution but I have already implemented the ConfigManager class so I would really appreciate you offering up some help?
IbrarMumtaz
A: 

If you are talking about application settings found on project Properties -> Settings tab, then there're two different types of settings: user-level and application-level.

If you need to change any settings in run-time, these would be user-level settings (http://msdn.microsoft.com/en-us/library/cftf714c.aspx) and all changes would be buried somewhere in the private folder in your user profile.

If you want to update application-level settings, your best shot would be to do that during software installation. In this case you don't need to look for the configuration file (YourApp.exe.config) anywhere but in the application folder. More likely you would need to create some sort of post-install event handler in your setup package and run some script or another application which would update data in YourApp.exe.config. Everything in the setup package will be executed with elevated priviledges and thus that configuration file would be writeable. BTW, this scenario applies to 2000 and XP, if the user is using limited user account type priviledges.

A: 
IbrarMumtaz