I have a WiX project that I am working on which includes a Windows service and a WPF client. As part of the installation process, the user is prompted to enter the DB connection string that the Windows service will use (the client accesses the database via REST services exposed by the service). The build process uses Heat to generate the WiX fragments.
I’ve coded the UI part of the WiX workflow, and have a verified, valid connection string which needs to be written to the app.config of the service before the service starts. I’ve seen various guides for how to modify app.config but they seem to assume a hand-written (or generated once and not part of a CI build) .wxs file.
The obvious thing to do is to use Heat’s ability to apply an XSLT after generation of the WiX fragments to use XmlFile to write the connection string to the app.config. Can anyone think of other ways of doing it?
A solution is the XmlFile element.
Your app.config (XML) entries can use the installer properties set through your custom dialogs. This way, whatever values the user enters, they will be written during install in your app.config file.