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

Removing an XML element


In this recipe, we'll see how to remove an element from an XML document. You might use this when updating a shared configuration file that has a setting that no longer applies. We'll start out with a configuration file that has three add elements in it. During our installation, we'll remove the middle one.

Getting ready

To prepare for this recipe, perform the following steps:

  1. Create a new setup project and call it RemoveElementInstaller.

  2. Add an XML file named Web.config to the project and add the following markup to it:

    <?xml version="1.0"?>
    <configuration>
      <appSettings>
        <add key="UserSetting1" value="abc" />
        <add key="UserSetting2" value="def" />
        <add key="UserSetting3" value="ghi" />
      </appSettings>
    </configuration>
  3. Add a Component element to Product.wxs to include the file in the install:

    <Component Id="cmpWebCONFIG" 
               Guid="{1B527456-4367-4D3D-AAE4-7E5C22FB9192}
      <File Source="Web.config...