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:
- Create a setup project and call it
FileInstaller
. - 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. - Update the default directory structure to the following wherein a folder called
My Software
is added to theProgram Files
directory:<Fragment> <Directory...