Skip to main content
Version: v3

File Element

Description
File specification for File table, must be child node of Component.
Windows Installer references
File Table
Parents
Component
Inner Text
None
Children
Choice of elements (min: 0, max: unbounded)
Attributes
NameTypeDescriptionRequired
AssemblyEnumeration Specifies if this File is a Win32 Assembly or .NET Assembly that needs to be installed into the Global Assembly Cache (GAC). If the value is '.net' or 'win32', this file must also be the key path of the Component. This attribute's value must be one of the following:
.net
The file is a .NET Framework assembly.
no
The file is not a .NET Framework or Win32 assembly. This is the default value.
win32
The file is a Win32 assembly.
 
AssemblyApplicationString Specifies the file identifier of the application file. This assembly will be isolated to the same directory as the application file. If this attribute is absent, the assembly will be installed to the Global Assembly Cache (GAC). This attribute may only be specified if the Assembly attribute is set to '.net' or 'win32'.  
AssemblyManifestString Specifies the file identifier of the manifest file that describes this assembly. The manifest file should be in the same component as the assembly it describes. This attribute may only be specified if the Assembly attribute is set to '.net' or 'win32'.  
BindPathStringA list of paths, separated by semicolons, that represent the paths to be searched to find the imported DLLs. The list is usually a list of properties, with each property enclosed inside square brackets. The value may be set to an empty string. Including this attribute will cause an entry to be generated for the file in the BindImage table. 
ChecksumYesNoTypeThis attribute should be set to "yes" for every executable file in the installation that has a valid checksum stored in the Portable Executable (PE) file header. Only those files that have this attribute set will be verified for valid checksum during a reinstall. 
CompanionFileStringSet this attribute to make this file a companion child of another file. The installation state of a companion file depends not on its own file versioning information, but on the versioning of its companion parent. A file that is the key path for its component can not be a companion file (that means this attribute cannot be set if KeyPath="yes" for this file). The Version attribute cannot be set along with this attribute since companion files are not installed based on their own version. 
CompressedYesNoDefaultTypeSets the file's source type compression. A setting of "yes" or "no" will override the setting in the Word Count Summary Property. 
DefaultLanguageStringThis is the default language of this file. The linker will replace this value from the value in the file if the suppress files option is not used. 
DefaultSizeIntegerThis is the default size of this file. The linker will replace this value from the value in the file if the suppress files option is not used. 
DefaultVersionStringThis is the default version of this file. The linker will replace this value from the value in the file if the suppress files option is not used. 
DiskIdDiskIdType The value of this attribute should correspond to the Id attribute of a Media element authored elsewhere. By creating this connection between a file and its media, you set the packaging options to the values specified in the Media element (values such as compression level, cab embedding, etc...). Specifying the DiskId attribute on the File element overrides the default DiskId attribute from the parent Component element. If no DiskId attribute is specified, the default is "1". This DiskId attribute is ignored when creating a merge module because merge modules do not have media.  
FontTitleStringCauses an entry to be generated for the file in the Font table with the specified FontTitle. This attribute is intended to be used to register the file as a non-TrueType font. 
HiddenYesNoTypeSet to yes in order to have the file's hidden attribute set when it is installed on the target machine. 
IdString The unique identifier for this File element. If you omit Id, it defaults to the file name portion of the Source attribute, if specified. May be referenced as a Property by specifying [#value].  
KeyPathYesNoTypeSet to yes in order to force this file to be the key path for the parent component. 
LongNameLongFileNameTypeThis attribute has been deprecated; please use the Name attribute instead. 
NameLongFileNameType In prior versions of the WiX toolset, this attribute specified the short file name. This attribute's value may now be either a short or long file name. If a short file name is specified, the ShortName attribute may not be specified. If a long file name is specified, the LongName attribute may not be specified. Also, if this value is a long file name, the ShortName attribute may be omitted to allow WiX to attempt to generate a unique short file name. However, if this name collides with another file or you wish to manually specify the short file name, then the ShortName attribute may be specified. Finally, if this attribute is omitted then its default value is the file name portion of the Source attribute, if one is specified, or the value of the Id attribute, if the Source attribute is omitted or doesn't contain a file name.  
PatchAllowIgnoreOnErrorYesNoTypeSet to indicate that the patch is non-vital. 
PatchGroupInteger This attribute must be set for patch-added files. Each patch should be assigned a different patch group number. Patch groups numbers must be greater 0 and should be assigned consecutively. For example, the first patch should use PatchGroup='1', the second patch will have PatchGroup='2', etc...  
PatchIgnoreYesNoTypePrevents the updating of the file that is in fact changed in the upgraded image relative to the target images. 
PatchWholeFileYesNoTypeSet if the entire file should be installed rather than creating a binary patch. 
ProcessorArchitectureEnumerationSpecifies the architecture for this assembly. This attribute should only be used on .NET Framework 2.0 or higher assemblies. This attribute's value must be one of the following:
msil
The file is a .NET Framework assembly that is processor-neutral.
x86
The file is a .NET Framework assembly for the x86 processor.
x64
The file is a .NET Framework assembly for the x64 processor.
arm
The file is a .NET Framework assembly for a 32-bit ARM processor.
arm64
The file is a .NET Framework assembly for a 64-bit ARM processor.
ia64
The file is a .NET Framework assembly for the ia64 processor.
 
ReadOnlyYesNoTypeSet to yes in order to have the file's read-only attribute set when it is installed on the target machine. 
SelfRegCostIntegerThe cost of registering the file in bytes. This must be a non-negative number. Including this attribute will cause an entry to be generated for the file in the SelfReg table. 
ShortNameShortFileNameType The short file name of the file in 8.3 format. This attribute should only be set if there is a conflict between generated short file names or the user wants to manually specify the short file name.  
SourceStringSpecifies the path to the File in the build process. Overrides default source path set by parent directories and Name attribute. This attribute must be set if no source information can be gathered from parent directories. For more information, see Specifying source files. 
srcStringThis attribute has been deprecated; please use the Source attribute instead. 
SystemYesNoTypeSet to yes in order to have the file's system attribute set when it is installed on the target machine. 
TrueTypeYesNoTypeCauses an entry to be generated for the file in the Font table with no FontTitle specified. This attribute is intended to be used to register the file as a TrueType font. 
VitalYesNoTypeIf a file is vital, then installation cannot proceed unless the file is successfully installed. The user will have no option to ignore an error installing this file. If an error occurs, they can merely retry to install the file or abort the installation. The default is "yes," unless the -sfdvital switch (candle.exe) or SuppressFileDefaultVital property (.wixproj) is used. 
Any Attribute (namespace='##other' processContents='lax') Extensibility point in the WiX XML Schema. Schema extensions can register additional attributes at this point in the schema.
How Tos and Examples
See Also
Wix Schema