(imported topic written by rmnetops91)
I am having a heck of a time trying to get some analysis relevance to work properly.
Here is what I need to do:
- Search the Un-install key of HKLM for all installations of Java
- If one is found, display the DisplayName value AND the UninstallString value of that item it finds, onto a single line of output
- If multiple versions of Java are installed/found, display each version and uninstall string on their own lines
The logic should work something like this:
-
Search HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall for a key that has a DisplayName value of “java™” or “java 2”
-
If a key is found, then display the following TWO values within that key: DisplayName - UninstallString
-
Find the next key under Uninstall that contains the words "java™ or “java 2” in it’s DisplayName value
-
If another key is found, then display it’s TWO values for DisplayName and UninstallString
This is what I came up with, but it doesn’t really work when multiple versions of Java are found, or it doesn’t seem to keep the DisplayName and UninstallString for the same specific version together.
if (name of operating system as lowercase starts with “win”) then if (exists values “DisplayName” whose (it as string as lowercase contains “java™” OR it as string as lowercase contains “java 2”) of keys of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry) then (value “DisplayName” of keys whose (exists values “DisplayName” whose (it as string as lowercase contains “java™” OR it as string as lowercase contains “java 2”) of it) of keys “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry as string & " - " & value “UninstallString” of keys whose (exists values “DisplayName” whose (it as string as lowercase contains “java™” OR it as string as lowercase contains “java 2”) of it) of keys “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry as string) else “Java not installed” else “Not running Windows”
Can any guru’s help me out?