PDA

View Full Version : [SCRIPT] Install flashplugin on demand from the internet



Fabianx
03-28-2003, 09:24 PM
Just thought it would be better to post it here, than to have it in the other thread. Enjoy! Comments wanted:

#
# Install flash plugin - from website - is kept if configuration is saved!
#
# GPL
#
# Author: Fabian Franz <knx-flash@fabian-franz.de>

cd /tmp
wget http://macromedia.mplug.org/tarball/debian/install_flash_player_6_linux.tar
.gz
tar xzf install_flash_player_6_linux.tar.gz
cd install_flash_player_6_linux/
mkdir -p /home/knoppix/.netscape/plugins/
mkdir -p /home/knoppix/.mozilla/plugins/
cp flashplayer.xpt libflashplayer.so /home/knoppix/.netscape/plugins/
cp flashplayer.xpt libflashplayer.so /home/knoppix/.mozilla/plugins/
cd ..
#cleanup
rm -rf install_flash_player_6_linux/
rm -f install_flash_player_6_linux.tar.gz

# scan for new plugins
nspluginscan

btw. it is also saved if you save your config to harddisk. So you will not need to install it again the next time you start with myconfig=scan or myconfig=/mnt...

cu

Fabian

aay
03-28-2003, 10:38 PM
Fabian,

It would be GREAT if Knopper would include this. It would be an easy way to add flash without haveing to worry about fitting more stuff on the CD.

The Kurumin Knoppix based CD ('http://www.guiadohardware.net/linux/kurumin/') (in Portuguese) also does this. He posted his scipt for this here ('http://www.knoppix.net/forum/viewtopic.php?t=1033&postdays=0&postorder=asc&start=15').

Carlos' script does things a bit differently and he also uses phoenix.

probono
03-29-2003, 02:52 AM
Yes, please send it to the Knoppix developer maining list.

Btw, does this enable Flash also in Konqueror atomagically? (In Konqueror, you normally have to "search for new plugins" manually before it recognizes Mozilla plugins...)

Fabianx
03-29-2003, 02:06 PM
Yes, please send it to the Knoppix developer maining list.

Btw, does this enable Flash also in Konqueror atomagically? (In Konqueror, you normally have to "search for new plugins" manually before it recognizes Mozilla plugins...)

Yes, this is done in the last step! (nspluginscan)

I have already sent it to Klaus directly, but I think I'll have to make debian package out of it, before he accepts it :-)) [ debian-knoppix would be a good audience, too but I try to get it as fast as possible into the next release]

cu

Fabian

Fabianx
03-29-2003, 04:48 PM
Below is new version, which includes command line parameters, using a local dir (e.g. floppy) and an fully interactive, mode with an 4-step wizard in english and german translation

Enjoy!!!



#!/bin/bash
#
# Install flash plugin - from website or from directory -
# (is kept if configuration is saved!)
#
# GPL
#
# Author: Fabian Franz <knx-flash@fabian-franz.de>

# Constants

VERSION="0.1";
FLASH_PATH= # unset flash path
FLASH_NAME="install_flash_player_6_linux.tar.gz"
FLASH_DIR="install_flash_player_6_linux"
FLASH_FILES="flashplayer.xpt libflashplayer.so"
FLASH_DL_PATH="http://macromedia.mplug.org/tarball/debian/install_flash_player_6_linux.tar.gz"
INTERACTIVE="yes"

clean_exit(){
[ -n "$TMP" ]&& rm -f "$TMP"
}

trap clean_exit EXIT

