Book Image

WiX Cookbook

By : Nicholas Matthew Ramirez
1 (1)
Book Image

WiX Cookbook

1 (1)
By: Nicholas Matthew Ramirez

Overview of this book

Table of Contents (20 chapters)
WiX Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Adding a new element to an XML file during installation


In this recipe, we'll learn how to add an element to an XML file. One place where this might be useful is to enable tracing in an ASP.NET web application. Tracing lets you see diagnostic information about a running web application. We'll start with a basic Web.config file that doesn't have any tracing configuration in it and add a trace element to set it up.

Getting ready

To prepare for this recipe, perform the following steps:

  1. Create a new setup project and name it XmlElementInstaller.

  2. So that we'll have something to modify, add an XML file to the project and call it Web.config. Add the following markup to it:

    <?xml version="1.0"?>
    <configuration>
      <appSettings />
      <connectionStrings />
    
      <system.web>
        <authentication mode="Windows" />
      </system.web>
    </configuration>
  3. Add a Component element to Product.wxs to include the file in the installation:

    <ComponentGroup Id="ProductComponents...