How combinating AND / OR operators in a custom inventory rule ?
I have a custom inventory rule who is verifing a version of Adobe Reader (10.1.X...) and if the version is greater than 10.1.x the computer is "up to date". I have also other conditions in the custom rule but they are all working.
My custom rule for adobe reader:
ProductVersionGreaterThan(%SYSTEMDRIVE%\Program Files\Adobe\Reader 10.0\Reader\AcroRd32.exe, 10.1)
But, a new version of adobe reader has been reloaded "Adobe Reader XI" (11.x.x...) a few days ago, and my custom rule is not working now because the path of Adobe Reader has changed:
%SYSTEMDRIVE%\Program Files\Adobe\Reader 11.0\Reader\AcroRd32.exe
I try to make a rule like this to include the new version:
(ProductVersionGreaterThan(%SYSTEMDRIVE%\Program Files\Adobe\Reader 10.0\Reader\AcroRd32.exe, 10.1) OR
ProductVersionGreaterThan(%SYSTEMDRIVE%\Program Files\Adobe\Reader 11.0\Reader\AcroRd32.exe, 10.99)) AND (...) AND(...) AND...).
But it's not working..
I try to make a rule with using Registry keys, but it's the same problem with the name of Adobe Reader path's folders.
How can I do for combinatting AND / OR operators in a custom inventory rule ?
Thanks for your advices !
KACE Agent version: K1000 - Version 5.3.53053 (Last version available)
OS: Windows 7 SP1 and Windows XP SP3
Community Chosen Answer
My suggestion would be to use a Smart label to handle this, as you can chain qualifiers and get as specific or general as necessary. You may have to adjust how you handle some processes (i.e. reports, etc), but I've found Smart labels to handle this specific situation very well.
If you need some background on Smart labels, here's an article I wrote:
And if you need any help with createing/adjusting the REGEX statements for specifying software versions (= or <), this is another article I wrote:
To help with your specific situation, this Smart label query would tag all machines running either Adobe Reader 10.1.4 or Adobe Reader 11.0 - you could name the smart label "ar-current" for example:
select *, UNIX_TIMESTAMP(now()) - UNIX_TIMESTAMP(LAST_SYNC) as LAST_SYNC_TIME,UNIX_TIMESTAMP(MACHINE.LAST_SYNC) as LAST_SYNC_SECONDS
LEFT JOIN KBSYS.KUID_ORGANIZATION ON KUID_ORGANIZATION.KUID=MACHINE.KUID
LEFT JOIN KBSYS.SMMP_CONNECTION ON SMMP_CONNECTION.KUID = MACHINE.KUID AND KUID_ORGANIZATION.ORGANIZATION_ID = 1
where (( (1 in (select 1 from ORG1.SOFTWARE, ORG1.MACHINE_SOFTWARE_JT where MACHINE.ID = MACHINE_SOFTWARE_JT.MACHINE_ID
and MACHINE_SOFTWARE_JT.SOFTWARE_ID = SOFTWARE.ID
and SOFTWARE.DISPLAY_NAME like 'Adobe Reader%'
and (SOFTWARE.DISPLAY_VERSION RLIKE '(^11[[.period.]]0[[.period.]]00$)'
OR SOFTWARE.DISPLAY_VERSION RLIKE '(^10[[.period.]]1[[.period.]]4$)'))) ))
Hope that helps!