Nat Luengnaruemitchai

Geek Blog

  Home  |   Contact  |   Syndication    |   Login
  100 Posts | 0 Stories | 300 Comments | 232 Trackbacks

News

Archives

Post Categories

Blogroll

When you create an msi installer with WiX, you may need to modify app.config according to user settings and/or properties. You can simply do it by using <XmlFile /> custom action tag. It can be used as follows:

<XmlFile Id="ModifyServerLocation" Action="setValue" ElementPath="/configuration/appSettings/add[\[]@key='ServiceLocation'[\]]/@value" File="[TARGETDIR]\myApp.config" Value="[SERVERLOCATION]"/>

Note that [@key='ServiceLocation] must be encoded in [ ] bracket, otherwise, MSI will treat it as property before putting the value.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati
posted on Wednesday, November 02, 2005 6:48 PM

Feedback

# re: XmlFile with WiX 7/8/2010 11:52 AM Eric Smith
Thanks, that was just what I needed. I don't know if it was the case when you posted, but the XmlFile custom action is part of the Util Extension (in WixUtilExtension.dll), which is helpful to know when looking for it.

# re: XmlFile with WiX 3/9/2011 4:50 AM Daniel Morritt
Thanks Eric, was trying to find which DLL I needed, nobody seems to mention it!

Post A Comment
Title:
Name:
Email:
Website:
Comment:
Verification: