Created
August 9, 2014 11:51
-
-
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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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