Here I will post problems I and my colleagues met and solutions we found.

Monday, November 15, 2010

app.config file and MSI

There are so many examples in the internet demonstrating how to update your app.config file during installation. But these examples never tell you about consequences of this action. And there are some.

If you use installer from Visual Studio 2008 or 2010, you probably use RemovePreviousVersion property, by setting it to true. However, starting from 2008, the the implementation of this feature changed significantly, so significantly that it has nothing to do with the name of the property. Previous version is no longer uninstalled, and there some rules for updating old files with new ones. While "versioned" files handled straightforwardly, by replacing the file with newer version, content files are replaced only if they were not changed after previous installation.

Back to updating app.config files during installation. When you changing them during installation, you change them from those that were included in your .msi package. That means it will be ignored in the next update.

See this link. http://msdn.microsoft.com/en-us/library/aa370531.aspx

No comments: