registryinstallshieldinstallscript

Searching for specific value under registry subkey


using InstallShield 2008 Premier I am looking to be able to search for a specific String in a key in the Windows registry. My challenge is that there are subfolders in the path to the key that can be unknown. For example, in this registry path: HKLM\Software\Wow6432Node\Microsoft\CurrentVersion\Uninstall\GUID I may not necessarily know the name of the GUID folder, but I need to look for a particular String in a DisplayName key, to see if it exists under one of the GUID folders. Is there a command in InstallShield 2008 that can search for that String from the Uninstall folder level down?

I know there are commands like RegDBKeyExist but it looks like you need to provide specific folder names in the entire path to do searches. If anyone has run into this situation and can assist it would be greatly appreciated.
Thank you!


Solution

  • As far as you referring to RegDBKeyExist InstallScript function I assume you are looking for example written with InstallScript language.

    To enumerate subkeys of the known key you would want to use RegDBQueryKey function. After enumerating subkeys of your path HKLM\Software\Wow6432Node\Microsoft\CurrentVersion\Uninstall you would need to loop through the list and query DisplayName key value to compare it with particular string. This may be done by using RegDBGetKeyValueEx function. The example of enumerating through the registry subkeys is over there: RegDBQueryKey Example.

    If your project is basic MSI without Installscript support you may want to create Custom Action(CA) with regular VisualBasic script. There are plenty examples on how to enumerate registry keys with VBScript.