0
votes

I've created a WiX installer to deploy a set of websites on at a customer site and use xmlfile to plug correct values for hostnames and connectionStrings into our web.config files. Since these values come from the installer UI I've run into a problem when doing an Upgrade install using:

msiexec /i Websites.msi  /l*vx Website.log REINSTALL=ALL REINSTALLMODE=vomus

While the update performs correctly the xmlfile actions plug empty values in since the UI isn't run.

Is there a way of getting these values into the installer without parsing the XML or prompting the installation engineer for the values again?

Cheers, Damien

2

2 Answers

2
votes

You need the Remember Property pattern only adapted for XML instead of Regisry. WiX doesn't have an XML peek pattern yet so you'll have to write a custom action.

Another gotcha to watch out for is since you are modifying the XML future upgrades won't install newer versions of the XML by default since it now has user data.

0
votes

If you'd like your web.config to be modified during install only, you can condition your components containing XmlFile elements with Not Installed condition. In this case the action to modify the XML file won't run for those components during upgrade.