Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I read app.config values and set properties in Wix

Tags:

xml

wix

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!

like image 917
Jason Thompson Avatar asked Aug 10 '10 14:08

Jason Thompson


2 Answers

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

like image 183
Christopher Painter Avatar answered Nov 02 '22 05:11

Christopher Painter


One solution is to use the "Community MSI Extensions"

The custom action you're after is probably Xml_SelectNodeValue (there's an example on how to use it).

like image 25
Brad W Avatar answered Nov 02 '22 05:11

Brad W