Script for Removal of Flash Plug-In and related cruft.

clrlmiller
New Contributor III

I'm busy updating the Adobe Flash for our existing 10.6 and 10.7 systems, but have been stumped on a best method for removing the non-update worthy 10.5 systems. Yes, I know I should upgrade them ASAP anyway, but looking to negate the latest security flaw for Flash in the meantime. Since .PKG files will not do an UNinstall, has anyone come up with a Kick-Ass script for removing the files from /Library/Internet Plug-Ins/Flash Player.plugin and the other parts of Flash?

1 ACCEPTED SOLUTION

talkingmoose
Moderator
Moderator

Are you yourself familiar with shell scripting at all?

The reason I ask is that .pkg files can contain a postflight shell script to "uninstall" items. To delete items takes really just one command:

rm /path/to/file.txt
rm -R /path/to/folder

So long as you can identify what you need to remove then this should be pretty simple to write. Add this as a postflight script to a payload free package in Composer and you can push this a variety of ways to accomplish your goal.

View solution in original post

2 REPLIES 2

talkingmoose
Moderator
Moderator

Are you yourself familiar with shell scripting at all?

The reason I ask is that .pkg files can contain a postflight shell script to "uninstall" items. To delete items takes really just one command:

rm /path/to/file.txt
rm -R /path/to/folder

So long as you can identify what you need to remove then this should be pretty simple to write. Add this as a postflight script to a payload free package in Composer and you can push this a variety of ways to accomplish your goal.

rmanly
Contributor III

To disable flash all you really need to do is get rid of the two things in /Library/Internet Plug-Ins, but this will get rid of everything in 10.5.8 with the latest flash available (10.3 r183) installed.

#!/bin/bash

to_remove=(
"/Applications/Utilities/Adobe Flash Player Install Manager.app"
"/Library/Internet Plug-Ins/Flash Player.plugin"
"/Library/Internet Plug-Ins/flashplayer.xpt"
"/Library/PreferencePanes/Flash Player.prefPane"
"/Library/Receipts/Adobe Flash Player.pkg"
)

for item in "${to_remove[@]}"; do
    rm -rf "${item}"
done

** All the quotes are very important here.**