Skip to main content
Question

Flash Removal Script


Forum|alt.badge.img+10
  • Valued Contributor
  • 159 replies

Here's a script to uninstall flash using Adobe's uninstaller app. I am borrowing heavily from @peterloobuyck's great flash updater script. Unfortunately, it won't notify the user to close their web browser. Not sure how much that matters.

If you know of a better way to do this, feel free to post it here. I didn't see any posts about removing flash on here. I imagine it would just be a couple of rm commands, but i'm not sure what exactly gets removed with the uninstaller.

EDIT: I forgot that using /usr/bin/dirname doesn't seem to work in Self Service. Switched to using /tmp/ instead.

#!/bin/sh

dmgfile="uninstall_flash_player_osx.dmg"
volname="Flash"
logfile="/Library/Logs/FlashRemovalScript.log"

url="https://fpdownload.macromedia.com/get/flashplayer/current/support/uninstall_flash_player_osx.dmg"


    currentinstalledver=`/usr/bin/defaults read "/Library/Internet Plug-Ins/Flash Player.plugin/Contents/version" CFBundleShortVersionString`
    if [ "${currentinstalledver}" ]; then
        /bin/echo "`date`: Downloading uninstaller." >> ${logfile}
        /usr/bin/curl -s -o /tmp/$dmgfile $url
        /bin/echo "`date`: Mounting uninstaller disk image." >> ${logfile}
        /usr/bin/hdiutil attach /tmp/$dmgfile -nobrowse -quiet
        /bin/echo "`date`: Uninstalling..." >> ${logfile}
        /Volumes/Flash Player/Adobe Flash Player Uninstaller.app/Contents/MacOS/Adobe Flash Player Install Manager -uninstall> /dev/null
        /bin/sleep 10
        /bin/echo "`date`: Unmounting uninstaller 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 /tmp/${dmgfile}
    else
        /bin/echo "`date`: Flash is not installed" >> ${logfile}
        /bin/echo "--" >> ${logfile}
    fi

4 replies

Forum|alt.badge.img+9
  • Valued Contributor
  • 137 replies
  • October 26, 2017

Works perfectly. Thanks!

I added this to the top for our environment, fwiw:

proxy="HTTP://PROXY:PORT"
echo Using proxy: $proxy
export ALL_PROXY=$proxy
export http_proxy=$proxy
export https_proxy=$proxy
export HTTP_PROXY=$proxy
export HTTPS_PROXY=$proxy

Forum|alt.badge.img+20
  • Contributor
  • 979 replies
  • May 7, 2021

is this adobe flash uninstall script good to go or is there something more current?


sdagley
Forum|alt.badge.img+25
  • Jamf Heroes
  • 3537 replies
  • May 7, 2021

Forum|alt.badge.img+26
  • Honored Contributor
  • 457 replies
  • May 7, 2021

I agree with @sdagley with the recommendation to use @rtrouton 's script.


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings