在注册表子项下搜索特定值

Searching for specific value under registry subkey

使用 InstallShield 2008 Premier 我希望能够在 Windows 注册表中的键中搜索特定字符串。我面临的挑战是,密钥路径中存在未知的子文件夹。例如,在此注册表路径中:HKLM\Software\Wow6432Node\Microsoft\CurrentVersion\Uninstall\GUID 我可能不一定知道 GUID 文件夹的名称,但我需要在 DisplayName 键中查找特定字符串,以查看它是否存在于其中一个 GUID 下文件夹。 InstallShield 2008 中是否有命令可以从 Uninstall 文件夹级别向下搜索该字符串?

我知道有 RegDBKeyExist 这样的命令,但看起来您需要在整个路径中提供特定的文件夹名称才能进行搜索。如果有人 运行 遇到这种情况并且可以提供帮助,我们将不胜感激。
谢谢!

就您提到的 <a href="http://helpnet.installshield.com/installshield19helplib/Subsystems/installshield19langref/helplibrary/LangrefRegDBKeyExist.htm" rel="nofollow noreferrer">RegDBKeyExist</a> InstallScript 函数而言,我假设您正在寻找使用 InstallScript 语言编写的示例。

要枚举您想要使用的已知密钥的子密钥 <a href="http://helpnet.installshield.com/installshield22helplib/Subsystems/installshield22langref/helplibrary/LangrefRegDBQueryKey.htm" rel="nofollow noreferrer">RegDBQueryKey</a> 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 <a href="http://helpnet.installshield.com/installshield22helplib/Subsystems/installshield22langref/helplibrary/LangrefRegDBGetKeyValueEx.htm" rel="nofollow noreferrer">RegDBGetKeyValueEx</a> function. The example of enumerating through the registry subkeys is over there: RegDBQueryKey Example

如果您的项目是没有 Installscript 支持的基本 MSI,您可能需要使用常规 VisualBasic 脚本创建自定义操作 (CA)。有很多关于如何使用 VBScript 枚举注册表项的示例。