This is one of the few items that Windows Installer can not recreate or reproduce. Files can be stocked individually, near msi, and also compressed into a “cabinet” file (internal or external).

Advanced Installer offers a quick and easy way to manage your application files and shortcuts in the Files and Folders page.

Files use these specific tables: File Table and Removefile Table.

File Table

File Table
File Table

Let’s go through every column in the File Table:

  • File - a unique identifying key of the file inside the msi database;
  • Component - an external key from the first column of the Component table - this field identifies the component that controls the file;
  • FileName - the name of the file
  • File Size - the size of the file in bytes
  • Version - the version of the file
  • Language - the list of id for the language of the file, separated by commas
  • Attributes - bit flags with specifications for the file
  • Values
    • Read-Only file
    • Hidden file
    • System file

Sequence - the order of the cabinet files and the files inside the media

Note: Files can be versioned or unversioned.

During the installation, the Installer must determine if a file should or shouldn’t be installed based on the flag of the component where it is located.

Things get complicated when there is an existing file with the same name and placement on the machine (as the one installed from the MSI).

In these situations, the Installer verifies the file’s Version, the creation Date, and the Language. The Installer uses the following rules to determine the installation of said file:

  • The higher version wins - the file with the highest version will always overwrite the existing file on the machine.
  • File with a version - a file with a version will always be installed over an unversioned file.
  • Product’s language favorization - if the installed file has a different language than the file already located in the machine, the file matching the language of the installed product will be prioritized.
  • Keeping the multi-language file - it will keep the file that bears multiple languages regardless if it is the file being installed or the one already present on the machine.

Removefile Table

This table contains the lists of the files that will be erased.

You have the choice to erase files during installation, repair, or uninstallation of packages.

If there is no file specified, the empty directory will be erased.

RemoveFile Table
RemoveFile Table

Going through the RemoveFile columns:

  • FileKey - the primary key for identifying entrances inside the database.
  • Component - the external key in the first column from the Component table; this field refers to the component that controls the file that will be erased next.
  • FileName - this column contains the name of the file that will be erased; if the column is empty, then the specified directory will be erased with the condition for it to be empty.
  • Dir Property - the name of the property of the path directory where the file that will be erased is located. This property can be the name of a directory from the Directory table, the value of a property set up by a system search, or any other property that refers to a directory.
  • IntallMode must be one of the following values:
    1. it erases only when the associated component is installed
    2. it erases only when the associated component is uninstalled
    3. it erases any of the above-mentioned cases

Remarks: Inside the FileName column, you can use names of the files with characters like *(any character) or? (unknown character).

Example - *.tmp - all the files with the tmp extension.