Search code examples
.netvisual-studio-2010wixwix3.5application-settings

Wix: Losing .NET Application Settings


We managed to upgrade the setup project from Visual Studio (2010) Setup to Wix based setup for our software. Everything works beautifully except one problem:

Our software is .NET 2.0 based and using application settings. In the Wix setup project, we were keeping the upgrade code the same as the one we used in VS setup in order to keep those application settings. However, when I installed the new version (built with Wix), .NET framework created a different hash code (TestApp.exe_Url_hash)from the one built from VS setup.

Interestingly, even I use the same product code and upgrade code. The problem is the same.

My questions are as follows:

  1. How can I keep the original application settings in Wix setup?

  2. Is there any way to read the application setting values from a different application?

Thanks very much in advance for any comments.


Solution

  • You can create an msi custom action invoked during the upgrade to read values from your old configuration and save them in the new configuration.

    Check out the Client Settings FAQ here:
    http://blogs.msdn.com/b/rprabhu/archive/2005/06/29/433979.aspx

    Also see these questions:
    Can I control the location of .NET user settings to avoid losing settings on application upgrade?
    How to load a separate Application Settings file dynamically and merge with current settings?
    Custom path of the user.config

    HTH