Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

[SCRIPT] Install Chromium + Flash 11.7r700 PepperFlash 64bit

Share your HowTo, Documentation, Tips and Tricks. Not for support questions!.
Post Reply
Message
Author
Bas Koning
Posts: 12
Joined: 2011-08-13 03:10

[SCRIPT] Install Chromium + Flash 11.7r700 PepperFlash 64bit

#1 Post by Bas Koning »

This script will install Chromium and Flash 11.7r700 (aka 'pepperflash')

-it installs google-chrome
-grabs 2 files out of google-chrome (libpepflashplayer.so and manifest.json), and copies them to /usr/lib/PepperFlash/
-removes google-chrome
-grabs PEPPER_FLASH_VERSION from /usr/lib/PepperFlash/manifest.json
-adds startup arguments to /etc/chromium/default to start chromium with pepperflash
-tells the user to go to chrome://plugins in Chromium to check the current version and tick the 'always allowed' box if they want.

It is possible to have a folder named keepfiles and store google-chrome-stable_current_amd64.deb in it (so the script wont need to download it).

Save 'Complete Script' as installchromiumflash.sh, then add execution rights like this:

Code: Select all

chmod +x installchromiumflash.sh
To run script: type

Code: Select all

./installchromiumflash.sh
or

Code: Select all

bash installchromiumflash.sh
Complete Script:

Code: Select all

#!/bin/bash 

if [ "$(id -u)" != "0" ]; then
  echo "Must be root user to run this script" 
  exit 1
fi

apt-get update
apt-get -y install chromium-browser

if [ ! -d /usr/lib/PepperFlash ]
then
  mkdir /usr/lib/PepperFlash
fi
if [ ! -f /tmp/google-chrome-stable_current_amd64.deb ] && [ -d keepfiles ] && [ -f keepfiles/google-chrome-stable_current_amd64.deb ];
then
  cp keepfiles/google-chrome-stable_current_amd64.deb /tmp
fi

if [ ! -f /usr/lib/PepperFlash/libpepflashplayer.so ] || [ ! -f /usr/lib/PepperFlash/manifest.json ]
then
  if [ ! -f google-chrome-stable_current_amd64.deb ]
  then
    wget -O /tmp/google-chrome-stable_current_amd64.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb 
  fi
  apt-get -y install libcurl3
  dpkg -i /tmp/google-chrome-stable_current_amd64.deb
  cp /opt/google/chrome/PepperFlash/libpepflashplayer.so /usr/lib/PepperFlash/libpepflashplayer.so
  cp /opt/google/chrome/PepperFlash/manifest.json /usr/lib/PepperFlash/manifest.json
  apt-get -y remove google-chrome-stable
fi

PEPPER_FLASH_VERSION=$(grep '"version":' /usr/lib/PepperFlash/manifest.json| grep -Po '(?<=version": ")(?:\d|\.)*')
echo 'CHROMIUM_FLAGS="--password-store=detect --ppapi-flash-path=/usr/lib/PepperFlash/libpepflashplayer.so --ppapi-flash-version='$PEPPER_FLASH_VERSION'"' > /etc/chromium/default
echo 
echo '(Re)start Chromium'
echo 'Check chrome://plugins/ now says: flash '$PEPPER_FLASH_VERSION
echo 'And tick "Always allowed", perhaps?'
echo
Note: installs http://packages.debian.org/wheezy/libcurl3 which is needed to install google-chrome. If you really dont want curl, remove it afterwards with

Code: Select all

apt-get remove libcurl3
Check flash version inside Chromium at chrome://plugins
Check flash version inside Chromium at chrome://plugins
screenshot6.png (24.64 KiB) Viewed 10426 times
At youtube, rightclick any video to check version is really PepperFlash
At youtube, rightclick any video to check version is really PepperFlash
screenshot5.png (40.86 KiB) Viewed 10426 times
Debian-Wheezy amd64 xfce

Bas Koning
Posts: 12
Joined: 2011-08-13 03:10

Re: [SCRIPT] Install Chromium + Flash 11.7r700 PepperFlash 6

#2 Post by Bas Koning »

To make this script work with 32 bit, just change all
google-chrome-stable_current_amd64.deb
into
google-chrome-stable_current_i386.deb

Like this:

Code: Select all

#!/bin/bash 

if [ "$(id -u)" != "0" ]; then
  echo "Must be root user to run this script" 
  exit 1
fi

apt-get update
apt-get -y install chromium-browser

