Parameters in relevance

(imported topic written by SystemAdmin)

Ok, so we have parameters in actions now. Are we ever going to be able to dynamically create parameters within the relevance itself?

Example…

I’m working on some relevance to determine if the McAfee EPO agent is installed in 1 of 2 directories. There’s 1 static registry key containing the location of where it’s installed, which might be “C:\Program Files\McAfee…” or “C:\Program Files\Network Associates…”.

What I want to do is create 2 paramaters within the relevance itself. One, which is the contents of the above mentioned registry value (for reuse later), and a second parameter, which I’d build manually as “C:\Documents and Settings\all users\application data” + (“Mcafee” or “Network Associates”) + “Common Framework”

I can double-up on the relevance for each directory, but it would have been nice to make it a little more intelligent using where it’s actually installed.

-Paul

(imported comment written by SystemAdmin)

Paul,

It sounds like you are considering Action Parameters to be a form of variables for the Bigfix action script and you are looking for a variable of sorts in the relevance language. You won’t be able to do direct variable assignment but you should be able to accomplish the logic you outlined using an it clause. The keyword ‘it’ becomes a variable in the relevance expression.

Example:

exists file ((“C:\Documents and Settings\all users\application data” & it & “\Common Framework”) of (preceding text of first “” of following text of first “” of following text of first “” of (“C:\Program Files\McAfee”)))

You would want to replace “C:\Program Files\McAfee” with the registry key of course…

exists file ((“C:\Documents and Settings\all users\application data” & it & “\Common Framework”) of (preceding text of first “” of following text of first “” of following text of first “” of (value “Test” of key “HKLM\McAfee” of registry)))

If you are simply trying to determine if it is installed or not it would be easier to do something like this:

exists regapp “mcshield.exe”

(imported comment written by SystemAdmin)

Hmm… I suppose I could change what I’m trying to do. It appears that the McAfee ePO agent’s data directory is not neccesarily determined by the folder where the agent is installed. I’ve sent an email into McAfee asking for clarification of how to determine the data folder, which might make the relevance easier.

For versioning, rather than go to the registry I suppose I could go directly to the service via the following. At least here it doesn’t matter if it’s installed in a “Network Associates” or “McAfee” folder.

if exists service “McAfeeFramework” then (version of it < version “3.5.5.438”) of file (following text of first “%22” of preceding text of last “%22” of (image path of service “McAfeeFramework”)) else true

'Course I still need to locate the INI to determine if it’s using the correct port numbers we’re using.

-Paul