flashplayer-plugin 手动安装

来源:互联网 发布:zabbix snmp windows 编辑:程序博客网 时间:2024/06/11 01:22

 安装了几次都没用,忍无可忍把rpm包解压了直奔目录/usr/lib/flash-plugin/  有五个文件

两个脚本 一个库 两个文档 直接看setup脚本

 

因为firefox是自己解压在用户目录下,所以看到LOCATIONS中没自己的目录,直接看最后两行,发现调用两个函数


可以看出所有工作就是在LOCATIIONS中找到安装firefox/plugin目录在里面建立链接 ,链接到/usr/lib/flash-plugin/libflashplayer.so

因为不是rpm安装的 所以要自己把库拷过去,在建立链接;为了节省时间直接把库放了进去:)  ok

 

 

 

 

#!/bin/bash

# These are the standard browser locations as found within Red Hat, Mandrake
# and SuSE Linux, and the tarball installers.
LOCATIONS="/usr/lib/mozilla /usr/lib/mozilla-* /usr/lib/firefox-* /usr/lib/seamonkey-* /usr/lib/netscape /usr/lib/opera /usr/lib/firefox /usr/local/netscape /usr/local/mozilla /usr/local/firefox /usr/local/seamonkey /opt/mozilla /opt/netscape /opt/firefox /opt/seamonkey "

deleteold() {
# Detect, Backup and Delete old global Flash plugins
# Old plugin files are saved in /root/oldflashplugins.tar.gz
# tar and gzip must be installed
if [ ! -f /root/oldflashplugins.tar.gz ]; then
    FILES="libflashplayer.so ShockwaveFlash.class flashplayer.xpt libgnashplugin.so"
    for DIR in $LOCATIONS
    do
        # Skip symlinks
        if [ -h $DIR ]; then continue; fi

        for F in $FILES
        do
            # Add old plugin files to backup and delete lists
            if [ -f $DIR/plugins/$F ]
            then
                BACKUPLIST="$BACKUPLIST $DIR/plugins/$F"
                DELETELIST="$DELETELIST $DIR/plugins/$F"
            fi
            # Add symbolic links to the delete list
            if [ -h $DIR/plugins/$F ]
            then
                DELETELIST="$DELETELIST $DIR/plugins/$F"
            fi
        done
    done

    # Backup and Delete files if delete list contains files.
    if [ "x$DELETELIST" != "x" ]
    then
        # If tar is available, backup files
        tar --version >& /dev/null
        if [ $? -eq 0 ]; then
            tar cfz /root/oldflashplugins.tar.gz $BACKUPLIST >& /dev/null
            rm -f $DELETELIST
            echo
            echo "NOTICE:"
            echo "Files belonging to older Flash plugins have been removed from the filesystem.  For your safety these files have been saved in /root/oldflashplugins.tar.gz.  You may remove this tarball if these files are no longer required."
        else
            echo
            echo "Error: tar is unavailable."
            echo "Unable to backup old Flash plugin files.  They were deleted in order to prevent conflicts."
        fi
    fi
fi


# Remove /etc/flash.license as it is not used anymore
[ -f /etc/flash.license ] && rm -f /etc/flash.license
}

detectbrowsers() {
# Detect Mozilla plugin compatible browsers
for DIR in $LOCATIONS
do
    # Skip symlinks
    if [ -h $DIR ]; then continue; fi
    if [ -d $DIR/plugins ]; then export LIST="$LIST $DIR"; fi
done
}

link() {
# Link Mozilla plugin compatible browsers
for DIR in $LIST
do
    ln -sf /usr/lib/flash-plugin/libflashplayer.so $DIR/plugins/libflashplayer.so
done
}

deletelinks() {
# Delete symlinks
# Remove Mozilla plugin compatible browsers
for DIR in $LIST
do
    rm -f $DIR/plugins/libflashplayer.so
done
}

#=======================
# Main Section
#=======================
# Pre-Uninstall
if [ "$1" = "preun" ]; then
    detectbrowsers
    deletelinks
    exit 0
fi

# Installation
if [ "$1" = "install" ]; then
    deleteold
    detectbrowsers
    link
    exit 0
fi

# Upgrade
if [ "$1" = "upgrade" ]; then
    detectbrowsers
    link
    exit 0
fi

# Manual Setup

detectbrowsers
link