if [ ! -d /usr/lib/PepperFlash ]
then
  mkdir /usr/lib/PepperFlash
fi
if [ ! -f /tmp/google-chrome-stable_current_i386.deb ] && [ -d keepfiles ] && [ -f keepfiles/google-chrome-stable_current_i386.deb ];
then
  cp keepfiles/google-chrome-stable_current_i386.deb /tmp
fi

if [ ! -f /usr/lib/PepperFlash/libpepflashplayer.so ] || [ ! -f /usr/lib/PepperFlash/manifest.json ]
then
  if [ ! -f google-chrome-stable_current_i386.deb ]
  then
    wget -O /tmp/google-chrome-stable_current_i386.deb https://dl.google.com/linux/direct/google-chrome-stable_current_i386.deb 
  fi
  apt-get -y install libcurl3
  dpkg -i /tmp/google-chrome-stable_current_i386.deb
  cp /opt/google/chrome/PepperFlash/libpepflashplayer.so /usr/lib/PepperFlash/libpepflashplayer.so
  cp /opt/google/chrome/PepperFlash/manifest.json /usr/lib/PepperFlash/manifest.json
  apt-get -y remove google-chrome-stable
fi

PEPPER_FLASH_VERSION=$(grep '"version":' /usr/lib/PepperFlash/manifest.json| grep -Po '(?<=version": ")(?:\d|\.)*')
echo 'CHROMIUM_FLAGS="--password-store=detect --ppapi-flash-path=/usr/lib/PepperFlash/libpepflashplayer.so --ppapi-flash-version='$PEPPER_FLASH_VERSION'"' > /etc/chromium/default
echo 
echo '(Re)start Chromium'
echo 'Check chrome://plugins/ now says: flash '$PEPPER_FLASH_VERSION
echo 'And tick "Always allowed", perhaps?'
echo
Debian-Wheezy amd64 xfce

mirix
Posts: 41
Joined: 2010-01-08 11:18

Re: [SCRIPT] Install Chromium + Flash 11.7r700 PepperFlash 6

#3 Post by mirix »

Hello,

I have modified your script to make it distro-agnostic and to have it handle architecture.

The fact that it is distro-agnostic essentially means that the user needs to install Chromium prior to running the script for it will not attempt to either install or update the browser.

The script only uses standard Linux tools such as bash, wget, grep, ar and tar. The only caveat is that tar must have lzma support.

Usage (as root):

Code: Select all

sh install_pepperflash_in_chromium_sa.sh <arch>
where <arch> can be either i386 or amd64

Here it is:

Code: Select all

#!/bin/bash

if [ "$(id -u)" != "0" ]; then
  echo "You have to be root to run this script"
  exit 1
fi

if [ ! -d /etc/chromium ]
then
  echo "Please, install Chromium before rerunning this script"
  exit 1
fi

if [[ "$1" != "i386" && "$1" != "amd64" ]]
then
  echo "Usage:" 
  echo "sh install_pepperflash_in_chromium_sa.sh <arch>"
  echo "where <arch> can be either i386 or amd64"
  echo "If unsure, you can use 'uname -m' to find out"
  exit 1
fi

if [ ! -d /usr/lib/PepperFlash ]
then
  mkdir /usr/lib/PepperFlash
fi

if [ ! -d /tmp/chrome ]
then
  mkdir /tmp/chrome
else 
  rm -rf /tmp/chrome/*
fi

wget -O /tmp/chrome/google-chrome-stable_current_${1}.deb https://dl.google.com/linux/direct/google-chrome-stable_current_${1}.deb
ar p /tmp/chrome/google-chrome-stable_current_${1}.deb data.tar.lzma | tar -C /tmp/chrome --lzma -x
cp /tmp/chrome/opt/google/chrome/PepperFlash/* /usr/lib/PepperFlash/
rm -rf /tmp/chrome

PEPPER_FLASH_VERSION=$(grep '"version":' /usr/lib/PepperFlash/manifest.json| grep -Po '(?<=version": ")(?:\d|\.)*')
echo 'CHROMIUM_FLAGS="--password-store=detect --ppapi-flash-path=/usr/lib/PepperFlash/libpepflashplayer.so --ppapi-flash-version='$PEPPER_FLASH_VERSION'"' > /etc/chromium/default

echo
echo '(Re)start Chromium'
echo 'Check whether flash '$PEPPER_FLASH_VERSION 'is now under chrome://plugins/'
echo 'You may want to tick "Always allowed"'
echo

Post Reply