Content of multiple files - any then true

written by KyleWeir

Below is what I have and individually they each check an ini file to see if the servername has been changed to the new one “server1”. I had this as separate relevance lines, but then if one failed ie, the one file was updated but not the other ones, then it wasn’t relevant thus skipping the machine. Since there are x86 as well as x64 machines I need to check both paths for the file, and then the contents. Any idea how I can get this to work so that if any of them are true it’ll run the fixlet?

((not exists (lines whose (it contains “server1”) of file “C:\Program Files\TAI Apps\BAPP\BAPP.ini”)) and (not exists (lines whose (it contains “server1”) of file “C:\Program Files (x86)\TAI Apps\BAPP\BAPP.ini”))) or ((not exists (lines whose (it contains “server1”) of file “C:\Program Files\TAI Apps\BAPP\claimsexplorer.ini”)) and (not exists (lines whose (it contains “server1”) of file “C:\Program Files (x86)\TAI Apps\BAPP\claimsexplorer.ini”))) or ((not exists (lines whose (it contains “server1”) of file “C:\Program Files\TAI Apps\BAPP\BAPPimports.ini”)) and (not exists (lines whose (it contains “server1”) of file “C:\Program Files (x86)\TAI Apps\BAPP\BAPPimports.ini”)))

It’d be great if there was a full ide for these fixlets, with help, intelisense etc…

written by jgstew

Personally I avoid the need to check for both “Program Files” locations by looking at the “InstallLocation” or similar location in the uninstall key of the registry first for the folder where the program is actually located, then use that path to look for the contents of the file like you are doing.

To get the folder, do something like this:

folder (value “InstallLocation” of key whose (value “DisplayName” of it as string contains “
BAPP
” AND exists value “InstallLocation” of it) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of native registry as string)

Then do something like this:

exists files whose((name of it as lowercase = “claimsexplorer.ini” OR name of it as lowercase = “bapp.ini” OR name of it as lowercase = “bappimports.ini”) AND (not exists lines whose (it contains “server1”) of it )) of folder (value “InstallLocation” of key whose (value “DisplayName” of it as string contains “BAPP” AND exists value “InstallLocation” of it) of key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall” of native registry as string)

I based this on Relevance #1428 From here:
http://bigfix.me/fixlet/details/743

I agree with your sentiment that a better fixlet debugger & dev tools are needed… even more so on the Mac than the PC.

written by jgstew

another alternative:

exists files whose((name of it as lowercase = “claimsexplorer.ini” OR name of it as lowercase = “bapp.ini” OR name of it as lowercase = “bappimports.ini”) AND (not exists lines whose (it contains “server1”) of it )) of (folder (“C:\Program Files\TAI Apps\BAPP”) ; folder ("C:\Program Files (x86)\TAI Apps\BAPP))

written by KyleWeir

I would use the registry/regapp which is what I normally use with 3rd party apps, but this one was done inhouse years ago and doesn’t quite follow Microsoft standard methods of installing/uninstalling LOL. Thus some of our apps don’t show up as either a registered app or in the uninstall registry.

Also when I try out this 2nd one which works a lot better then what I was doing, and I greatly appreciate it, I’m still running into a problem where if not all of the ini’s were updated, then it basically says well one file passed and is true, so then they are all true. Eventhough the others were false.

written by jgstew

Then try this instead:

exists files whose((name of it as lowercase = “claimsexplorer.ini” OR name of it as lowercase = “bapp.ini” OR name of it as lowercase = “bappimports.ini”) AND (exists lines whose (it contains “OldServerToChange”) of it )) of (folder (“C:\Program Files\TAI Apps\BAPP”) ; folder ("C:\Program Files (x86)\TAI Apps\BAPP))

I’d have to think more about how to get it to check for any file that is missing the correct server info.

written by jgstew

I would highly recommend creating an analysis that pulls back the server setting in each of the files you are interested in. This is a good way to test the relevance you are writing and also to detect any outliers or systems that you may have missed. I like to have an analysis that goes along with almost all of the relevance that I end up writing in Fixlets/Tasks. It is a quick way to test relevance across many machines at once and get a better picture of the situation rather than just getting back a true/false.

This is an example of what I mean:
http://bigfix.me/analysis/details/2994611

I wanted to create a fixlet that would change the “Java Max Memory” value, so I first made an analysis property that reported what the current value was first before writing the relevance that checked for a specific setting to put in a fixlet that changed that setting. This is a simple example, but your situation is more complicated and would benefit from an analysis even more so.

I also like to enumerate all important configuration settings in an analysis so I can see at a glance how systems are configured.