Extreme JS

JS Greenwood's WebLog on architecture, .NET, processes, and life...

Editing app.config Files During Installation

One problem that's always been apparent in .NET projects is applying changes in application configuration during deployment.  There's a longer article I'm going to write shortly on managing differing configurations between environments in the enterprise.  But for now, I've come up with a small utility that overcomes one glaring omission with .NET Setup & Deploy projects - taking settings entered within the installation wizard and applying them to the application being deployed.  Whilst you can capture settings from the "User Interface Editor" screens quite nicely, and the web.config/app.config is a pretty good way of storing settings in smaller applications, there's no built-in way of combining the two.  Obviously, in a larger application, a more structured way of storing data is needed than the .config files, and another deployment product such as those by Wise and InstallShield is more appropriate, but that still leaves the majority applications where the built-in VS.NET support chosen falls short of requirements.

So, as I had a small project to do for a colleague that needed a semi-professional installer, I came up with a WinForms application that would take configuration changes captured as part of the installer as part of it's command-line arguments (as name=value pairs), apply them, then close down, allowing for it to be added as a custom action in the installer.  It supports a couple of other things, too - merging two config files, running without a UI, etc.  It's available for download at http://www.altervisitor.com/software/NetConfigUpdater.msi, and is freely useable/distributable as long as the author credits remain intact.  Usage instructions are included as part of the MSI.  Feel free to post feature requests on the comments to this entry, and use the mailing form to send any bugs found back to me.

Screenshot
.NET Configuration Updater screenshot

Posted: Aug 02 2004, 12:25 AM by jsgreenwood | with 5 comment(s)
Filed under:

Comments

TrackBack said:

# August 2, 2004 10:18 AM

chadbr said:

Good stuff - I've been needing something like this for ages -- just never had time to do it... Looking forward to the article.
# August 3, 2004 11:07 AM

KJ said:

Will this edit the machine.config file as well?
# August 30, 2004 4:39 PM

JS Greenwood said:

> Will this edit the machine.config file as well?
If you point the editor at the machine.config, then it be able to read it in, etc. *But*, it can only amend "configurationSettings" entries, not all the others.

I'm working on another tool that should be out in the next week or so that will "ease" doing things like that, though...
# August 31, 2004 10:09 PM

Jens said:

Seems that i won´t work properly with Visual Studio 2005 and .Net ver. 2

# June 27, 2007 9:21 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)