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

Applying Rule

Hi,
I am creating a project for windows. I want to enable/disable a feature based on the registry key. If the key is present the feature should get enabled and if the key is not there the feature should get disabled. Can anyone please suggest a solution...
Labels (1)
0 Kudos

(9) Replies
jerome_IA
Level 9

Are you talking about windows registry key or InstallAnywhere registry ?

Anyway, you have the following actions available in pre-install at least:

- "Get windows registry entry" for windows registry
or
- "Find component in registry" for installanywhere.

Based on the result variable, then you can enable/disable the feature by associating a rule in the "Organization/feature of the feature to enable/disable.

--Jerome
0 Kudos
atulmaurya
Level 6

Thanks Jerome for your answer. Actually I was using ISMP 5.x in my company. There we were using the condition "Windows Registry Value Exists Wizard Bean Condition" to detect whether a particular registry key exists or not. If the key exist we simply cancel the installation. Now I have to provide the same functionality in IA 10.
0 Kudos
jerome_IA
Level 9

Then you need to cancel the installation, not enable/disable a feature ? It's not that clear but the implementation is almost the same ...

Use "Get windows registry entry" action at the beginning of Pre-install, then use the variable that "Store Key Existence" and use this variable in a rule of another action that cancel the installation when key exists (e.g. Show Message Dialog).

--
0 Kudos
atulmaurya
Level 6

Got it. Thanks alot Jerome for your help.
0 Kudos
atulmaurya
Level 6

Hi Jerome,

When the value(string) exists under the key the Get Registry Value action returns its value and I can compare this value against some string and everything is fine. But when the value is not present the action returns an empty string by default and when I campore this against the variable $EMPTY_STRING$ it creates problems. Do you have any idea about this?? I think it should work in both cases.

thanks.:confused:
0 Kudos
jerome_IA
Level 9

You say it creates problem but did not give details about what is the problem ?
0 Kudos
atulmaurya
Level 6

The actual problem is that I am unable to check whether a particular registry value exists under some key or not (value not the key itself). If you have some idea, it will solve my problem.

Thanks
0 Kudos
jerome_IA
Level 9

Maybe $EMPTY_STRING$ comparison does not work because it is not null.

Try to compare the "Store Value in Variable" another way:

e.g. "x$YOUR_VALUE_IN_VAR$" equals "x"

Otherwise try debugging it by displaying "output debug information" with InstallAnywhere variable action at this step.

--Jerome
0 Kudos
atulmaurya
Level 6

i have done it using batch file. I sored the exit code in a variable the used this value in the "Compare InstallAnywhere Variables" rule. Anyways thanks alot Jerome.
0 Kudos