Determining the Appropriate Component Creation Method for Dynamically Linked Files

InstallShield 2019

Project • This information applies to the following project types:

Basic MSI
DIM
InstallScript MSI
Merge Module

InstallShield provides two methods for creating components for dynamically linked files: the best practice method and the one-component-per-directory method.

Using the Best Practice Method

When best practices for component creation are followed, InstallShield performs the following tasks at build time for all of the files that meet the include and exclude filter criteria of your dynamic link:

InstallShield creates a separate component for each portable executable (PE) file in the dynamically linked folder. Each PE file is the key file of its component.
InstallShield adds all non-PE files at the root level of the dynamic link to the component that contains the link.
If the dynamic link includes a subfolder, InstallShield creates a new component for all of the non-PE files in that subfolder. If the dynamic link includes more than one subfolder, InstallShield creates a separate component for all of the non-PE files in each subfolder.

This is the default functionality for all new dynamic links.

Tip • The File Extensions tab on the Options dialog box is where you specify which file types are PE files.

Using the By-Directory Method

When the by-directory method is used for component creation, InstallShield performs the following tasks at build time for all of the files that meet the include and exclude filter criteria of your dynamic link:

InstallShield creates one component for all of the files that are in the root-level dynamically linked folder, regardless of the file types.
If the dynamic link includes one or more subfolders, InstallShield creates a separate component for all of the files in each subfolder, regardless of the file types. The first dynamically linked file in a subfolder’s component is the key file of that component.

This method of component creation is the traditional method that was available in InstallShield before the best practice method was introduced.

Determining Which Component Creation Method to Use

For most dynamic links, the preferred component creation method is the best practice method. This method enables you to create patches more easily than with the by-directory method. For minor upgrades and small updates, the components, key files, and feature-component organization need to be maintained across the earlier and later .msi databases; for patches, the File table keys also need to be maintained. Since each component name and component code—and possibly key files—change at each build with the by-directory method of dynamic file linking, issues may occur. The advantage of the best practice method is that it allows for greater predictability than with the by-directory method.

Tip • When you are configuring an upgrade, use the patch optimization functionality in your build settings. Using patch optimization helps you keep component names, component codes, File table keys, and Directory table keys synchronized from the earlier release. For more information, see Upgrade Considerations.

Note that if you want to create a patch for an earlier version of your product, and the earlier installation includes dynamic links that used the by-directory method, you must continue to use the by-directory method for the same dynamic links. However, if you add new dynamic links in your upgrade project, you can use the best practice method for those new dynamic links. That is, you can mix both types of dynamic linking in the same project and create a patch to deliver the upgrade.

Important • Whenever possible, it is better to use the best practice method, instead of the by-directory method, for creating components for dynamically linked files. Note that with both methods, however, a minor upgrade, a small update, or a patch may not install correctly if a file that was present in a target image is removed from the dynamic link for the upgrade or patch.

Note • For information on the rules that Windows Installer uses when determining whether a file included in a package should overwrite a file that already exists on the target system, see Overwriting Files and Components on the Target System.

Specifying Which Component Creation Method You Want to Use

The File Linking tab on the Component Properties dialog box is where you specify which component creation method you want to use.

See Also