[wix-users] Create and further maintain .CONFIG configuration files

Phill Hogland phill.hogland at rimage.com
Wed Mar 8 06:49:26 PST 2017

My bundles/msi packages install a number of apps with .config files.  I use XmlConfig.  (I believe that XmlFile is an older implementation with more limited functionality in some scenarios.)  But I also push back on the application designer so that the application manages the per-user details.  My bundles/MSIs are all per-machine, so the 'default' .config is installed to a per-machine location, using early scheduling of REP in Major Upgrade MSI, meaning that the default is removed and that new or different elements or values are easily managed in the setup authoring using XmlConfig.

The application is then responsible for copying values from the default .config to a per-user or appData .config and migrating any schema changes resulting from a Major Upgrade change to the application.  And on uninstall per-user data is never uninstalled as the setup is not aware of it.  By separating the per-user and per-machine concerns the management process is simplified.

I had one developer who took over an application project where this separation was implemented and functioning.  He took it all out of the application and started writing user data back into the 'default' .config.  Then when he realized the problems he started complaining about the setup.   I pushed back with information to help him understand the reason for separating per-user and per-machine concerns.  I think the old wix-users nabble forum had a number of posts that were helpful on this issue.  I don't recall which blogger I should give credit to for the above advice, but Heath provides good advice here:


Installation Guidelines for User-editable Configuration ...<https://blogs.msdn.microsoft.com/heaths/2006/12/21/installation-guidelines-for-user-editable-configuration/>
A common problem with installations is user-editable files and registry keys. Configuration of this nature is a problem for every installer technology, but ...

From: wix-users <wix-users-bounces at lists.wixtoolset.org> on behalf of Tigran Galoyan <tigran.galoyan at gmail.com>
Sent: Tuesday, March 7, 2017 1:48:43 PM
To: WiX Toolset Users Mailing List
Subject: [wix-users] Create and further maintain .CONFIG configuration files


This time I confronted with a task to create and maintain configuration
files. I was hoping to find the same easy and complete functionality to
deal with .config files as I do with INI, however, it turned
out configuration files are not easy manageable ones.

The task is to copy the default .config file if it doesn't exist on the
customers PC. The file should not be deleted from the target PC on
uninstall. The Permanent="yes" of the parent Component element takes care
of this. However, from time to time I may want to modify the .config file
by adding new element with new attributes, updating the value of the
existing element or the value of its attribute, or delete an existing
element or its attribute. Overwriting the whole file is not an option since
the customer might have customized the .config file, so I only may need to
push new but default updates to the customer's .config file. As .config
files are XML files then I tested lots of scenario using the XmlConfig and
XmlFile elements from Utility extension lib. However, it's like a
nightmare, many things don't work or if possibly work then not the way as I

Anyone can help me out with it, any suggestions how to take care of
implementing it. Perhaps, there are better ways to cover all required
functionality to work with .config files?

Another option I wanted to try is not to provide a source initial default
configuration file, rather, like for INIs I wanted to generate the .config
file right on the customer PC during the install by having only XmlConfig
and XmlFile declarations under my Component element, however, I fail on
creating even the first root element.

Any thoughts, any ideas?


WiX Toolset Users Mailing List provided by FireGiant http://www.firegiant.com/

More information about the wix-users mailing list