Skip to content

Instantly share code, notes, and snippets.

@triti
Created May 24, 2013 18:04
Show Gist options
  • Save triti/5645377 to your computer and use it in GitHub Desktop.
Save triti/5645377 to your computer and use it in GitHub Desktop.
Absolute Manage install script for Adobe Flash Player Plugin on OS X
#!/bin/bash
SCRIPT="${0##*/}"
INSTALLPKG="${0%/*}/Install Adobe Flash Player.pkg"
MMSCFGDIR="/Library/Application Support/Macromedia"
MMSCFG="$MMSCFGDIR/mms.cfg"
# Print a message to the system log
# Optionally exit with specified status code
function dlog () {
/usr/bin/logger -s -t "$SCRIPT" "$1"
if [[ -n "$2" ]]; then
exit "$2"
fi
}
# Create a config file and directory with specified options
function mmscfg () {
/bin/mkdir -p "$MMSCFGDIR" && \
printf "AutoUpdateDisable=%s\nSilentAutoUpdateEnable=%s\n" \
"$1" "$2" > "$MMSCFG"
}
# ---------------------------------------------------------------------------
# Parse update options
case $1 in
--update|--updates )
case $2 in
reset|delete|default ) UPDATECHOICE=0 ;;
allow|auto*|silent ) UPDATECHOICE=1 ;;
notify|noisy ) UPDATECHOICE=2 ;;
never|disable ) UPDATECHOICE=3 ;;
esac ;;
esac
# Install Flash Player and exit if unsuccessful
/usr/sbin/installer -pkg "$INSTALLPKG" -target / || dlog "ERROR Installer exited with status $?" -1
dlog "Update choice = $UPDATECHOICE"
# Set update options
case "$UPDATECHOICE" in
0 ) /bin/rm -rf "$MMSCFG" ;;
1 ) mmscfg 0 1 ;;
2 ) mmscfg 0 0 ;;
3 ) mmscfg 1 0 ;;
esac
@tobiasjwm
Copy link

Hi Tyler,

How are you specifying the $UPDATECHOICE? Are you sending a Command Line option in the Absolute package?

  • Tobias Morrison

@triti
Copy link
Author

triti commented Oct 8, 2013

I should check these comments!

Yes, the $UPDATECHOICE variable is set in the case statement based on the command line argument in the Absolute Manage package settings. Setting it to "--update never" would disable updates in the mms.cfg file

@triti
Copy link
Author

triti commented Oct 8, 2013

This script has been updated to work with the new .pkg installer from Adobe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment