PDA

View Full Version : Searching for two registry keys when you dont know the parent key.



sappu17
08-02-2005, 02:29 PM
I need to search for:
Product Name: "MS Word"
Version: "3.1.0.2"

I need this combination of data to search for in Registy under

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVerion\UnInstall\{guid}?
{guid}, I dont know. Thats why I search based on Product Name and Version number.

My question is how do I search for two registry keys which belong to the same parent key when the GUID is unknown?

Give me some ideas if you have any.

Thanks

DLee65
08-02-2005, 02:52 PM
I do not know if this will work for you - I do InstallScript setups but encounter similar problems as you are.

I create a list using RegDBQueryKey and return all the top level keys. I then run a while loop and check for the value under each GUID. Now if each unknown GUID in turn has another unknown GUID then you would have to create a seperate list for each of the sub-GUIDs within the registry hive.

Hope this helps.

sappu17
08-02-2005, 04:37 PM
Good that this is working in my case but still I had a question. I got all the product GUIDS under UnInstall key.
You said you used a while loop to search in the unknows GUIDS. But, all you have at this point is the GUID, how do you search subkeys? I got the list of REGDB_KEYS.

sbrinkmeyer
08-02-2005, 05:24 PM
a different approach that will give you the same is

you could do an appsearch (reglocator) for the apppath of winword.exe save the directory location of that path to a property
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Winword.exe | Path Value | save the data to a property

then use an appsearch (signature) that uses the path found from above and search for that file with specific version.

if it is found this can be used to set a property or be used as a launch condition