Hi,
I'm trying to create a policy to push out Project Libre 1.7 to a Mac workstation. There are a couple requirements for the install:
1) Project Libre requires that Java also be installed. We already have a seperate package for java.
2) If Java exists the install will continue and Project Libre will install but the status will report as 'failed' if the Java version installed is > what is in the policy. This happened to me as I manually upgraded java and was at a greater version.
My thought was to write a script (which i'm lousy at) to verify if Java is installed. It would then install both .pkg files from the cache location under JAMF/Downloads. The script looks as follows:
!/bin/bash
#####################################
Variable for the current logged in user name
#####################################
CurrentUser=stat -f "%Su" /dev/console
##################################
Variable for the current Java install path
##################################
JavaFolder="/Library/Application Support/Oracle/java"
#########################
Variable for cached .pkg location
#########################
SoftwareLocation="/Library/Application Support/JAMF/Downloads"
SoftwareLocation="/Library/Application Support/JAMF/Downloads/"
#########################################################################
Check if Java exists before installing Project Libre. If it already exists only
Project Libre will be installed. Otherwise, both packages get installed
#########################################################################
if [ -d "$JavaFolder" ]
then
echo " "
echo "/Java is already installed. Continuing with the install"
echo " "
else
sudo installer -pkg "$SoftwareLocation"/Java8Update112.pkg -target /Applications
fi
##################
Install Project Libre .pkg
##################
sudo installer -pkg "$SoftwareLocation"/ProjectLibre-1.7.pkg -target /Applications
The following is the error message in the policy logs. I also get the same error from the terminal. It basically looks like I don't have rights to that directory but I'm not sure how to get around that problem as it looks like Casper has it locked down.
[STEP 1 of 6]
Executing Policy Project Libre-1.7
[STEP 2 of 6]
Caching package Java8Update112.pkg...
Downloading Java8Update112.pkg...
Downloading https://d1yt58bk9i9lao.cloudfront.net/Java8Update112.pkg...
[STEP 3 of 6]
Caching package ProjectLibre-1.7.pkg...
Downloading ProjectLibre-1.7.pkg...
Downloading https://d1yt58bk9i9lao.cloudfront.net/ProjectLibre-1.7.pkg...
[STEP 4 of 6]
Running script Project Libre Script - Check for JavaInstall Project...
Script exit code: 1
Script result: installer: Error the package path specified was invalid: '/Library/Application Support/JAMF/Downloads//Java8Update112.pkg'.<br/>installer: Error the package path specified was invalid: '/Library/Application Support/JAMF/Downloads//ProjectLibre-1.7.pkg'.<br/>
Error running script: return code was 1.
[STEP 5 of 6]
[STEP 6 of 6]
Any assistance would be greatly appreciated. Especially if I'm going about this completely wrong :-)