My.Settings Getting Lost in the Upgrade

Hi,

This is not a problem directly related to the updater, as the product is performing very well. Great software by the way! Really nice work.

The problem I am having, and the one issue that stands in the way to me adopting this for all of our products is the issue of VB.NET My.Settings getting lost in the update.

We use My.Settings to store all of our application settings. The .NET framework creates an XML file called "user.config" that gets stored in a directory that is version-specific, something like:

C:\Users\Brent\AppData\Local\MyCompany\MyApp.exe_Url_ls4wr01cf31rsuuqecdvqlj45uw1flnj\1.1.1.0

It stores just those settings that are changed from the defaults. The problem is that this information gets lost in the update. I know that, for example, the ClickOnce updater imports settings from previous versions, but the AutomaticUpdater doesn't know to do this ... unless I am missing something.

Is there a way to avoid losing this config information during the update? I suppose I could write code in the application to find the old config file and copy it into the current apps appdata directory. It would be great if this could happen automatically though.

Any advice?

-Brent

Hey Brent,

It stores just those settings that are changed from the defaults. The problem is that this information gets lost in the update. I know that, for example, the ClickOnce updater imports settings from previous versions, but the AutomaticUpdater doesn't know to do this ... unless I am missing something.

Is there a way to avoid losing this config information during the update?

Unfortunately the AutomaticUpdater doesn't do this by default. It's a good idea. I'll see if we can squeeze it in for the wyBuild 2.6 release. It might come in 2.6.1 or 2.6.2.

Though there is a hacky way you can do this with the current version:

Use the "ReadyToBeInstalled" event to save the current config location to registry and then use the "UpdateSuccessful" event to copy over the old config information to the new location.

Wow, quick reply, and a good suggestion.

-Brent