Files element
Authoring to define the set of files to be harvested for inclusion in a package.
Note that using Files in per-user packages generates components and files that
do not pass ICE validation. The preferred solution is to use per-user-or-machine
or per-machine-or-user packages.
Attributes
Section titled “Attributes”Directory
stringThis attribute specifies a reference to a Directory element with matching Id attribute containing a directory path for the root of the harvested files.
Include
string requiredA file-selection pattern that can include directory names, file names, and wildcards.
We recommend that patterns be fully-qualified, absolute paths, preferably via named bind path. You can also use preprocessor variables or unnamed bind paths to create absolute paths.
If the pattern is a relative path, it is interpreted as relative to either:
- an unnamed bind path, if one or more is specified.
- the source directory of the file containing the
Fileselement, if no unnamed bind paths are specified.
Wildcards include typical *.ext globs and MSBuild-style ** globs to indicate
that directories should be recursed. Examples include:
| Pattern | Description |
|---|---|
!(bindpath.ToBeHarvested)\** | All files in the parent directory identified by the ToBeHarvested bind path and its subdirectories. |
$(PayloadFiles)\bin\Release\** | All files in the bin\Release subdirectory in the directory named by the PayloadFiles preprocessor variable and its subdirectories. |
!(bindpath.arm64)\**.pdb | All files with .pdb extension in the parent directory identified by the arm64 bind path and its subdirectories. |
** | If an unnamed bind path was specified, all files in that directory and its subdirectories. If an unnamed bind path was not specified, all files in directory of the source .wxs file and its subdirectories. |
Subdirectory
stringThis attribute defines one or more directories below the directory referenced by the Directory attribute. This attribute is optional but can only be specified when the Directory attribute is also specified.