Flash update script says it's completing, but it's not

nadams
New Contributor III

I'm running a flash update script once a week that has been working fine all the way through version 30 of Flash. Since 31 was released, the script has been continuing to run, and is reporting that the update has completed successfully, but in reality, it is not. I updated my extension attribute so that it properly reports version 31 now, but the only ones that are updated are those that were done manually. Everyone else is still on version 30.

I've stepped through the script, and the version check from Adobe is reporting the correct new version. The download is then pulling in the DMG using that version #. It supposedly installs that version, says upgrade successful, but it's not upgraded.

Anyone else run into this with their flash update scripts?

1 REPLY 1

dsavageED
Contributor III

Our flash script still seems to work, attached...

#!/bin/sh

###################################################################
#
# This script will check whether the currently installed version
# of Flash Player matches that available from Adobe's servers. If
# the versions differ, it will download the latest version and
# install it.
#
# The variable DOWNLOAD_URL should be provided with, if necessary
# a placeholder for ${major_version} which will be interpolated
# before download.
##################################################################

DOWNLOAD_URL=`curl http://get.adobe.com/flashplayer/webservices/json/ | python -m json.tool | grep osx.dmg | awk -F '"' '{sub(/^http:/, "https:", $4); print $4}'`

ME=$(basename "${0}")

installed_version="$(defaults read /Library/Internet Plug-Ins/Flash Player.plugin/Contents/version CFBundleShortVersionString)"

available_version="$(/usr/bin/curl --silent http://fpdownload2.macromedia.com/get/flashplayer/update/current/xml/version_en_mac_pl.xml |
                 grep 'update version' | sed -E 's/.*update version="([0-9,]+)".*/1/;s/,/./g')"

major_version=$(echo ${available_version} | awk -F '.' '{print $1}')

install_flash() {
  # Create a temporary directory in which to mount the .dmg
  tmp_mount=`/usr/bin/mktemp -d /tmp/flashplayer.XXXX`

  # Attach the install DMG directly from Adobe's servers (ensuring HTTPS)
  hdiutil attach "$( eval echo "${DOWNLOAD_URL}" )" -nobrowse -quiet -mountpoint "${tmp_mount}"

  # The package has used some slightly different naming schemes
  pkg_path="$(/usr/bin/find ${tmp_mount} ( -iname *Flash*.pkg -o -iname *Flash*.mpkg ))"

  # Install the package, logging as much as we can
  /usr/sbin/installer -dumplog -verbose -pkg "${pkg_path}" -target "/"

  # Let things settle down
  sleep 1

  # Detach the dmg and remove the temporary mountpoint
  hdiutil detach "${tmp_mount}" && /bin/rm -rf "${tmp_mount}"
}

# If the version installed differs at all from the available version
# then we want to update

case "${installed_version}" in
  "${available_version}")
    echo "$ME: Flash version checked OK (${available_version})"
    ;;
  *) 
    echo "$ME: Flash version differs - installed: ${installed_version} available ${available_version}"
    install_flash
    ;;
esac

exit 0;