cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

An alternative to the search wizard is modifying the tables directly.
The first step to designing an install condition is to add the logic required to search for a value in the registry. All of the work in this step will be done through the Direct Editor.

In the AppSearch table, add an entry for the following columns:

ColumnDescription
PropertyThe 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:

PropertyLAUNCHCONDITIONDATA
Signature_REGKEYSIGNATURE

In the RegLocator table, add an entry for the following columns:

ColumnDescription
Signature_Signature key defined in the AppSearch table
RootNumber defining the root in which to search. Please refer to the table in the Additional Information section of this article for more information.
KeyThe key in which you would like to search
NameThe value you would like to query. If this field is left null, this will query Default
TypeThe 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
Root2
KeySoftware\CompanyName
NameProductInstalled
Type2

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:

RootValue
HKEY_CLASSES_ROOT0
HKEY_CURRENT_USER1
HKEY_LOCAL_MACHINE2
HKEY_USERS3

Possible values for the Type column:

DescriptionValue
Search for a directory0
Search for a filename1
Search for raw registry data2

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.

Was this article helpful? Yes No
No ratings
Version history
Last update:
‎Dec 03, 2007 01:48 PM
Updated by: