Posted on 02-26-2014 01:39 PM
I was looking to setup a policy that installed a piece of software. This piece of software has one package for 10.8.x and one package for 10.9.x. Instead of making two policies to handle this, I thought it would be cool to place both packages into the policy and then put policy limitations on each package so that the appropriate one would be installed according to the OS.
It does work as it should, but it also throws an error and sends an email that it couldn’t install the one because of the package limitation. It makes sense that it throws an error. I’d just prefer it not send me an email in these situations.
Any better way to handle this or is using two policies the way to go?
Posted on 02-26-2014 01:49 PM
You could either live with the errors it throws out, or, you could craft an installer that drops both of your software packages into /tmp/, then runs a postinstall script to check the OS version and choose the proper one to install. Or, along similar lines, check the OS and move the appropriate one into the 'Waiting Room' folder to be installed later through another policy. The only issue with the latter is that when Casper caches a package it also drops an xml file into place with package install options. You might have to also deploy those for the latter option for it to work.
My choice would be install them to /tmp/, check the OS version in the postinstall script, then install the correct package and finally clean up the files in /tmp/