function setup_dialog()
{
# Set up dialog
XDIALOG_HIGH_DIALOG_COMPAT=1
export XDIALOG_HIGH_DIALOG_COMPAT

TMP="/tmp/knx-flashplugin.tmp$$"

DIALOG="dialog"
[ -n "$DISPLAY" ] && [ -x /usr/bin/Xdialog ] && DIALOG="Xdialog"

[ -f /etc/sysconfig/i18n ] && . /etc/sysconfig/i18n

MAX=4 # number of steps

case "$LANGUAGE" in
de*)
BT="Flashplugin-Installation"
T1="Installation von Macromedia Flash (Schritt 0/$MAX)"
ET="Installation fehlgeschlagen"
ST="Installation erfolgreich"
MESSAGE0="Dieses Skript installiert das Macromedia-Flashplugin aus dem Internet oder von einem Verzeichnis Ihrer Wahl.\n\nAutor: Fabian Franz <knx-flash@fabian-franz.de>"
MESSAGE1="Soll das Flash-Plugin aus dem Internet heruntergeladen werden?"
MESSAGE2="Bitte geben Sie das Verzeichnis an, wo $FLASH_NAME gefunden werden kann."
MESSAGE3="PATH nicht gefunden. Das Skript wird beendet."
MESSAGE4="Scanne nach neuen Plugins. (Konqueror)"
MESSAGE5="Das Flash-Plugin wurde erfolgreich installiert."
;;
*)
BT="Flashplugin-Installation"
T1="Installation of Macromedia Flash (Step 0/$MAX)"
ET="Installation failed"
ST="Installation succeeded"
MESSAGE0="This script installs the Macromedia-flashplugin from the internet or from a directory of your choice.\n\nAuthor: Fabian Franz <knx-flash@fabian-franz.de>"
MESSAGE1="Shall the flash plugin be downloaded from the internet?"
MESSAGE2="Please insert the directory name, where $FLASH_NAME can be found."
MESSAGE3="PATH not found. The script will be terminated."
MESSAGE4="Scanning for new plugins. (Konqueror)"
MESSAGE5="The Flash-Plugin was successfully installed."
;;
esac
N=1; # Step 1
}

