PDA

View Full Version : Can't determine if REG Key exists in DemoShield



WWLedebuhr
08-27-2004, 08:00 PM
I am running DemoShield 7.53 and I am having a problem reading a Registry Key into a variable. I have read the online help and searched the forums as well as the entire site but can’t find anyone with this problem.

This REG file creates the registry keys that I need to query:
REGEDIT4

[HKEY_LOCAL_MACHINE\SOFTWARE\MyCompany\ My Product]

[HKEY_LOCAL_MACHINE\SOFTWARE\ MyCompany\My Product\Product Integration Kits]

I need to change a scene based on the existence or non-existence of the last key. I have used the following events that each return “Not Found”.

Always perform true Actions, Action: Read Registry Key, HKEY_LOCAL_MACHINE\SOFTWARE\MyCompany\My Product\Product Integration Kits\;string

Always perform true Actions, Action: Read Registry Key, HKEY_LOCAL_MACHINE\SOFTWARE\MyCompany\My Product\Product Integration Kits\(default);string

Always perform true Actions, Action: Read Registry Key, HKEY_LOCAL_MACHINE\SOFTWARE\MyCompany\My Product\Product Integration Kits\(default);numeric

Always perform true Actions, Action: Read Registry Key, HKEY_LOCAL_MACHINE\SOFTWARE\MyCompany\My Product\Product Integration Kits\default;numeric

Always perform true Actions, Action: Read Registry Key, HKEY_LOCAL_MACHINE\SOFTWARE\MyCompany\My Product\Product Integration Kits\default;string

How can I determine if this key exists or the value of the (default) value?

JoannaG
08-30-2004, 02:20 PM
Hello,

You will need to assign the result of each Read Registry Key Action to either a Global Variable or Variable Object. This can be selected in the Read Registry Key Action Settings under "Store Registry Value In." For example, to store the value in a String Global Variable you would select String1(Global). An Event Object can then be used to Check Custom Condition:

If String1(Global) equals Not Found then
{
Go To Scene
}
else
{
(Whatever true action you want to occur)
}


If you want a button click to trigger the condition check in the Event Object, follow the instructions in Knowledge Base article Q105130 HOW TO: Creating a Button Object That Will Trigger an Event Object. The InstallShield Knowledge Base is located at http://support.installshield.com.

I hope this is helpful.

WWLedebuhr
08-30-2004, 02:59 PM
I have applied your suggestion before I posted this request. I assign the Registry value to a string variable defined in the scene. I have also used a numeric variable to go with the numeric form of the Registry Read.

These are a few Event Objects that I have used:
1 (string variable).
If V eSCC DT-IK Installed equal Not Found then
{
True action
}
else
{
False action
}

2 (numeric variable).
If V eSCC DT-IK Installed greater than 0 then
{
False action
}
else
{
True action
}


The veriable always returns Not Found regardless of the existance of the registry key or the format of the Read Registry action (that I illustrated in my first post.)

JoannaG
08-31-2004, 10:12 AM
Hello,

It would be helpful for me to take a look at your demo so I can see exactly how it has been set up. Can you either post a copy of it here or send a copy of the demo to support@installShield.com referencing this community posting?

Regards.