Version checking through Display Name (registry)

(imported topic written by SystemAdmin)

Hi Guys,

Given I only have the Display Name on the registry to determine the version of a certain application, how can i compare this to a value version?

Given a sample path below and Display Name Value of “Player 1.3.3” and I wanted to create an analysis which say pass if the version is equal or grater than 1.4.0 and fail if it’s below 1.4.0

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Player

Diplay Name = Player 1.3.3

Thanks!

Currently what i have is something like this but it doesn’t have version checking only application checking through display name. (Note: In this example the version can only be found in the Display Name)

Q: if (exists key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry) then (if number of ((keys of it) whose (value “DisplayName” of it as string contains “Player”)) = 1 then (("Audit Passed - Application Found: " & value “DisplayName” of it as string) of ((key of it) whose (value “DisplayName” of it as string contains “Player”))) else if (number of ((keys of it) whose (value “DisplayName” of it as string contains “Player”)) < 1) then (“Audit Failed - No software with that DisplayName found.”) else ("Audit Failed - Multiple instances found: " & concatenation of ((value “DisplayName” of it as string & ", ") of ((keys of it)) whose (value “DisplayName” of it as string contains “Player”)))) of key “HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of registry else “Audit failed - Unable to find the uninstall key in the registry.”

(imported comment written by jessewk)

Give this a try:

if (exists key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Player” whose (exists value “DisplayName” whose (it as string contains " " AND exists following text whose (exists it as version AND it as version >= “1.4.0”) of last " " of (it as string)) of it) of registry) then (“Pass”) else (“Fail”)