Chapter 5. Editing XML Files during Installation

In this chapter, we will cover the following recipes:

  • Adding a new element to an XML file during installation
  • Setting the value of an attribute on an XML element
  • Inserting inner text into an XML element
  • Adding an XML element only if it does not already exist
  • Removing an XML element

Introduction

Part of setting up an application is making sure that it's configured correctly for the environment where it will run. For example, if we're installing to a development machine, we'd set up our database connection strings differently than if we're installing to production. With WiX, we can install an XML configuration file and then transform it on the fly.

In this chapter, we'll see several transformations that you ...

Get WiX Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.