Parse a directory containing driver files, and build a relevance statement to detect the device is present without an equal or newer version of the drivers:
q: concatenation " OR " of ("(" & it & ")") of ("exists (keys of keys of key %22HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\PCI%22 of native registry) whose ( /* if class is defined then class matches expectation (ex. %22Video%22); if no class is listed then its an unknown device and may still be relevant */(if exists (value %22ClassGUID%22 of it) then (value %22ClassGUID%22 of it as string as lowercase = %22" & item 1 of it as lowercase & "%22) else true) AND ( /* exists a hardware ID matching our expected list from INF*/ exists (substrings separated by %22%00%22 of ((if exists value %22HardwareID%22 of it then value %22HardwareID%22 of it as string as lowercase else %22%22) & %22%2500%22 & (if exists value %22CompatibleIDs%22 of it then value %22CompatibleIDs%22 of it as string as lowercase else %22%22) as trimmed string)) whose (it != %22%22 and it as lowercase is contained by set of (" & item 2 of it as lowercase & "))) AND /* if there is no %22Driver%22 key then true, else check the driver present in the %22Driver%22 key */ (if not exists value %22Driver%22 of it then true else (exists (it, keys of key %22" & item 1 of it & "%22 of key %22HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class%22 of native registry) whose (pathname of item 1 of it as lowercase ends with value %22Driver%22 of item 0 of it as string as lowercase AND ( /* wrong Provider */ not exists (value %22ProviderName%22 of item 1 of it) whose (it = %22" & item 0 of it & "%22) or ( /* version too low */ not exists (value %22DriverVersion%22 of item 1 of it) whose (it as string as version >= version %22" & item 3 of it as string & "%22)))) )))") of ((if key "Provider" of it starts with "%25" then ((if it starts with "%22" and it ends with "%22" then following text of first "%22" of preceding text of last "%22" of it else it) of (following text of first "=" of item 0 of it as trimmed string) of (variables of it, keys "Provider" of it) whose (item 0 of it as string as lowercase starts with "[strings]." & substring between "%25" of item 1 of it as lowercase & "=")) else key "Provider" of it), key "ClassGUID" of it, concatenation ";" of ("%22pci\" & it & "%22") of unique values of (following texts of firsts "PCI\" of lines of it), following text of last " " of key "DriverVer" of it as trimmed string as version) of (find files "*.inf" of folder (it)) of ("C:\Temp\download\ATI_Radeon_8.680.0_DriverOnly_Win7x64")
A: (exists (keys of keys of key "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\PCI" of native registry) whose ( /* if class is defined then class matches expectation (ex. "Video"); if no class is listed then its an unknown device and may still be relevant */(if exists (value "ClassGUID" of it) then (value "ClassGUID" of it as string as lowercase = "{4d36e968-e325-11ce-bfc1-08002be10318}") else true) AND ( /* exists a hardware ID matching our expected list from INF*/ exists (substrings separated by "%00" of ((if exists value "HardwareID" of it then value "HardwareID" of it as string as lowercase else "") & "%2500" & (if exists value "CompatibleIDs" of it then value "CompatibleIDs" of it as string as lowercase else "") as trimmed string)) whose (it != "" and it as lowercase is contained by set of ("pci\ven_1002&dev_9490&subsys_25421028";"pci\ven_1002&dev_94c1&subsys_0d021028";"pci\ven_1002&dev_94c3&subsys_04021028";"pci\ven_1002&dev_9540&subsys_00021028";"pci\ven_1002&dev_95c0&subsys_32431028";"pci\ven_1002&dev_95c5&subsys_03421028"))) AND /* if there is no "Driver" key then true, else check the driver present in the "Driver" key */ (if not exists value "Driver" of it then true else (exists (it, keys of key "{4D36E968-E325-11CE-BFC1-08002BE10318}" of key "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class" of native registry) whose (pathname of item 1 of it as lowercase ends with value "Driver" of item 0 of it as string as lowercase AND ( /* wrong Provider */ not exists (value "ProviderName" of item 1 of it) whose (it = "ATI Technologies Inc.") or ( /* version too low */ not exists (value "DriverVersion" of item 1 of it) whose (it as string as version >= version "8.680.0.0")))) )))) OR (exists (keys of keys of key "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Enum\PCI" of native registry) whose ( /* if class is defined then class matches expectation (ex. "Video"); if no class is listed then its an unknown device and may still be relevant */(if exists (value "ClassGUID" of it) then (value "ClassGUID" of it as string as lowercase = "{4d36e968-e325-11ce-bfc1-08002be10318}") else true) AND ( /* exists a hardware ID matching our expected list from INF*/ exists (substrings separated by "%00" of ((if exists value "HardwareID" of it then value "HardwareID" of it as string as lowercase else "") & "%2500" & (if exists value "CompatibleIDs" of it then value "CompatibleIDs" of it as string as lowercase else "") as trimmed string)) whose (it != "" and it as lowercase is contained by set of ("pci\ven_1002&dev_9490&subsys_25421028";"pci\ven_1002&dev_94c1&subsys_0d021028";"pci\ven_1002&dev_94c3&subsys_04021028";"pci\ven_1002&dev_9540&subsys_00021028";"pci\ven_1002&dev_95c0&subsys_32431028";"pci\ven_1002&dev_95c5&subsys_03421028"))) AND /* if there is no "Driver" key then true, else check the driver present in the "Driver" key */ (if not exists value "Driver" of it then true else (exists (it, keys of key "{4D36E968-E325-11CE-BFC1-08002BE10318}" of key "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class" of native registry) whose (pathname of item 1 of it as lowercase ends with value "Driver" of item 0 of it as string as lowercase AND ( /* wrong Provider */ not exists (value "ProviderName" of item 1 of it) whose (it = "ATI Technologies Inc.") or ( /* version too low */ not exists (value "DriverVersion" of item 1 of it) whose (it as string as version >= version "8.680.0.0")))) ))))