# Commandline parsing
while [ $# -ne 0 ];
do
if [ "$1" = "-ni" ];
then
INTERACTIVE="no"
fi

if [ "$1" = "-i" ];
then
INTERACTIVE="yes"
fi

if [ "$1" = "--help" ];
then
echo "install_flashplugin - version $VERSION"
echo "Usage: install_flashplugin <options from below>"
echo " -i - Interactive Dialog mode (default)"
echo " -ni - Non interactive install mode"
echo " -l directory - Where to find the flashplugin"
echo " if not given it is downloaded from the internet"
echo " --help - This help"
exit 1
fi

if [ "$1" = "-l" ];
then
FLASH_PATH=$2
fi

shift # next parameter
done

[ "$INTERACTIVE" = "yes" ] && setup_dialog

if [ -n "$DIALOG" ]; then
$DIALOG --backtitle "$BT" --title "${T1/0/$N}" --msgbox "$MESSAGE0" 15 70
N=$(($N+1))

$DIALOG --backtitle "$BT" --title "${T1/0/$N}" --yesno "$MESSAGE1" 15 70
RC=$?
N=$(($N+1))

cd /tmp
if [ $RC -eq 1 ]; # give location
then
$DIALOG --backtitle "$BT" --title "${T1/0/$N}" --inputbox "$MESSAGE2" 15 70 "$FLASH_PATH" 2>$TMP
[ $? -eq 1 ] && exit 1 # cancel ?
N=$(($N+1))
FLASH_PATH=$(<$TMP)
if [ -f $FLASH_PATH/$FLASH_NAME ]; then
cp $FLASH_PATH/$FLASH_NAME /tmp
else
$DIALOG --backtitle "$BT" --title "$ET" --msgbox "${MESSAGE3/PATH/$FLASH_PATH/$FLASH_NAME}" 15 70 # error!
exit 1
fi
else # dl it
if [ $DIALOG = "dialog" ]; then
wget $FLASH_DL_PATH
else
xterm -e wget $FLASH_DL_PATH
fi
N=$(($N+1))
fi

# Now we should have a /tmp/$FLASH_NAME

if [ -f /tmp/$FLASH_NAME ];
then
tar xzf $FLASH_NAME
cd $FLASH_DIR
mkdir -p /home/knoppix/.netscape/plugins/
mkdir -p /home/knoppix/.mozilla/plugins/
cp $FLASH_FILES /home/knoppix/.netscape/plugins/
cp $FLASH_FILES /home/knoppix/.mozilla/plugins/
RC=$?
cd ..
#cleanup
rm -rf $FLASH_DIR
rm -f $FLASH_NAME

if [ $RC -eq 0 ];
then
# scan for new plugins
( nspluginscan 2>/dev/null; echo "100" ) | $DIALOG --backtitle "$BT" --title "${T1/0/$N}" --gauge "$MESSAGE4" 10 60
else
$DIALOG --backtitle "$BT" --title "$ET" --msgbox "${MESSAGE3/PATH/$FLASH_FILES}" 15 70 # error!
exit 1
fi
else # /tmp/$FLASH_NAME not found
$DIALOG --backtitle "$BT" --title "$ET" --msgbox "${MESSAGE3/PATH//tmp/$FLASH_NAME}" 15 70 # error!
exit 1
fi
$DIALOG --backtitle "$BT" --title "$ST" --msgbox "$MESSAGE5" 10 60
else # non interactive
cd /tmp
if [ -n "$FLASH_PATH" ];
then
cp $FLASH_PATH/$FLASH_NAME /tmp
else
wget $FLASH_DL_PATH
fi
if [ -f /tmp/$FLASH_NAME ];
then
tar xzf $FLASH_NAME
cd $FLASH_DIR
mkdir -p /home/knoppix/.netscape/plugins/
mkdir -p /home/knoppix/.mozilla/plugins/
cp $FLASH_FILES /home/knoppix/.netscape/plugins/
cp $FLASH_FILES /home/knoppix/.mozilla/plugins/
cd ..
#cleanup
rm -rf $FLASH_DIR
rm -f $FLASH_NAME

# scan for new plugins
nspluginscan
else
echo "Error accessing /tmp/$FLASH_NAME"
exit 1
fi
fi

exit 0 # Success!

zzyzx
03-29-2003, 05:18 PM
Maybe you could create a script with a checkbox for a whole slew of stuff

DVD decss
Flash Player Mozilla
Flash Player Konqueror
Real Media Player
Mplayer
Mplayer Mozilla Plugin
Mplayer Konq Plugin
PHP4 , GD2 , MySQL

I guess I may be getting gentoo here.

Fabianx
03-29-2003, 06:13 PM
[original: Sa März 29, 2003 6:13 pm]

Maybe you could create a script with a checkbox for a whole slew of stuff

DVD decss
Flash Player Mozilla
Flash Player Konqueror
Real Media Player
Mplayer
Mplayer Mozilla Plugin
Mplayer Konq Plugin
PHP4 , GD2 , MySQL

I guess I may be getting gentoo here.

DVD decss -> in mplayer
Flash Player Mozilla - OK
Flash Player Konqueror - OK
Real Media Player - not possible
Mplayer - possible with tweaking
Mplayer Mozilla Plugin - possible & easy
Mplayer Konq Plugin - possible & easy
PHP4 , GD2 , MySQL - should be possible with /etc/php.ini tweaking

Problems for the last: Dependencies needed and apt-get is due to "missing" sources-files not usable on default ... But could be possible ...

[edit:]
Seems, that I was wrong. New list follows:

DVD decss -> in mplayer, but could also be otherwise possible.
Flash Player Mozilla - OK
Flash Player Konqueror - OK
Real Media Player - seems actually to be possible, will test soon. [edit2: Easily possible! Only plugin needs tweaking]
Mplayer - possible with tweaking (tweaking? at least with marillats packages I have a really high bunch of dependencies to even get the elf-file running, but heh now it works, and I'm still on CD :-)) )
Mplayer Mozilla/Konq Plugin - possible & easy -> It is not! Only with root chaning /etc/profile and /etc/ld.so.conf can it be possible, but I'm stuck here. Another solution is to compile it on the fly and hardcode path of mplayer :-)) (did I tell you that I know the mplayerplug-in code and am contributor ? ;-) )
PHP4 , GD2 , MySQL - should be possible with /etc/php.ini tweaking, will look into this later ...

UPDATE! (on my local copy)

DVD decss -> in mplayer
Flash Player Mozilla - OK
Flash Player Konqueror - OK
Real Media Player - OK
Mplayer - OK
Mplayer Mozilla Plugin - OK
Mplayer Konq Plugin - OK
PHP4 , GD2 , MySQL - not tried yet

Hm, I begin to like this multimedia-knoppix!

I'll think about it! - More!

cu

Fabian

PS: Just sent my debian-packet to Klaus. I wonder what he will say :-)

[edit: still now answer ... :-/]

dodger
04-01-2003, 12:52 PM
hey, thanx a lot for this nice script. good work!
if installing stuff in linux was as easy as with this script i would have saved ages and ages in the last few years struggling with not-met dependencies and stuff. ;)
kudos
dodger

