Relevance for a Buried application

(imported topic written by olsonc5891)

I want to run relevance against all my servers to determine if Visual C++ 205 Restributable is installed. Sadly, it’s pretty well buried so standard easy relevance won’t cut it. The key changes on every machine so I first have to get a list and then run relevance against the list. The following will work on individual machines. Any help in getting it to work in Bigfix?

Here is the path on the current machine: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{837b34e3-7c30-493c-8f6a-2b0f04e2912c}

Here is a script:


public bool IsProgramInstalled(string displayName)

{

string uninstallKey = @“SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall”;

using (RegistryKey rk = Registry.LocalMachine.OpenSubKey(uninstallKey))

{

foreach (string skName in rk.GetSubKeyNames())

{

using (RegistryKey sk = rk.OpenSubKey(skName))

{

if(sk.GetValue(“Microsoft Visual C++ 2005 Redistributable”) == displayName))

{

return true;

}

}

}

}

return false;

}

and you can call it like this:

bool isInstalled = IsProgramInstalled(“Microsoft Visual C++ 2005 Redistributable”);


Thanks,

Chris

(imported comment written by jeremylam)

So you’re trying to match any registry key with a DisplayName of “Microsoft Visual C++ 2005 Redistributable” in “HKLM\software\microsoft\windows\currentversion\uninstall” ? You can do this with relevance instead of a script:

name of key whose (value "DisplayName" of it = "Microsoft Visual C++ 2005 Redistributable") of key "HKLM\software\microsoft\windows\currentversion\uninstall" of native registry | "Not Found"

(imported comment written by olsonc5891)

Thank you very much! I always seem to overcomplicate these issues (sigh).