Skip to content

Instantly share code, notes, and snippets.

@kbansal
Last active August 29, 2015 14:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kbansal/fe09e7dde81b3e451b0d to your computer and use it in GitHub Desktop.
Save kbansal/fe09e7dde81b3e451b0d to your computer and use it in GitHub Desktop.
Non-annoying flash update on mac from command line
#!/bin/bash -x
#
# Installs just the plugin -- no flash manager, no fpsaud,
# no system preferences, no lightroom -- the way it should
# be.
#
# Version 14*
#
# (Requires wget, but change it to curl if you don't have it)
set -e
DMG_URL="http://fpdownload.macromedia.com/get/flashplayer/current/licensing/mac/install_flash_player_14_osx_pkg.dmg"
# Clear any old installation directories
rm -rf /tmp/flashinstall
mkdir /tmp/flashinstall
cd /tmp/flashinstall
# Get the archive and mount the dmg
umount -f /Volumes/"Flash Player" || echo Not Mounted
sleep 1
wget $DMG_URL -O fp.dmg
open fp.dmg
sleep 5
# Retreive and extract the pkg inside it
cp /Volumes/"Flash Player"/*.pkg /tmp/flashinstall/"Adobe Flash Player.pkg"
ls "Adobe Flash Player.pkg"
pkgutil --expand "Adobe Flash Player.pkg" a
cd a
# check plugin exists where we expect it to be
tar tf /tmp/flashinstall/a/AdobeFlashPlayerComponent.pkg/Payload "./Library/Internet Plug-Ins/Flash Player.plugin.lzma"
# extract file (requires root password)
sudo tar -x -C / -f /tmp/flashinstall/a/AdobeFlashPlayerComponent.pkg/Payload "./Library/Internet Plug-Ins/Flash Player.plugin.lzma"
# this uncompress the lzma archive to flash plugin (again, requires sudo)
sudo /tmp/flashinstall/a/AdobeFlashPlayerComponent.pkg/Scripts/finalize
echo Success
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment