Editing the Registry

InstallShield 2015 Express Edition

The Windows registry is a system-wide database that contains configuration information used by applications and the operating system. The registry stores all kinds of information, including the following:

Application information such as company name, product name, and version number
Path information that enables your application to run
Uninstallation information that enables end users to uninstall the application easily without interfering with other applications on the system
System-wide file associations for documents created by an application
License information
Default settings for application options such as window positions

Keys, Value Names, and Values

The registry consists of a set of keys that are arranged hierarchically under the Computer explorer (or the My Computer explorer, depending on the operating system of the target system). Just under Computer are several root keys. An installation can add keys and values to any root key of the registry. The root keys that are typically affected by installations are:

HKEY_LOCAL_MACHINE
HKEY_USERS
HKEY_CURRENT_USER
HKEY_CLASSES_ROOT

A key is a named location in the registry. A key can contain a subkey, a value name and value pair, and a default (unnamed) value. A value name and value pair is a two-part data structure under a key. The value name identifies a value for storage under a key, and the value is the actual data associated with a value name. When a value name is unspecified for a value, that value is the default value for that key. Each key can have only one default (unnamed) value.

Note that the terms key and subkey are relative. In the registry, a key that is below another key can be referred to as a subkey or as a key, depending on how you want to refer to it relative to another key in the registry hierarchy.

InstallShield Projects and the Registry

InstallShield includes the Registry view to help you with the task of modifying the end user’s registry. Use this view to create keys and values in much the same way that you use the Windows Registry Editor.

All registry data must be associated with a feature. If the feature is selected for installation, the registry data associated with that feature is set up on the target system.

Caution: It is important not to modify or delete registry keys indiscriminately because the registry is a vital part of the Windows operating system, and the system may fail to function if vital registry keys are altered.

HKEY_LOCAL_MACHINE\Software vs. HKEY_LOCAL_MACHINE\Software\Wow6432Node

If you add registry data to the HKEY_LOCAL_MACHINE\SOFTWARE (32-Bit) node in the Registry view, Windows Installer installs that data under the HKEY_LOCAL_MACHINE\Software key on 32-bit target systems but under the HKEY_LOCAL_MACHINE\Software\Wow6432Node key on 64-bit target systems.

If you add registry data to the HKEY_LOCAL_MACHINE\SOFTWARE (64-Bit) node in the Registry view, InstallShield creates a 64-bit Windows Installer package for your project at build time; this 64-bit Windows Installer package cannot be run on 32-bit target systems. In this scenario, Windows Installer installs the registry data under the HKEY_LOCAL_MACHINE\Software key on 64-bit target systems.

Thus, if you are creating a 64-bit installation and you want to install registry entries to 64-bit registry locations (under HKEY_LOCAL_MACHINE\Software instead of HKEY_LOCAL_MACHINE\Software\Wow6432Node), add the entry to the SOFTWARE (64-Bit) node, or a subnode. If you are creating a 32-bit installation, avoid putting any data under the SOFTWARE (64-Bit) node.

To learn more, see Challenges of Supporting Both 32-Bit and 64-Bit Target Operating Systems.

Tip: To see how a 32-bit application views the registry on a 64-bit system, launch the 32-bit version of the Registry Editor (the regedit.exe file in the SysWOW64 folder).

See Also