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 file to a directory


Markup to copy files to the end user's computer is probably going to make up the bulk of your installer. That's because for each file you want to install, which may number in the hundreds, there will be a corresponding XML element in your .wxs file to represent it. In this recipe, we'll cover the basics—installing a single text file to a directory that we'll create under Program Files. All file-types, whether plain text or binary, will follow this same pattern.

Getting ready

To prepare for this recipe, perform the following steps:

  1. Create a setup project and call it FileInstaller.

  2. Add a text file to the project and name it Sample.txt. Although we're adding the file directly to the setup project, in most cases the source files we use will be from other projects or folders.

  3. Update the default directory structure to the following wherein a folder called My Software is added to the Program Files directory:

    <Fragment>
      <Directory Id="TARGETDIR" Name="SourceDir...