Hey all- I have a simple script that allows an end user to update to 10.13.6 (or, soon, 10.14) via Self Service with the click of a button. (I have a separate policy that caches the installer in the user's /Applications folder based on criteria in a Smart Group.) One thing I want my installer script to check for is whether or not that installer file has been cached or not, and if not the script should prompt the user with a dialogue box and exit. Here is what I have been trying, with no success.
#!/bin/sh
# First we gotta make sure the installer has already been cached per the user's Smart Group
if [ ! -f "/Applications/Install macOS High Sierra.app" ]; then
dialog="The High Sierra installer is not yet on your computer. Please reach out to IT."
description=`echo "$dialog"`
button1="OK"
jamfHelper="/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper"
icon="/path/to/icon"
"$jamfHelper" -windowType utility -description "$description" -button1 "$button1" -icon "$icon"
exit 0
fi
# This is the heading to be used for jamfHelper
heading="Please wait as we prepare your computer for macOS High Sierra. Exciting!"
...and the installation continues from here.
What happens is I get that "error" dialogue even when the installer is in the /Applications folder. And when I remove the above portion from my script everything works as intended.
Ideas?