Writeing relevance script that query file version

(imported topic written by ygarti91)

hello everyone

i am newbie in the bigfix and i have a application that i want to deploy

i need bigfix to check 3 things

1 if the o/s is winxp if not then not relevant

2 & 3 if a file is not exist then install else check the file version if its “1.3.5.960” then not install else install

i wrote a script but i am sure that this is not the way that bigfix work

if (exists file “c:\Program Files\IPCS\Investigator\ipcsinv.exe” and (name of operating system = “WinXP”)) then if (version of file “c:\Program Files\IPCS\Investigator\ipcsinv.exe” = “1.3.5.960”) then “true” else “false” else “false”

i really need someone to fix this script and show me the right way

thank you very much

(imported comment written by BenKus)

Hi ygarti,

Welcome to the BigFix Forum… This is good relevance and seems fine for the logic you want, but you probably want to return the value true/false rather than the string “true”/“false” if you are going to put this relevance in a Fixlet.

Here is a modified relevance:

if (exists file “c:\Program Files\IPCS\Investigator\ipcsinv.exe” and (name of operating system = “WinXP”)) then if (version of file “c:\Program Files\IPCS\Investigator\ipcsinv.exe” = “1.3.5.960”) then true else false else false

Or… You don’t need to bother with the if statements, you can rewrite it just like you said it:

((exists file “c:\Program Files\IPCS\Investigator\ipcsinv.exe”) and (name of operating system = “WinXP”) AND (version of file “c:\Program Files\IPCS\Investigator\ipcsinv.exe” = “1.3.5.960”))

Ben

(imported comment written by SystemAdmin)

You can also do something like this:

name of operating system = “WinXP” and not exists file “C:\Program Files\IPCS\Investigator\ipcsinv.exe” whose (version of it >= “1.3.5.960”)

When writing a fixlet for installing an application, it will be applicable only if the relevance is true, thus use a negative during the version check. Also the above code combines the existence and the version check. It is also checking for only versions lower than a specified version, so if you are testing a newer version, this fixlet will still not show that it is relevant.

(imported comment written by ygarti91)

first of all ben and brian thank you for your help

second brian in this way what will happen if the user doesn’t have a file in the c:\Program Files\IPCS\Investigator\ipcsinv.exe will it still install the program ?

(imported comment written by SystemAdmin)

The way I wrote it, it will install if the file does not exist or if the version number is lower than what the fixlet specifies. I then typically target the task to a group or specific computer that I want the application installed on.