Decided to share a setup I've created to easily keep our Adobe installs up to date (because packaging with Adobe CCP once a year is enough!).
For our labs, we package our Adobe install with RUM enabled, which allows use the RemoteUpdateManager command line tool. Great! but it's not the most polished tool..
Enter Adobe-RUM-Interface.sh, combined with LoginWindow_MessageHUD.sh to give a notification that updates are running.
credit to @jmahlman for his initial Adobe-RUMWithProgress script, which I have built on here.
In a single policy with startup & recurring triggers I've added the following scripts:
Before
LoginWindow_MessageHUD.sh
script parameters:
$4 (title) "MAINTENANCE"
$5 (image) "adobe"
$6 (description) "Updating Adobe Apps..."
#!/bin/bash
# JamfHelper Loginwindow HUD
# Varibles
lastreboot=`uptime | awk '{print "Last reboot was: " $3 " " $4 }' | sed -e 's/.$//g'`
heading="$4" # This shows up above the image in a bigger bolder font than the description field
image="$5" # Options are as follows [ install | sync | update | alert ] each give you a diffrerent image (nothing is maintenance)
description="$6" # This shows up below the image in a smaller lighter font than the heading field
iconpath="/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/"
# Default settings if none is passed through the variable
if [ "$4" == "" ]; then
title="MAINTENANCE"
fi
if [ "$5" == "" ]; then
iconpath="/System/Library/CoreServices/Installer.app/Contents/Resources/Installer.icns"
fi
if [ "$6" == "" ]; then
description="Please do not login or reboot"
fi
# Case statement to assign specific graphic.
case $image in
sync )
icon="Sync.icns"
;;
info )
icon="ToolbarInfo.icns"
;;
alert )
icon="AlertStopIcon.icns"
;;
adobe )
iconpath=""
icon="/Applications/Utilities/Adobe Application Manager/core/Adobe Application Manager.app/Contents/Resources/AdobeApplicationManager.icns"
;;
esac
# Script contents
# create local LaunchAgent with all parameters for message display
# this is required, as security restrictions forbid jamfhelper from running anywhere but locally
defaults write /Library/LaunchAgents/nz.ac.edu.loginwindowHUD.plist "Disabled" -bool false
defaults write /Library/LaunchAgents/nz.ac.edu.loginwindowHUD.plist "KeepAlive" -bool false
defaults write /Library/LaunchAgents/nz.ac.edu.loginwindowHUD.plist "Label" -string nz.ac.edu.loginwindowHUD
defaults write /Library/LaunchAgents/nz.ac.edu.loginwindowHUD.plist "LimitLoadToSessionType" -string LoginWindow
defaults write /Library/LaunchAgents/nz.ac.edu.loginwindowHUD.plist "ProgramArguments" -array
defaults write /Library/LaunchAgents/nz.ac.edu.loginwindowHUD.plist "ProgramArguments" -array-add -string "/Library/Application Support/JAMF/bin/jamfHelper.app/Contents/MacOS/jamfHelper"
defaults write /Library/LaunchAgents/nz.ac.edu.loginwindowHUD.plist "ProgramArguments" -array-add -string "-windowType"
defaults write /Library/LaunchAgents/nz.ac.edu.loginwindowHUD.plist "ProgramArguments" -array-add -string "hud"
defaults write /Library/LaunchAgents/nz.ac.edu.loginwindowHUD.plist "ProgramArguments" -array-add -string "-lockHUD"
defaults write /Library/LaunchAgents/nz.ac.edu.loginwindowHUD.plist "ProgramArguments" -array-add -string "-windowPosition"
defaults write /Library/LaunchAgents/nz.ac.edu.loginwindowHUD.plist "ProgramArguments" -array-add -string "lr"
defaults write /Library/LaunchAgents/nz.ac.edu.loginwindowHUD.plist "ProgramArguments" -array-add -string "-title"
defaults write /Library/LaunchAgents/nz.ac.edu.loginwindowHUD.plist "ProgramArguments" -array-add -string "$title"
defaults write /Library/LaunchAgents/nz.ac.edu.loginwindowHUD.plist "ProgramArguments" -array-add -string "-description"
defaults write /Library/LaunchAgents/nz.ac.edu.loginwindowHUD.plist "ProgramArguments" -array-add -string "$description"
defaults write /Library/LaunchAgents/nz.ac.edu.loginwindowHUD.plist "ProgramArguments" -array-add -string "-icon"
defaults write /Library/LaunchAgents/nz.ac.edu.loginwindowHUD.plist "ProgramArguments" -array-add -string "$iconpath$icon"
defaults write /Library/LaunchAgents/nz.ac.edu.loginwindowHUD.plist "ProgramArguments" -array-add -string "-startlaunchd"
defaults write /Library/LaunchAgents/nz.ac.edu.loginwindowHUD.plist "QueueDirectories" -array
defaults write /Library/LaunchAgents/nz.ac.edu.loginwindowHUD.plist "RunAtLoad" -bool false
defaults write /Library/LaunchAgents/nz.ac.edu.loginwindowHUD.plist "WatchPaths" -array
launchctl load -Fw -S LoginWindow /Library/LaunchAgents/nz.ac.edu.loginwindowHUD.plist
launchctl start nz.ac.edu.loginwindowHUD
#remove plist after being used
rm -rf /Library/LaunchAgents/nz.ac.edu.loginwindowHUD.plist
# debugging
echo "Title = $4"
echo "Description = $6"
echo "Image = $5"
echo "Icon Path = $iconpath"
echo "Icon Path + Icon = $iconpath$icon"
exit 0
After
Adobe-RUM-Interface.sh
script parameters:
$4 (silentinstall) "YES"
#!/bin/bash
#
#
# Created by John Mahlman, University of the Arts Philadelphia (jmahlman@uarts.edu)
# Previous name: Adobe-RUMWithProgress
# Modified by Hamish Ward
# Name: Adobe-RUM-Interface
#
# Purpose: This script uses CocoaDialog to show which updates are available for Adobe CC and asks
# if they would like to install those updates. If they choose to install updates it will
# show a progress bar to the user and begin installing updates. The progress bar doesn't change,
# it's only there to show the user that something is actually happening.
#
# If silentinstall is enabled (in $4 script variable), the script will forego CocoaDialog requirement &
# automatically apply avalible updates (with no user interaction required) if no one is logged in.
# There will be a JAMF notification in the lower right of the screen.
# Adding this functionallity makes this a dual purpose script for our Lab deployment & Self Service in Lab & Staff environments.
#
#
# Changelog
#
# 9/8/17 - Added link to channel ID list from Adobe
# 8/31/17 - Just some cleaning up
# 8/29/17 - Added a "caffeinate" command when installing updates to stop systems from sleeping during long installs
# 6/19/17 - Removed the "wait" command at the end because it was just causing things to hang
# - Added some sleep 0.2 lines to allow the script some time to catch up
# - Fixed Dreamweaver channel ID
# - Added jamf_bin to determine which jamf binary to use
# 3/23/17 - Added more to "super-echo" to make it nicer for the user to read what's available for updates
# 2/21/17 - Cleaned up script to make it in line with my styling.
# 12/10/17 - hward - renamed to Adobe-RUM-Interface
# - added silentinstall option (installUpdatesSilent function) & logged in user check
# - added log file
#
#
#
# VARIABLES
#
currentuser=$( ls -la /dev/console | cut -d " " -f 4 )
icons=/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources
rumlog=/var/tmp/RUMupdate.log # mmmmmm, rum log
CD_APP=/Library/Scripts/edu/tools/CocoaDialog.app
CocoaDialog=$CD_APP/Contents/MacOS/CocoaDialog
oldRUM=/usr/sbin/# this is where RUM used to live pre-10.11
rum=/usr/local/bin/RemoteUpdateManager # post-10.11
jamf_bin=`/usr/bin/which jamf`
logfile=/var/log/AdobeRUM-$(date +%Y%m%d-%H%M).log
silentinstall="$4"
# Redirect stdout ( > ) into a named pipe ( >() ) running "tee"
exec > >(tee -i $logfile)
exec 2>&1
echo "current user: $currentuser"
if [ "$silentinstall" == "yes" ]; then
echo "silentinstall enabled"
else
echo "user install"
fi
#######
# Installer function
installUpdates ()
{
# Let's caffinate the mac because this can take long
caffeinate -d -i -m -u &
caffeinatepid=$!
# create a named pipe
rm -f /tmp/hpipe
mkfifo /tmp/hpipe
sleep 0.2
# create a background job which takes its input from the named pipe
$CocoaDialog progressbar --indeterminate --float --icon-file "$icons/Sync.icns"
--title "Adobe Remote Update Manager Interface" --text "Downloading and Installing Updates, this may take some time..."
--width "500" --height "115" < /tmp/hpipe &
sleep 0.2
# associate file descriptor 3 with that pipe and send a character through the pipe
exec 3<> /tmp/hpipe
echo -n >&3
# log to stdout available updates
echo "$(date) Updates available :"
echo "$rumlog"
# trigger RUM updater now
$rum --action=install
# now turn off the progress bar by closing file descriptor 3
exec 3>&-
rm -f /tmp/hpipe
# No more caffeine please. I've a headache.
kill "$caffeinatepid"
exit 0
}
######
# silent update option
installUpdatesSilent ()
{
# Let's caffinate the mac because this can take long
caffeinate -d -i -m -u &
caffeinatepid=$!
# log to stdout available updates
echo "$(date) Updates available :"
echo "$rumlog"
# trigger RUM updater now
echo "$(date) silentinstall"
$rum --action=install
# No more caffeine please. I've a headache.
kill "$caffeinatepid"
# kill onscreen notification
killall jamfHelper
exit 0
}
echolog()
{
echo $1
echo $1 >> $logfile
}
#######
# HUD Notification cleanup
killHUD ()
{
if [ -e /Library/LaunchAgents/nz.ac.edu.loginwindowHUD.plist ]; then
rm -rf /Library/LaunchAgents/nz.ac.edu.loginwindowHUD.plist
launchctl unload -Fw -S LoginWindow /Library/LaunchAgents/nz.ac.edu.loginwindowHUD.plist
fi
}
#############
# Script #
#############
# old RUM installed?
if [ -f $oldRUM ] ; then
rm -rf $oldRUM
fi
# new/current RUM installed?
if [ ! -f $rum ] ; then
echo "Installing RUM from JSS"
$jamf_bin policy -event installRUM
if [ ! -f $rum ] ; then
echo "Couldn't install RUM! Exiting."
killHUD
exit 1
fi
fi
# if no user is logged in & silentinstall flag is "yes"
# install all available updates automatically with no UI
if [ "$currentuser" == "root" ]; then
if [ "$silentinstall" == "yes" ]; then
echo "no one logged in & silentinstall enabled.."
# run RUM and output to the log file
touch $rumlog
$rum --action=list > $rumlog
# run updates, if any exist
if [ "$(grep "Following Updates are applicable" $rumlog)" == "Following Updates are applicable on the system :" ] ; then
echo "updates found, installing silently.."
installUpdatesSilent
else
echo "no updates to install"
# kill onscreen notification
killall jamfHelper
killHUD
exit 0
fi
else
echo "silentinstall not enabled, not updating anything."
killHUD
exit 1
fi
else
echo "user logged in, present UI with available updates.."
fi
# does CocoaDialog Exist?
if [ ! -f $CocoaDialog ] ; then
echo "Installing Cocoa Dialog from JSS"
$jamf_bin policy -event installcocoaDialog
if [ ! -f $CocoaDialog ] ; then
echo "Couldn't install Cocoa Dialog! Exiting."
killHUD
exit 1
fi
fi
# Not that it matters but we'll remove the old log file if it exists
if [ -f $rumlog ] ; then
rm $rumlog
fi
#run RUM and output to the log file
touch $rumlog
$rum --action=list > $rumlog
# super-echo! Echo pretty-ish output to user. Replaces Adobes channel IDs with actual app names
# I think it's silly that I have to do this, but whatever. :)
# Adobe channel ID list: https://helpx.adobe.com/enterprise/package/help/apps-deployed-without-their-base-versions.html
secho=`sed -n '/Following*/,/*/p' $rumlog
| sed 's/Following/The Following/g'
| sed 's/ACR/Camera RAW/g'
| sed 's/AEFT/After Effects/g'
| sed 's/AME/Media Encoder/g'
| sed 's/AUDT/Audition/g'
| sed 's/FLPR/Animate/g'
| sed 's/ILST/Illustrator/g'
| sed 's/MUSE/Muse/g'
| sed 's/PHSP/Photoshop/g'
| sed 's/PRLD/Prelude/g'
| sed 's/SPRK/Experience Design Beta/g'
| sed 's/KBRG/Bridge/g'
| sed 's/AICY/InCopy/g'
| sed 's/ANMLBETA/Character Animator Beta/g'
| sed 's/DRWV/Dreamweaver/g'
| sed 's/IDSN/InDesign/g'
| sed 's/PPRO/Premiere Pro/g'
| sed 's/ESHR/Project Felix/g' `
if [ "$(grep "Following Updates are applicable" $rumlog)" == "Following Updates are applicable on the system :" ] ; then
rv=`$CocoaDialog yesno-msgbox --float --icon-file "$icons/ToolbarInfo.icns" --no-cancel
--title "Adobe Remote Update Manager Interface" --text "Do you want to install the following updates?" --informative-text "$secho Please close any currently open Adobe products"`
if [ "$rv" == "1" ]; then
echo "user chose to install updates"
installUpdates
elif [ "$rv" == "2" ]; then
echo "user chose not to install updates"
killHUD
exit 0
fi
else
echo "no updates available"
$CocoaDialog ok-msgbox --float --no-cancel --icon-file "$icons/ToolbarInfo.icns"
--title "Adobe Remote Update Manager Interface" --text "There are no Adobe Updates available."
if [ "$rv" == "1" ]; then
killHUD
exit 0
fi
fi
When the policy runs with the above script variables set, the RemoteUpdateManager will check for updates & automatically install them if no one is logged in - displaying a nice HUD message:
Or if a user is logged in - display the available updates & let them choose to install at their discretion:
A requirement for the user logged in scenario is cocoaDialog, so you'll need to also have a policy with trigger to install that on demand.
I have also rolled this into Self Service, which is handy for our techs.
Hopefully this is useful for others, any feedback is welcome.