Nat Luengnaruemitchai

Geek Blog

  Home  |   Contact  |   Syndication    |   Login
  100 Posts | 0 Stories | 232 Comments | 236 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.

posted on Wednesday, November 02, 2005 6:48 PM