Created
April 24, 2017 13:01
-
-
Save paiv/0238196bd317e6c006cbb460f4f4be26 to your computer and use it in GitHub Desktop.
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/sh | |
# From: https://github.com/cielavenir/flashupdate/ | |
#Note: use for installing to ~/Library or updating globally. | |
#New global installation should use normal installer. | |
if [ `whoami` == "root" ];then | |
export HOME="" | |
fi | |
FLASH_URL="http://fpdownload.macromedia.com/pub/flashplayer/latest/help/install_flash_player_osx.dmg" | |
FLASH_DMG=$(mktemp -d -t flash_dmg)/flash.dmg | |
FLASH_MOUNTPOINT=$(mktemp -d -t flash_mountpoint) | |
curl -o $FLASH_DMG $FLASH_URL | |
hdiutil attach -mountpoint $FLASH_MOUNTPOINT -nobrowse $FLASH_DMG | |
FLASH_PKG_ARCHIVE="$FLASH_MOUNTPOINT/Install Adobe Flash Player.app/Contents/Resources/Adobe Flash Player.pkg" | |
FLASH_PKG_EXTRACT_DIR=$(mktemp -d -t flash_pkg_extract_dir) | |
FLASH_INSTALL_SRC="$FLASH_PKG_EXTRACT_DIR/AdobeFlashPlayerComponent.pkg" | |
cd "$FLASH_PKG_EXTRACT_DIR" | |
xar -xf "$FLASH_PKG_ARCHIVE" | |
cd "$FLASH_INSTALL_SRC" | |
cat Payload | gunzip -dc | cpio -i | |
cat Scripts | gunzip -dc | cpio -i | |
mkdir -p "$HOME/Library/Internet Plug-Ins" | |
mkdir -p "$HOME/Library/PreferencePanes" | |
cp -f "$FLASH_INSTALL_SRC/Library/Internet Plug-Ins/Flash Player.plugin.lzma" "$HOME/Library/Internet Plug-Ins" | |
cp -f "$FLASH_INSTALL_SRC/Library/Internet Plug-Ins/flashplayer.xpt" "$HOME/Library/Internet Plug-Ins" | |
cp -fr "$FLASH_INSTALL_SRC/Library/PreferencePanes/Flash Player.prefPane" "$HOME/Library/PreferencePanes" | |
# extracts the lzma archive in ~/Library/Internet Plug-Ins | |
"$FLASH_INSTALL_SRC/finalize" "/$HOME" | |
hdiutil detach $FLASH_MOUNTPOINT -force |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment