Creating Registry Data
InstallShield 2022 » InstallScript Project 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.
For example, to create a registry value called TutorialData under HKEY_LOCAL_MACHINE\Software\Tutorial Co\Tutorial\1.00.0000:
To create registry data:
|
1.
|
Go to the Registry view. |
|
2.
|
In the Destination computer’s Registry view area, right-click Destination Computer and select New Registry Set. |
|
3.
|
Rename the registry set tutorial. |
|
4.
|
Under the tutorial registry set, right-click HKEY_LOCAL_MACHINE and from the New submenu select Key. |
|
5.
|
Rename the key Software. |
|
6.
|
Repeat the process for subkeys named Tutorial Co, Tutorial, and 1.00.0000. |
|
7.
|
In the Destination computer’s Registry data area, right-click and select New String Value. |
|
8.
|
Rename the value TutorialData. |
|
9.
|
Double-click the TutorialData value and enter <TARGETDIR> in the Value data field. |
|
10.
|
Click the tutorial registry set, and in the Registry Set Install Conditions pane check DefaultComponent. |
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 Tutorial App 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 text <TARGETDIR> is displayed. |
The next step of the tutorial explains how to register a COM server (self-registering file).