Faced with the recent Java kerfuffle imposed by Apple's silent updates I am looking for a solution to install .pkg files specific to the OS version.
Apple continues to provide Java updates for 10.6, but for 10.7+ we need to get the file from Oracle. Apple finally released the Java update for 10.6 on Friday, but the software was available before it was showing up as a Software Update through the OS's Software Update section.
For 10.6, we may just end up resorting to waiting for Apple to push it through their Software Updates and use ARD to run those Software Updates, but when pushing out Java updates through ARD using the .pkg file provided by Oracle, I'd like to ensure we are only attempting to install on machines which are 10.7+ and not on anything less than that.
Question: I was wondering if ARD Software Distribution has the capability of installing based on Client OS version, I don't want to attempt to install the Oracle Java intended for 10.7+ machines on any of our 10.6 clients. I can't seem to find any documentation or discussions online. Any/All help is appreciated.
Answer I formulated (great help from the answer below, just wanted to offer an end result for people who may still be scratching their heads):
#!/bin/bash
os_ver_maj=$(sw_vers -productVersion | cut -d . -f 2)
if [ $os_ver_maj -ge 7 ]; then
mkdir /Volumes/ARD && mount_afp afp://ardservername.localdomain/ARD_pkgs /Volumes/ARD && installer -pkg /Volumes/ARD/jre-7u13-macosx-x64.pkg -target /
else
mkdir /Volumes/ARD && mount_afp afp://ardservername.localdomain/ARD_pkgs /Volumes/ARD && installer -pkg /Volumes/ARD/Java6u12OSX10.6.pkg -target /
fi
umount /Volumes/ARD
Explanation:
- I chose to host the files right on the ARD server, downloading from Oracle is almost impossible and I'm sure it will change without warning.
- I also opted to not use
softwareupdate
for 10.6, too many other problems arose, even when choosing the specific PackageName. - When new Java updates come out, we will download and extract the .pkg from the .dmg, place it on the ARD server in the ARD_pkgs directory and update the script to reflect the package version change.
I hope this helps others, thanks for the input and guidance.