Flash won't update via Policy

duffcalifornia
Contributor

So, I have patch reporting turned on for Flash since Flash is such an...amazing piece of software.

I can take a policy and install Flash on a machine that doesn't currently have it and it installs fine.

However, if I have a smart group set to membership requiring Flash to not be on current version, then set the policy to ongoing and to install the latest flash package, nothing happens - it never installs. The policy is set to ongoing as it's a maintenance policy, but again, it just shows that it completes but doesn't seem to update.

I can even set the policy to uninstall Flash and then install the newest version, and again, nothing seems to happen.

Anybody have any guidance on what's going on here?

4 REPLIES 4

adeetz
New Contributor

I use a script to update flash automatically in the background, works great! I can find it for you if you'd like, but I just searched here for a flash update script and then edited what I found for my environment and deployed the script via policy. I have it check every 2 weeks since flash likes to update often.

Taylor_Armstron
Valued Contributor

Not entirely clear from the OP, but do you have the smart group set to "Not: 'latest version'?" If so, you can't scope the install policy that way due to constraints.. you have to manually set the specific version each time you're upgrading. Sounds like they're hoping to do away with that approach in v10.

duffcalifornia
Contributor

@Taylor.Armstrong I did have the policy scoped that way! I just changed it and we'll see how well it works (although with the amount of people not here today, I might not know how successful it is until next week).

@adeetz If you can find it, I'd love to see it, if for no other reason than I'm just learning how to script and I could see what you changed from the base script.

adeetz
New Contributor

@duffcalifornia Here is the thread I got the script from: https://www.jamf.com/jamf-nation/discussions/7658/flash-update-script

And here is what i have in use now, it may not be altered a whole lot. I may be thinking of another script I found on here.

#!/bin/sh
dmgfile="flash.dmg"
volname="Flash"
logfile="/Library/Logs/FlashUpdateScript.log"


    latestver=`/usr/bin/curl -s http://www.adobe.com/software/flash/about/ | sed -n '/Safari/,/</tr/s/[^>]*>([0-9].*)<.*/1/p' | head -1`
    # Get the version number of the currently-installed Flash Player, if any.
    shortver=${latestver:0:2}
    url=http://fpdownload.macromedia.com/get/flashplayer/current/licensing/mac/install_flash_player_"${shortver}"_osx.dmg
    currentinstalledver=`/usr/bin/defaults read "/Library/Internet Plug-Ins/Flash Player.plugin/Contents/version" CFBundleShortVersionString`
    #else
    #   currentinstalledver="none"
    #fi
    # Compare the two versions, if they are different or Flash is not present then download and install the new version.
    if [ "${currentinstalledver}" != "${latestver}" ]; then
        /bin/echo "`date`: Current Flash version: ${currentinstalledver}" >> ${logfile}
        /bin/echo "`date`: Available Flash version: ${latestver}" >> ${logfile}
        /bin/echo "`date`: Downloading newer version." >> ${logfile}
        /usr/bin/curl -s -o `/usr/bin/dirname $0`/flash.dmg $url
        /bin/echo "`date`: Mounting installer disk image." >> ${logfile}
        /usr/bin/hdiutil attach `dirname $0`/flash.dmg -nobrowse -quiet
        /bin/echo "`date`: Installing..." >> ${logfile}
        /usr/sbin/installer -pkg /Volumes/Flash Player/Install Adobe Flash Player.app/Contents/Resources/Adobe Flash Player.pkg -target / > /dev/null
        /bin/sleep 10
        /bin/echo "`date`: Unmounting installer disk image." >> ${logfile}
        /usr/bin/hdiutil detach $(/bin/df | /usr/bin/grep ${volname} | awk '{print $1}') -quiet
        /bin/sleep 10
        /bin/echo "`date`: Deleting disk image." >> ${logfile}
        /bin/rm `/usr/bin/dirname $0`/${dmgfile}
        newlyinstalledver=`/usr/bin/defaults read "/Library/Internet Plug-Ins/Flash Player.plugin/Contents/version" CFBundleShortVersionString`
        if [ "${latestver}" = "${newlyinstalledver}" ]; then
            /bin/echo "`date`: SUCCESS: Flash has been updated to version ${newlyinstalledver}" >> ${logfile}
        else
            /bin/echo "`date`: ERROR: Flash update unsuccessful, version remains at ${currentinstalledver}." >> ${logfile}
            /bin/echo "--" >> ${logfile}
        fi
    # If Flash is up to date already, just log it and exit.       
    else
        /bin/echo "`date`: Flash is already up to date, running ${currentinstalledver}." >> ${logfile}
        /bin/echo "--" >> ${logfile}
    fi