Skip to content

Instantly share code, notes, and snippets.

@meoow
Created August 9, 2014 11:51
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 meoow/453ccc38b4fe68354bbb to your computer and use it in GitHub Desktop.
Save meoow/453ccc38b4fe68354bbb to your computer and use it in GitHub Desktop.
Install Flash Broswer Plugin without Running the Installer (Spares Other Craps Being Foreced to be Installed)
#!/bin/bash
[[ ! -f "$1" ]] && exit 1
dmgfile="$1"
while read a b c;do
eval mp='$c'
done < <(hdiutil mount -noautofsck -noverify -noautoopen "$dmgfile"||exit 1)
echo Step 1
7z x -so "$mp/Install Adobe Flash Player.app/Contents/Resources/Adobe Flash Player.pkg" 'AdobeFlashPlayerComponent.pkg/Payload'|cpio -id './Library/Internet Plug-Ins' || exit 1
echo Step 2
7z x -so "$mp/Install Adobe Flash Player.app/Contents/Resources/Adobe Flash Player.pkg" 'AdobeFlashPlayerComponent.pkg/Scripts'|cpio -id './finalize' || exit 1
./finalize . && rm ./finalize
if [[ ! -d ~/'Library/Internet Plug-Ins' ]];then
mkdir ~/'Library/Internet Plug-Ins' || exit 1
fi
if rm -rf ~'/Library/Internet Plug-Ins/Flash Player.plugin';then
mv 'Library/Internet Plug-Ins/Flash Player.plugin' ~/'Library/Internet Plug-Ins/' || exit 1
mv 'Library/Internet Plug-Ins/flashplayer.xpt' ~/'Library/Internet Plug-Ins/' || exit 1
fi
rmdir 'Library/Internet Plug-Ins'
rmdir 'Library'
hdiutil unmount "$mp"
echo All done.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment