File Table

[This is preliminary documentation and subject to change.]

The File table contains the complete list of source files with their various attributes, ordered by a unique, non-localized identifier. Files can be stored on the source media either as individual files, or compressed within a cabinet file.

The File table has the following columns.

Column Type Key Nullable
File Identifier Y N
Component_ Identifier N
FileName Filename N
FileSize DoubleInteger Y
Version Version Y
Language Language Y
Attributes Integer Y
Sequence Integer N

Columns

File
A non-localized token that matches a file identifier in the cabinet. For uncompressed files, this field is ignored.
Component_
External key into the Component table that references the Component that controls the file.

External key to column one of the Component table.

FileName
File name used for installation. The name may be localized. This may be formatted as a short file name | long file name pair.
FileSize
Size of the file in bytes.

Non-negative value only.

Version
For versioned files, this is the version string. For non-versioned files, this is blank.

The Version field can also be set to contain the primary key of another record in the same table, producing a Companion File reference. In this case the version column is an external key to column one of the File table. See the remarks section for more information.

Language
List of decimal language IDs, separated by commas.
Attributes
Integer containing bit flags representing file attributes.

The following table shows the definition of the bit field.
Bit position Decimal equivalent Description
0 1 Read-Only
1 2 Hidden
2 4 System
8 256 Split - the file is split between two or more compression cabinets
9 512 Vital - this file is vital for the proper operation of the component to which it belongs
10 1024 ValidCheckSum
13 8192 Uncompressed - the file is uncompressed on the source media

If the "Vital" bit within the Attributes column is set, and if the component to which the file belongs is selected for installation, then the installer must be able to install this file for the installation to be completed successfully. If the installer is unable to install the file for some reason (for example, if the source file cannot be located within the source image), then an error dialog will appear with the options "Retry" or "Cancel". For a file that does not have the "Vital" bit set, the options in case of an install error will be "Abort", "Retry", and "Ignore" (that is, the user will have the option to complete the install successfully without installing that file).

The "ValidCheckSum" bit within the Attributes column should be set 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 bit set will ever be verified for valid checksum during a reinstall (see the REINSTALLMODE property for more information).

Sequence
Sequence position of this file on the media images. This order must correspond to the order of the files in the cabinet if the files are compressed.

The sequence numbers in the Sequence column are used to specify both the order of installation for files and the source media upon which the file is located (in conjunction with the Media table). For example, suppose a file has a sequence number of 92. To determine the source disk this file resides on, look in the Media table for the entry with the smallest Last Sequence value that is larger than 92.

Although compressed files are assigned internal sequence numbers within cabinets, those absolute numbers do not need to match the sequence numbers within the File table. It is, however, important that the sequence of files in the File table be identical to the sequence of the files within the cabinets.

For files that aren't compressed, the sequence numbers need not be unique. For instance, if all your files are uncompressed, and all reside on one disk, you could give all the files the same sequence number.

Remarks

The table is initially generated from the file list, but if cabinet compression is used, the table is regenerated from the output of the compression engine.

For uncompressed files, the File column is ignored, and the FileName column is used for both the source and destination file name. You must set the Uncompressed bit of the Attributes column for any file that is not compressed in a cabinet.

This table is referred to when the InstallFiles action, ProcessComponents action, FileCost action, RemoveFiles action, UpdateResources action, RegisterFonts action, or UnregisterFonts action is executed.

Companion Files

If the Version column contains the primary key of another record in the File table, a Companion File reference is produced with the referencing record termed the companion and the record being referred to termed the companion parent. In this situation, the installation state of the companion file is dependent not on its own file versioning information, but on that of its companion parent. For example, if a companion parent file is going to be installed over an existing, older version of the file, the companion file is also installed regardless of the version of an existing file (if any).

Only certain combinations of values in the Version column and the Language column are valid. The following table summarizes the possibilities.

Version Language Comment
1.2.3.4 1033 Valid – version and language.
1.2.3.4 (Null) Invalid – version but no language.
1.2.3.4 0 Valid – version and language are neutral.
Testdb (Null) Valid – companioned file but no language associated with it.
Testdb 1033 Valid – companioned file and language.
(Null) 1033 Valid – no version, but has a language associated with it (that is, typelib, helpfile).
Testdb 1033 Valid.