Creating Registry Data

InstallShield 2018 » Basic MSI Tutorial

Another common requirement for installations is to write information to the target system’s registry. To add registry data to a component, you can use the Registry view.

To create a registry value called TutorialData under HKEY_LOCAL_MACHINE\SOFTWARE\Tutorial Co\Tutorial\1.00.0000:

1. Open the Registry view.

The Registry view is located in the System Configuration section of the View List.

2. Select Tutorial.exe from the View Filter at the top of the view.
3. In the Destination computer’s Registry view pane, right-click HKEY_LOCAL_MACHINE, select New, and point to Key.
4. Rename the key SOFTWARE.
5. Repeat the process for subkeys named Tutorial Co, Tutorial, and 1.00.0000.
6. In the Destination computer’s Registry data pane, right-click and select New String Value.
7. Rename the value TutorialData.
8. Double-click the TutorialData value and enter [INSTALLDIR] in the Value data field.

The Registry view should now appear as follows:

Registry View

Tip • To write the value of a Windows Installer property to the registry, you can use the form [PropertyName]. In this example, creating a registry value whose data is [INSTALLDIR] writes the value of INSTALLDIR to the registry.

At run time, if the end user selects a setup type or collection of features that includes the Tutorial.exe component, the registry data is created on the target system.

Verifying that the Shortcut Was Created

To verify that your installation created the shortcut:

1. Rebuild your project by clicking the Build toolbar button or pressing F7.
2. Run the project by clicking the Run button or pressing CTRL+F5 (first removing any existing version of the program from your system). A shortcut to the Tutorial application should be present in the Programs folder of your Start menu.

Verifying that the Registry Data Was Created

To verify that the installation created the registry data:

1. Launch Tutorial App from its shortcut.
2. From the Tutorial menu, choose Verify Registry Data. If the registry data was created, a message box displaying the value of INSTALLDIR is displayed.

The next step of the tutorial explains how to register a COM server (self-registering file).