WiX Database XML Schema

Element: CopyFile

Description

Copy or move an existing file on the target machine, or copy a file that is being installed, to another destination.

Derived By

Restricting anyType

Attributes

Name  Type  Description 
Id  string  Primary key used to identify this particular entry.
FileId  string  This attribute cannot be specified if the element is nested under a File element.
SourceDirectory  string  This attribute cannot be specified if the element is nested under a File element or the FileId attribute is specified.
SourceProperty  string  This attribute cannot be specified if the element is nested under a File element or the FileId attribute is specified.
SourceName  WildCardLongFileNameType  This attribute cannot be specified if the element is nested under a File element or the FileId attribute is specified.
DestinationDirectory  string  Set this value to the destination directory where an existing file on the target machine should be moved or copied to.
DestinationProperty  string  Set this value to a property that will have a value that resolves to the full path of the destination directory.
DestinationName  LongFileNameType  In prior versions of the WiX toolset, this attribute specified the short file name.
DestinationLongName  LongFileNameType   
DestinationShortName  ShortFileNameType  The short file name of the file in 8.3 format.
Delete  YesNoType  This attribute cannot be specified if the element is nested under a File element or the FileId attribute is specified.

Content Model

Always empty.

Remarks

When this element is nested under a File element, the parent file will be installed, then copied to the specified destination if the parent component of the file is selected for installation or removal. When this element is nested under a Component element and no FileId attribute is specified, the file to copy or move must already be on the target machine.

When this element is nested under a Component element and the FileId attribute is specified, the specified file is installed, then copied to the specified destination if the parent component is selected for installation or removal (use this option to control the copy of a file in a different component by the parent component's installation state). If the specified destination directory is the same as the directory containing the original file and the name for the proposed source file is the same as the original, then no action takes place.