David Hodgson
David Hodgson

Reputation: 10344

C# project installer - where are user settings saved in an installation context?

I'm trying to set some user configurations in an installer. For instance, I'm using:

Properties.Settings.Default.mapURL = txtBoxMapURL.Text.Trim();
Properties.Settings.Default.Save(); 

in a Windows Form that the installer class calls. However, upon launching the application, the setting doesn't persist. The next time I try to configure the setting in the installer, it reads the correct value into the textbox. So it's saving the setting somewhere, I'm just having a hard time figuring out where.

It's not being saved in C:\program files\[manufacturer]\[product]\[product].exe.config, and also not in C:\Documents and Settings\[User]\Local Settings\Application Data\[Manufacturer][Product].exe\user.config.

Any idea where the installer is temporarily storing the setting, and is there a way to store a user setting during an installation?

Upvotes: 1

Views: 6070

Answers (2)

David Hodgson
David Hodgson

Reputation: 10344

The user.config file was being updated from the installer, but it is saving and reading the config (for my particular application) from:

C:\Documents and Settings\Long\Local Settings\Application Data\Microsoft_Corporation\DefaultDomain_Path_w551cnaciyzcylzfdpgyceaw05mmrhk0\3.1.4001.5512\user.config.

Unless there's another way to update the correct user.config file, it looks like I'll have to run a runonce type of thing when the application is first launched.

Upvotes: 1

Gabriel
Gabriel

Reputation: 1273

The place they get saved to is the user.config... check: http://msdn.microsoft.com/en-us/library/aa730869(VS.80).aspx

Is the scope of your settings 'user' and not 'application' - as the application guys can't be saved.

Do check THIS out: How can I set application settings at install time (via installer class) ... seems like a similar issue.

Upvotes: 1

Related Questions