Shared and Locked File Functions
InstallShield 2024 » InstallScript Language Reference
A shared file is a file, such as a .dll, .vbx, or driver that can be used by more than one application. InstallShield protects shared files from being removed during uninstallation.
Functions using the SHAREDFILE option consider all files to be shared files, and therefore increment registry reference counters for all files involved. InstallShield increments the registry reference counter by one if the file exists in the target directory and it has a reference count greater than 0. If the shared file does not exist in the target directory and it has no reference counter, InstallShield creates the counter and sets it to 1. If the shared file already exists in the target directory but has no reference counter, InstallShield creates the counter and initializes it to 2 as a precaution against accidental removal during uninstallation.
Shared files should not be updated when they are locked. Some InstallShield file transfer functions use the SHAREDFILE option so that .dll and .exe files that are locked during file transfer can be recorded and updated when Windows or the system restarts.
InstallShield considers a file locked when it is in use by an application or the system. Locked files are not necessarily shared files.
The following functions handle shared or locked files:
Function |
Description |
Provides file and path checking services, searches for a math coprocessor, tests for administrator privileges, determines whether a particular version of the .NET Framework or a language pack is present on the target system, determines whether Microsoft Windows is running from a shared copy on a network, and more. |
|
Presents a dialog with which the end user can choose to restart Windows or reboot the computer. |
|
Presents a dialog stating that the installation is complete and allowing the end user to choose to restart Windows or reboot the computer. |
|
Sets permissions for a file, a folder, or a registry key. |
|
Updates files using version resource information. Allows updating of locked .dll and .exe files and incrementing of registry reference counters for all files involved. |
|
Copies files and subdirectories from the source directory to the target directory. Combines shared file and locked file handling by causing XCopyFile to treat all files as shared, and to record locked .dll and .exe files for update when Windows or the system restarts. |