Searching registry values

(imported topic written by gks123)

I am trying to search through a list in the registry to see if a certain Chrome plugin is already installed. The problem is, the name of the registry key is not constant and I can’t figure out the correct relevance to do this.

export from regedit:

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome\ExtensionInstallForcelist]

“1”=“pgphcomnlaojlmmcjmiddhdapjpbgeoc;https://clients2.google.com/service/update2/crx

“2”=“cfhdojbkjhnklbpkdaibdccddilifddb;https://clients2.google.com/service/update2/crx

The order that these 2 plugins appear in could be reversed, or the computer could have many other plugins installed. Essentially, I want to know if the string “pgphcomnlaojlmmcjmiddhdapjpbgeoc” exists somewhere in that part of the registry.

I can get a list of the plugins installed, but when I try to search for one specific one, I am not getting an expected result.

q: values of key “HKEY_LOCAL_MACHINE\Software\Policies\Google\Chrome\ExtensionInstallForcelist” of registry

A: pgphcomnlaojlmmcjmiddhdapjpbgeoc;https://clients2.google.com/service/update2/crx

A: cfhdojbkjhnklbpkdaibdccddilifddb;https://clients2.google.com/service/update2/crx

T: 0.174 ms

q: exists key whose ( value of it as string starts with “pgphcomnlaojlmmcjmiddhdapjpbgeoc” ) of key “HKEY_LOCAL_MACHINE\Software\Policies\Google\Chrome\ExtensionInstallForcelist” of registry

A: False

T: 0.122 ms

I don’t need to know any of the details of the registry key, only if the plugin is installed or not.

(imported comment written by dmoore21)

Check out this thread:
https://www.ibm.com/developerworks/community/forums/html/topic?id=c2291d52-83f9-493c-a1c5-4100d76edfdf&ps=25

(imported comment written by gks123)

This is the relevance that I ended up using. returns true if the plugin is not installed, and false if it is installed.

if exists key “HKEY_LOCAL_MACHINE\Software\Policies\Google\Chrome\ExtensionInstallForcelist” of registry then not (number of (values of key “HKEY_LOCAL_MACHINE\Software\Policies\Google\Chrome\ExtensionInstallForcelist” of registry as string) whose (it contains “pgphcomnlaojlmmcjmiddhdapjpbgeoc”) > 0 ) else true