- Revenera Community
- :
- InstallShield
- :
- InstallShield Knowledge Base
- :
- Install Conditions Based on Information Read from the Registry
- Mark as New
- Mark as Read
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Install Conditions Based on Information Read from the Registry
Install Conditions Based on Information Read from the Registry
Summary
This knowledge base article addresses how to read information from the registry and use it to determine if the installation should continue.Synopsis
This knowledge base article addresses how to read information from the registry and use it to determine if the installation should continue.
Discussion
The System Search Wizard is now available in InstallShield to step you through the process of creating and configuring install conditions (...read from registry or other sources) quickly and easily. This is accessible via the System Search view from within the InstallShield IDE.
Workaround
In the AppSearch table, add an entry for the following columns:
Column | Description |
---|---|
Property | The property that is set to the value read from the Registry. |
Signature_ | Unique signature for which to search. In this case, it is used as the signature identifier. |
For example:
Property | LAUNCHCONDITIONDATA |
Signature_ | REGKEYSIGNATURE |
In the RegLocator table, add an entry for the following columns:
Column | Description |
---|---|
Signature_ | Signature key defined in the AppSearch table |
Root | Number defining the root in which to search. Please refer to the table in the Additional Information section of this article for more information. |
Key | The key in which you would like to search |
Name | The value you would like to query. If this field is left null, this will query Default |
Type | The type of data you are querying. For more information, refer to the table in the Additional Information section of this article |
For Example:
Signature_ | REGKEYSIGNATURE |
Root | 2 |
Key | Software\CompanyName |
Name | ProductInstalled |
Type | 2 |
The next step is to define your sequences. By default, the action that evaluates your Install Condition activates first, followed by the AppSearch action that queries the registry value. Therefore, it is necessary to place the AppSearch action right before the LaunchConditions action in both the Installation User Interface and Installation Execute sequences.
Be aware that the AppSearch action in each sequence has a condition of APPS_TEST on it. It is advisable to remove this condition, otherwise the AppSearch action will not execute.
It is now possible to query the property LAUNCHCONDITIONDATA, which was defined in the AppSearch table from the install condition. Depending on what value was read out of the registry, the Install condition might look something like:
LAUNCHCONDITIONDATA = "ProductInstalled"
It is also important to note that the property LAUNCHCONDITIONDATA does not exist by default. When AppSearch finds the registry key, it will generate and populate this property for you. Therefore, if the existence of the registry value is most important, you can use a launch condition to test for the existence of the LAUNCHCONDITIONDATA property. Your Install Condition would look like the example below:
LAUNCHCONDITIONDATA
Additional Information
If the key is found by RegLocator, the Property specified in AppSearch will be assigned the registry value.
Possible values for the Root column:
Root Value HKEY_CLASSES_ROOT 0 HKEY_CURRENT_USER 1 HKEY_LOCAL_MACHINE 2 HKEY_USERS 3 Possible values for the Type column:
Description Value Search for a directory 0 Search for a filename 1 Search for raw registry data 2
For more information on the tables discussed, see the Windows Installer Help Library topic AppSearch Table and RegLocator Table.
For more information on using the System Search view, see the InstallShield Help Library topic System Search Wizard.