I have a .NET program that I've written a Wix installer for. I want to be able to update from a pre-Wix version. To do this, I'd like to read from the installed program's app.config file. This will save the user from having to manually retype in all of these values. Is there anyway to do this? Thanks!
A:
Neither MSI or WiX currently has built-in support for reading xml files, only writing. You'll have to write a custom action to read the values in. ( Extend AppsSearch )
In addition to this, I highly suggest you follow the pattern described here and adapt it for XML instead of registry:
http://robmensching.com/blog/posts/2010/5/2/The-WiX-toolsets-Remember-Property-pattern
Christopher Painter
2010-08-10 15:26:55
I don't have the time to write a custom action, so I'll just use the registry. The problem will come up when the registry and the config file disagree (such as if a user messes with it manually), but I'll train my customer to only use the repair functionality.
Jason Thompson
2010-08-10 21:12:15
Be sure to take bitness into considerationhttp://blog.deploymentengineering.com/2010/07/net-bitness-pain.html
Christopher Painter
2010-08-10 22:07:20
Thanks for the heads up. Fortunately, I don't think this will apply to me. The reason being is that the application still uses the app.config for its configuration, and only uses the registry to "remember" the properties chosen at install time. Like I mentioned earlier, this can cause issues if someone messes with the config without using the installer's repair functionality. Since there is only going to be one or two users using the installer, I don't think this will be an issue.
Jason Thompson
2010-08-12 13:16:15