views:

1830

answers:

2

Hi,

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?

+1  A: 

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: http://stackoverflow.com/questions/523619/how-can-i-set-application-settings-at-install-time-via-installer-class ... seems like a similar issue.

Gabriel
It's a user setting, not application. You can actually change the application settings too, by using the ConfigurationManager class. I can save application settings just fine from the installer, just not user settings. It's updating a user.config file in a funky place.
David Hodgson
A: 

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.

David Hodgson