Search code examples
c#installationproperties.settings

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?


Solution

  • 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.