knopper
04-03-2003, 11:40 PM
Yes, please send it to the Knoppix developer maining list.

Btw, does this enable Flash also in Konqueror atomagically? (In Konqueror, you normally have to "search for new plugins" manually before it recognizes Mozilla plugins...)

Yes, this is done in the last step! (nspluginscan)

I have already sent it to Klaus directly, but I think I'll have to make debian package out of it, before he accepts it :-)) [ debian-knoppix would be a good audience, too but I try to get it as fast as possible into the next release]

cu

Fabian

It's included in 30-03-2003 in "KNOPPIX" -> "Utilities", Thanks Fabian, but I'm not sure about the legalese stuff yet. You may have to add a dialog that shows the macromedia end user license prior to downloading and installing the archive.

Regards
-Klaus Knopper

athlonthunder
04-05-2003, 09:31 PM
Open Mozilla and go under Help menu at top. Look in that menu for "About Plug-ins.

On the plug-ins list page, look top center under the page title for the plugindoc.mozdev.org link and click it.

Look at top center of following page, for the processor platform and click it, such as "plugindocs: | Linux x86 |."

Look for the plugin you which to configure.

true1ever
04-09-2003, 05:28 AM
If you get php with GD2 working, I would love to try that out.

regards,
Jim

gatzke
04-09-2003, 10:19 PM
Could someone post the latest and greatest autoinstall script?

I read that the script is in the latest knoppix version, but I don't want to download 700 MB for one smallish file.

Thanks fabianx and knopper!

sn4tch
09-06-2003, 05:34 PM
:cry:
i got an error, or 3.



knoppix@ttyp1[knoppix]$ ./installflash.sh
./installflash.sh: line 42: syntax error near unexpected token `)'
./installflash.sh: line 42: ` * *de*) '
./installflash.sh: line 1: *: command not found


errm, i have to lern more things, exspecialy bash scripting. so can you tell me where the mistake is...

aay
10-03-2003, 08:22 PM
UPDATE! (on my local copy)

DVD decss -> in mplayer
Flash Player Mozilla - OK
Flash Player Konqueror - OK
Real Media Player - OK
Mplayer - OK
Mplayer Mozilla Plugin - OK
Mplayer Konq Plugin - OK
PHP4 , GD2 , MySQL - not tried yet

Hm, I begin to like this multimedia-knoppix!

I'll think about it! - More!

cu

Fabian

PS: Just sent my debian-packet to Klaus. I wonder what he will say :-)

[edit: still now answer ... :-/]

Fabianx,

I realize this is an old post, but I am curious as to the status of the multimedia stuff. When you say you sent your debian packed to Klaus, I presume you mean the flash installer (which has been available for some time now). Did you script the other things listed as well? Mplayer etc? If so, will this installer one day make it into Knoppix? As always your work on Knoppix is of high quality and highly appreciated.

Adam