MSI File Tables
- April 12, 2022
- Posted by: Pavithra
- Category: End User Computing
MSI File Tables group include tables that specify the files to be used in the installation. This includes files to be installed, moved, or duplicated, as well as to be self-registered. File Tables group includes the following tables:
File: (MSI File Tables)
What is a File table?
This particular table lists entire files of an msi file. File table has the following columns
This column contains the unique name or sign for identifying a particular file.
This column references to a component containing the file.
This column references the file name, used for installation. FileName should match the case of the source files exactly.
This particular column references to the size of the file in bytes which is a non-negative value.
This is the version string for the file. It can also be left null in the case of unversioned files.
A list of decimal language IDs separated by commas.
The integer that contains bit flags that represent file attributes.
The following table shows the definition of the bit field.
|msidbFileAttributesReadOnly||1||Install the file as read-only.|
|msidbFileAttributesHidden||2||Install the file hidden.|
|msidbFileAttributesSystem||4||Install the file as a system file.|
|msidbFileAttributesVital||512||This file is vital for the component to operate properly.|
|msidbFileAttributesChecksum||1024||The file contains a valid checksum. Executable files generally contain a checksum.|
|msidbFileAttributesPatchAdded||4096||This indicates that this particular file is installed by a patch rather than by a full Installer database.|
|msidbFileAttributesNoncompressed||8192||The file is uncompressed on the source.|
|msidbFileAttributesCompressed||16384||The file is compressed on the source.|
This number is used to identify which of several source disks a file might be on, by consulting the Media table.
RemoveFile: (MSI File Tables)
What is a RemoveFile table? RemoveFile table lists files that the Installer should remove. If some files remain installed even after the uninstallation of the MSI file the entry of those files should be made in these tables, for clean uninstallation of the MSI file. RemoveFile table has the following Columns:
This is an arbitrary key to identify this particular entry in the table. It can be the same as the filename.
The file removal action is controlled by this component.
This column holds the name of the file to be removed. If the FileName is null, the entire folder is removed instead, but only if it is empty.
This column holds the name of a property that resolves to a full path and directory.
This value controls what the Installer will actually do and must be one of the following values.
|1||Remove only when the associated component is being installed.|
|2||Remove only when the associated component is being removed|
|3||Remove in either of the above cases|
What is a MoveFile table?
MoveFile table lists files that the Installer should move or copy during the installation. This table contains following columns:
This is an arbitrary key to identify this row of the table.
This is a foreign key into the Component table that identifies the component that this move or copy action is related to.
This column holds the name of the file to act on.
This column contains the name to be given to the file after it’s moved or copied. If it’s blank, the source name is used.
This column contains a property that resolves to full path and filename.
The name of a property whose value resolves to the full path to the destination folder.
|0||To copy the file|
|1||To move the file|
What is a DuplicateFile table?
This table contains a list of files that need to be duplicated to multiple locations when the product is installed. This table contains following columns:
This is a unique identifier for the row in the table. We can use the filename as FileKey.
The value in this column is a foreign key to the Component table. If the component this key points to isn’t installed, then this duplicate file action isn’t carried out.
This is a foreign key into the file table. This key identifies the file that is to be duplicated.
This is the name to be given to the duplicate file. If this column contains a null, then the duplicate copy will have the same name as the original.
This is a property that resolves to the full path where the duplicate should be located.
What is an IniFile table?
This table is one of the most important file tables that are used often. The IniFile table contains information that needs to be written to .ini files during an installation. If an .ini file is present as a normal file table entry, if possible delete the file from normal file table and add the same .ini file as ini file table entry. This table contains following columns:
This is a unique identifier for this table. This can be the name of the .ini file.
This is the actual name of the .ini file to be modified.
This is a property that resolves to the name of the directory that contains the desired .ini file. If this column contains a null, then the .ini file is created in the folder having the full path specified by the Windows Folder property.
This is the .ini file section to modify.
This is the key in the specified section to modify.
This is the value to use for this key i.e., localizable value to be written.
Type of modification to be made.
|0||To create or update an entry|
|1||To create an entry only if the specified key doesn’t already exist|
|3||To create a new entry or append a new comma-separated value to an existing entry.|
A foreign key into the Component table that identifies the component that this action is related to.
What is a RemoveIniFile table?
RemoveIniFile table contains information that the Installer should delete from an existing .ini files (but does not remove .ini files themselves). This table contains the following columns:
This is a key for this table.
This is the actual name of the .ini file to be modified.
This is a property that resolves to the name of the directory that contains the desired .ini file.
This column refers the .ini file section to modify.
This is the key in the specified section to modify.
This is the value to be deleted from this key. A value is required when the Action column is 4, optional otherwise.
This is a code indicating the action (modification) to be taken.
|2||Delete the entire key,|
|4||Delete a specified value from a list of values in the key.|
This is a foreign key into the Component table that identifies the component that this action (deletion of .ini file) is related to.
What is a Font table?
The Font table is used to list fonts that the Installer should register on the user’s system. Font Table contains the following columns:
It identifies the file that contains the font to be registered.
It is recommended to leave this column null for TrueType Fonts and TrueType Collections because the installer can register the font after reading the correct font title from the font file. If the font name is entered, it must be identical to font title from the font file. For example: We have to specify a title for fonts that do not have embedded names, such as .fon files
What is a SelfReg table?
The SelfReg table contains information about modules that need to be self registered. The installer calls the DLLRegisterServer custom action during installation of the module; it calls DLLUnregisterServer custom action during uninstallation of the module. The installer does not self register EXE files. If we want to register any file we have to navigate to that specific file in the msi and right click that particular msi and select the option ‘register ‘ . SelfReg table contains the following columns:
It identifies the file that should be self-registered and it functions as a foreign key to the File table.
The cost of registering the module in bytes. This must be a non-negative number.
Example for application of selfReg table:
A) Suppose there is an entry of a file in selfReg table, so to remove the entry from selfReg table follow the instruction: Navigate through the ‘Installation Expert ‘ and right click on the file which has an entry in the selfReg table and select the option ‘Do not register ‘ as shown below.
What is a Media table?
Media table describes the set of disks that make up the source media for the installation. This table contains the following columns:
This column determines the order that the media are processed in.
This is the file sequence number (corresponding to the Sequence column of the File table) for the last file on this particular piece of media. A disk contains all files between the LastSequence number for the previous disk and the LastSequence number for itself.
This is the name that the Installer will use to prompt the user for this particular disk.
This is the name of the cabinet file on the disk, if any of the files on the disk are compressed into a cabinet file. If there is no cabinet file on the disk, this column should be null.
This is the physical volume name of the disk. The Installer uses this to verify that the correct disk is in the drive.
This column is only used by patch files, and only if a cabinet file with the patch files is located somewhere other than the original media. For normal installations this column should be left null. If the source files are contained within the Installer package itself, in a cabinet file stored in a stream, and it is still needed to make an entry in the Media table. In this case, though, we must prepend a pound sign (#) to the cabinet filename.
What is a BIndImage table?
BindImage table contains information about each executable or DLL that needs to be bound to the DLLs imported by it. This table contains the following two columns:
It identifies the file that should be self-registered and it must be an executable file.
A list of paths, separated by semicolons, which represent the paths to be searched to find the imported DLLs. The list is usually a list of properties.
What is an Environment table?
Environment table contains information on environment variables that the Installer should set or remove. Environment table is basically used to resolve the hard coded paths in the MSI file or application. For example we can set “C:\WINDOWS” to SystemRoot. Some of the important environmental variables are shown in the below table. To see all the environment variables type ‘set’ on the command line as shown below. This table contains the following columns:
This is the primary key of the table.
The Name column contains a prefix and the name of the environment variable. The prefix indicates what action the Installer should take.
|=||Set the environment variable during installation.|
|+||Create the variable if it doesn’t exist, and set it during installation.|
|–||Remove the environment variable when the component is being installed.|
|*||Under Windows NT or Windows 2000, this puts the environment variable in the system environment; otherwise, it is placed in the user environment.|
|=-||Set the variable on install and remove it on uninstall.|
|!-||Remove the environment variable whether the component is being installed or uninstalled.|
This is the value that is to be set for the variable.
|Field Value||Corresponding Action.|
|Empty||variable is removed|
|Field is blank and the string in the Name field is prefixed by the – symbol||The variable is removed only when the component is removed.|
|Prefixing the string by the Null character [~] and the separator character. Eg: [~];Value||To append a value to the end of an existing variable|
|Append the string in this field by the separator character and the Null character [~].Eg: Value;[~]||To prefix a value to the front of an existing variable|
|If no [~] is present in the field||The string represents the entire value to be set or deleted.|
Indicates the component that’s associated with the setting.
What is an Icon table?
The Icon table contains information necessary to create desktop icons. This table contains the following columns:
This is the name to use for the icon file.
This is the actual icon data, in PE (.exe, .dll) or icon (.ico) format. Generally, we should make entries in this table for each shortcut, file extension, and CLSID registered with the Installer. When we want the products to be advertised, where the icon needs to be present on the user’s desktop without the product being installed, and this table provides alternative files that have the icons for advertised products.
What is a CreateFolder table?
The CreateFolder table contains information about folders that the Installer should create explicitly. This table contains the following columns:
This is a foreign key into the Directory table, which identifies the folder to be created.
This is a foreign key into the Component table, which identifies the component that requires this folder. This table is intended primarily for the creation of empty folders.
Example for the application of CreateFolder table:
A) To resolve ICE 64 errors we have to make an entry of the folder in the CreateFolder table.