WIX Patch Update XML Configuration File

Go To StackoverFlow.com


Let's say I created a WIX installer that installed a Windows Service and a XML configuration file. This would then be installed at a client.

Later in development I need to add/remove some elements from the XML configuration file. Can I create a WIX PATCH that will simply update nodes in that XML configuration file WITHOUT completely overwriting the current settings?

2012-04-03 22:07
by aherrick


When you create a patch, you take your source .MSI and your updated .MSI and do a diff between them, and that becomes your patch. So I would imagine that would be fine as long as the updates to the nodes are reflected in the patch.

That said, you could also do this with major upgrades. When you install your configuration file, you can set the installer to not overwrite the current file. If you edit that configuration file on install (using xmlfile or xmlconfig actions for example), you can set a condition on the components that perform those modifications.

Another option is to read the configuration file on install if it exists. It will get removed on uninstall of the old version and on the install of the new version you can install the cached values.

2012-04-06 02:27
by BryanJ