3 # Copyright(C) 2002-2006 Adobe Macromedia Software LLC. All rights reserved.
5 # Adobe Flash Player Installer
8 PRODUCT
="Adobe Flash Player"
16 # Environment variables
17 PATH
=.
:/bin
:/usr
/bin
:/usr
/local
/bin
:/sbin
:$PATH
20 # Get the path of this script
28 ##############################
30 ##############################
32 # the os is not supported
35 echo "ERROR: Your operating system is not supported by the"
36 echo " $PRODUCT installer."
41 # the architecture is not supported
44 echo "ERROR: Your architecture, \'$1\', is not supported by the"
45 echo " $PRODUCT installer."
50 # glibc is older than supported
53 echo "ERROR: Your glibc library is older than $MIN_GLIBCMAJOR.$MIN_GLIBCMINOR."
54 echo " Please update your glibc library."
62 echo "Exiting the $PRODUCT $VERSION installer."
69 ICONV
=`iconv --version | sed -e '2,$d'`
73 ICONVVER
=`echo "$ICONV" | awk '{print $4}'`
74 GLIBCMAJOR
=`echo $ICONVVER | cut -d'.' -f1`
75 GLIBCMINOR
=`echo $ICONVVER | cut -d'.' -f2`
76 if [ \
( $GLIBCMAJOR -ge $MIN_GLIBCMAJOR \
) -a \
( $GLIBCMINOR -ge $MIN_GLIBCMINOR \
) ]; then
84 # check entered directory
85 check_browser_dir
() {
88 if [ -z "$CHECKDIR" ]; then
93 if [ -d "$CHECKDIR" ]; then
95 if [ -w "$CHECKDIR" ]; then
96 # contains plugins and components dirs?
97 if [ -d "$CHECKDIR/plugins" -a -d "$CHECKDIR/components" ]; then
98 # could be Mozilla or Netscape
99 if [ ! -w "$CHECKDIR/plugins" ]; then
100 echo "invalid-plugins-not-writable"
106 elif [ -d "$CHECKDIR/plugins" ]; then
107 if [ ! -w "$CHECKDIR/plugins" ]; then
108 echo "invalid-plugins-not-writable"
111 # is Opera or Netscape Communicator?
112 OPERABIN
=`find $CHECKDIR -type f -name "opera" -print`
113 if [ -f "$OPERABIN" ]; then
116 elif [ -f "$CHECKDIR/netscape-communicator" ]; then
117 echo "valid-communicator"
122 echo "invalid-not-writable"
126 echo "invalid-not-directory"
132 # fix dir if necessary
135 FIRSTCHAR
=`expr "$FIXDIR" : '\(.\).*'`
136 if [ "$FIRSTCHAR" != '/' ]; then
138 echo "$currentdir/$FIXDIR"
144 # warn libflashplayer.so is a symbolic link
145 warn_symbolic_link
() {
147 echo "WARNING: The $PRODUCT binary is a symbolic link."
148 echo " The installer will replace this symbolic link with the actual binary."
153 compare_versions
() {
155 MYFPVERSIONSTR
=`strings "$1" | grep -e "^Shockwave Flash [.\d+]*" | sed -e "s/Shockwave Flash //g"`
156 MYFPVERSION
=`echo "$MYFPVERSIONSTR" | awk '{print $1}'`
157 MYFPVERSIONMAJ
=`echo "$MYFPVERSION" | cut -d'.' -f1`
158 MYFPVERSIONMIN
=`echo "$MYFPVERSION" | cut -d'.' -f2`
159 MYFPVERSIONREV
=`echo "$MYFPVERSIONSTR" | awk '{print $2}' | sed -e "s/^r//g"`
160 # check major version
161 if [ \
( $MYFPVERSIONMAJ -lt $FPVERSIONMAJ \
) ]; then
163 elif [ \
( $MYFPVERSIONMAJ -gt $FPVERSIONMAJ \
) ]; then
165 elif [ \
( $MYFPVERSIONMAJ -eq $FPVERSIONMAJ \
) ]; then
166 # check minor version
167 if [ \
( $MYFPVERSIONMIN -lt $FPVERSIONMIN \
) ]; then
169 elif [ \
( $MYFPVERSIONMIN -gt $FPVERSIONMIN \
) ]; then
171 elif [ \
( $MYFPVERSIONMIN -eq $FPVERSIONMIN \
) ]; then
173 if [ \
( $MYFPVERSIONREV -lt $FPVERSIONREV \
) ]; then
175 elif [ \
( $MYFPVERSIONREV -gt $FPVERSIONREV \
) ]; then
177 elif [ \
( $MYFPVERSIONREV -eq $FPVERSIONREV \
) ]; then
185 check_plugins_dir
() {
187 if [ -d "$CHECKPLUGINSDIR" ]; then
189 if [ -e "$CHECKPLUGINSDIR/libflashplayer.so" ]; then
191 if [ -f "$CHECKPLUGINSDIR/libflashplayer.so" ]; then
192 # is it a symbolic link?
193 if [ -L "$CHECKPLUGINSDIR/libflashplayer.so" ]; then
194 warn_symbolic_link
"$CHECKPLUGINSDIR/libflashplayer.so"
197 VERSIONSTATUS
=`compare_versions "$CHECKPLUGINSDIR/libflashplayer.so"`
198 case $VERSIONSTATUS in
201 echo "WARNING: An older version of the $PRODUCT has been detected in"
202 echo " $CHECKPLUGINSDIR."
203 echo " The installer will overwrite this existing binary."
208 echo "WARNING: A newer version of the $PRODUCT has been detected in"
209 echo " $CHECKPLUGINSDIR."
210 echo " The installer will overwrite this existing binary."
215 echo "WARNING: The same version of the $PRODUCT has been detected in"
216 echo " $CHECKPLUGINSDIR."
217 echo " The installer will overwrite this existing binary."
228 ##############################
230 ##############################
235 USERID
=`id | sed -e 's/).*//; s/^.*(//;'`
236 if [ "X$USERID" = "Xroot" ]; then
242 if [ "X$os" != "XLinux" ]; then
257 # check for iconv and version of glibc
258 GLIBCSTATUS
=`check_glibc`
269 echo "Copyright(C) 2002-2006 Adobe Macromedia Software LLC. All rights reserved."
271 echo "$PRODUCT $VERSION for $PLATFORM"
273 echo "$PRODUCT $VERSION will be installed on this machine."
275 if [ $ROOTINSTALL -eq 1 ]; then
276 echo "You are running the $PRODUCT installer as the \"root\" user."
277 echo "$PRODUCT $VERSION will be installed system-wide."
279 echo "You are running the $PRODUCT installer as a non-root user."
280 echo "$PRODUCT $VERSION will be installed in your home directory."
283 echo "Support is available at http://www.adobe.com/support/flashplayer/"
285 echo "To install $PRODUCT $VERSION now, press ENTER."
287 echo "To cancel the installation at any time, press Control-C."
292 echo "NOTE: Please exit any browsers you may have running."
294 echo "Press ENTER to continue..."
298 # Loop until user is done installing one or more times
300 while [ $okToRepeat -eq 0 ]; do
302 # Loop until user is comfortable with their choices
304 while [ $okToProceed -eq 0 ]; do
313 MOZILLAPLUGIN_NOT_W
=0
314 MOZILLASTATUS
="valid"
318 NETSCAPEPLUGIN_NOT_W
=0
319 NETSCAPESTATUS
="valid"
328 ############################
329 # Get destination directory
330 ############################
333 echo "Please enter the installation path of the Mozilla, SeaMonkey,"
334 printf "or Firefox browser (i.e., /usr/lib/mozilla): "
337 # fix the entered dir if necessary
338 FIXED_DIR
=`fix_dir "$dir"`
342 # check given dir if valid
343 DIRSTATUS
=`check_browser_dir "$dir"`
348 echo "WARNING: Please do not enter a blank installation path."
354 echo "WARNING: Please enter a valid installation path."
358 invalid-not-writable
)
360 echo "WARNING: $dir is not writable."
364 invalid-plugins-not-writable
)
366 echo "WARNING: $dir/plugins is not writable."
370 invalid-not-directory
)
372 echo "WARNING: $dir is not a directory."
378 check_plugins_dir
"$dir/plugins"
382 echo "WARNING: You have entered the installation path to Netscape Communicator."
383 echo " Netscape Communicator is not officially supported."
387 check_plugins_dir
"$dir/plugins"
391 echo "ERROR: Opera is not supported."
397 if [ $ROOTINSTALL -eq 1 ]; then
404 # Mozilla user directory
405 if [ -d "$HOMEDIR/.mozilla" ]; then
407 MOZILLADIR
="$HOMEDIR/.mozilla"
408 COUNT
=`expr $COUNT + 1`
409 if [ ! -w "$HOMEDIR/.mozilla" ]; then
411 MOZILLASTATUS
="invalid"
412 ERRORCOUNT
=`expr $ERRORCOUNT + 1`
413 elif [ \
( -d "$HOMEDIR/.mozilla/plugins" \
) -a \
( ! -w "$HOMEDIR/.mozilla/plugins" \
) ]; then
414 MOZILLAPLUGIN_NOT_W
=1
415 MOZILLASTATUS
="invalid"
416 ERRORCOUNT
=`expr $ERRORCOUNT + 1`
418 STATUSCOUNT
=`expr $STATUSCOUNT + 1`
421 # Netscape user directory
422 if [ -d "$HOMEDIR/.netscape" ]; then
424 NETSCAPEDIR
="$HOMEDIR/.netscape"
425 COUNT
=`expr $COUNT + 1`
426 if [ ! -w "$HOMEDIR/.netscape" ]; then
428 NETSCAPESTATUS
="invalid"
429 ERRORCOUNT
=`expr $ERRORCOUNT + 1`
430 elif [ \
( -d "$HOMEDIR/.netscape/plugins" \
) -a \
( ! -w "$HOMEDIR/.netscape/plugins" \
) ]; then
431 NETSCAPEPLUGIN_NOT_W
=1
432 NETSCAPESTATUS
="invalid"
433 ERRORCOUNT
=`expr $ERRORCOUNT + 1`
435 STATUSCOUNT
=`expr $STATUSCOUNT + 1`
438 if [ \
( $MOZILLA -eq 0 \
) -a \
( $NETSCAPE -eq 0 \
) -a \
( $OPERA -eq 0 \
) ]; then
440 echo "ERROR: Your home directory does not have a Mozilla, SeaMonkey or Firefox"
441 echo " browser user directory. Run one of these browsers at least once."
447 # if local install, ask which dirs to install to if more than one
448 if [ $ROOTINSTALL -ne 1 ]; then
449 if [ \
( $COUNT -gt 1 \
) -a \
( $STATUSCOUNT -gt 1 \
) ]; then
451 echo "Please choose which directory to install $PRODUCT $VERSION:"
453 if [ $MOZILLA -eq 1 ]; then
454 if [ "$MOZILLASTATUS" = "valid" ]; then
455 echo " [m] Install $PRODUCT $VERSION into Mozilla user"
456 echo " directory: $MOZILLADIR"
458 echo " * The installer has detected a Mozilla user directory but cannot install"
459 echo " into the following path: $MOZILLADIR"
460 echo " because of the following:"
462 if [ $MOZILLA_NOT_W -eq 1 ]; then
464 echo " WARNING: $MOZILLADIR is not writable."
466 if [ \
( $MOZILLA_NOT_W -eq 0 \
) -a \
( $MOZILLAPLUGIN_NOT_W -eq 1 \
) ]; then
468 echo " WARNING: $MOZILLADIR/plugins is not writable."
472 if [ $NETSCAPE -eq 1 ]; then
473 if [ "$NETSCAPESTATUS" = "valid" ]; then
474 echo " [n] Install $PRODUCT $VERSION into Netscape user"
475 echo " directory: $NETSCAPEDIR"
477 echo " * The installer has detected a Netscape user directory but cannot install"
478 echo " into the following path: $NETSCAPEDIR"
479 echo " because of the following:"
481 if [ $NETSCAPE_NOT_W -eq 1 ]; then
483 echo " WARNING: $NETSCAPEDIR is not writable."
485 if [ \
( $NETSCAPE_NOT_W -eq 0 \
) -a \
( $NETSCAPEPLUGIN_NOT_W -eq 1 \
) ]; then
487 echo " WARNING: $NETSCAPEDIR/plugins is not writable."
494 # only one browser user directory
495 if [ $MOZILLA -eq 1 ]; then
496 if [ "$MOZILLASTATUS" = "invalid" ]; then
497 echo "The installer has detected a Mozilla user directory but cannot install"
498 echo "into the following path: $MOZILLADIR"
499 echo "because of the following:"
500 if [ $MOZILLA_NOT_W -eq 1 ]; then
502 echo "WARNING: $MOZILLADIR is not writable."
505 if [ \
( $MOZILLA_NOT_W -eq 0 \
) -a \
( $MOZILLAPLUGIN_NOT_W -eq 1 \
) ]; then
507 echo "WARNING: $MOZILLADIR/plugins is not writable."
512 if [ $NETSCAPE -eq 1 ]; then
513 if [ "$NETSCAPESTATUS" = "invalid" ]; then
514 echo "The installer has detected a Netscape user directory but cannot install"
515 echo "into the following path: $NETSCAPEDIR"
516 echo "because of the following:"
517 if [ $NETSCAPE_NOT_W -eq 1 ]; then
519 echo "WARNING: $NETSCAPEDIR is not writable."
522 if [ \
( $NETSCAPE_NOT_W -eq 0 \
) -a \
( $NETSCAPEPLUGIN_NOT_W -eq 1 \
) ]; then
524 echo "WARNING: $NETSCAPEDIR/plugins is not writable."
531 select_local_install
() {
532 printf "Please choose a directory: "
535 if [ \
( \
( "$inum" = "m" \
) -o \
( "$inum" = "M" \
) \
) -a \
( \
( $MOZILLA -eq 1 \
) -a \
( "$MOZILLASTATUS" = "valid" \
) \
) ]; then
538 check_plugins_dir
"$MOZILLADIR/plugins"
539 elif [ \
( \
( $NETSCAPE -eq 1 \
) -a \
( "$NETSCAPESTATUS" = "valid" \
) \
) -a \
( \
( "$inum" = "n" \
) -o \
( "$inum" = "N" \
) \
) ]; then
542 check_plugins_dir
"$NETSCAPEDIR/plugins"
543 elif [ \
( "$inum" = "a" \
) -o \
( "$inum" = "A" \
) ]; then
546 if [ \
( $MOZILLA -eq 1 \
) -a \
( "$MOZILLASTATUS" = "valid" \
) ]; then
547 check_plugins_dir
"$MOZILLADIR/plugins"
549 if [ \
( $NETSCAPE -eq 1 \
) -a \
( "$NETSCAPESTATUS" = "valid" \
) ]; then
550 check_plugins_dir
"$NETSCAPEDIR/plugins"
554 echo "ERROR: Please choose a directory from the list."
559 if [ $ROOTINSTALL -ne 1 ]; then
560 if [ \
( $COUNT -gt 1 \
) -a \
( $STATUSCOUNT -gt 1 \
) ]; then
563 if [ $COUNT -eq $ERRORCOUNT ]; then
574 echo "----------- Install Action Summary -----------"
576 echo "$PRODUCT $VERSION will be installed in the following directory:"
578 if [ $ROOTINSTALL -eq 1 ]; then
579 echo "Browser installation directory = $BROWSERDIR"
581 if [ \
( $MOZILLA -eq 1 \
) -a \
( "$MOZILLASTATUS" = "valid" \
) ]; then
582 echo "Mozilla installation directory = $MOZILLADIR"
584 if [ \
( $NETSCAPE -eq 1 \
) -a \
( "$NETSCAPESTATUS" = "valid" \
) ]; then
585 echo "Netscape installation directory = $NETSCAPEDIR"
591 get_installagreement
() {
592 printf 'Proceed with the installation? (y/n/q): '
607 echo "Please enter 'y', 'n', or 'q'."
617 #######################
618 # Perform installation
619 #######################
625 if [ $ROOTINSTALL -eq 1 ]; then
627 # remove symbolic link before copying
628 if [ $SYMBOLIC_LINK -eq 1 ]; then
629 rm -f "$BROWSERDIR/plugins/libflashplayer.so"
631 cp -f "$cwd/libflashplayer.so" "$BROWSERDIR/plugins"
634 if [ $MOZILLA -eq 1 ]; then
635 if [ \
( ! -d "$MOZILLADIR/plugins" \
) -a \
( $MOZILLA_NOT_W -eq 0 \
) ]; then
636 mkdir
-p "$MOZILLADIR/plugins"
638 if [ \
( $MOZILLA_NOT_W -eq 0 \
) -a \
( $MOZILLAPLUGIN_NOT_W -eq 0 \
) ]; then
639 cp -f "$cwd/libflashplayer.so" "$MOZILLADIR/plugins"
642 if [ $NETSCAPE -eq 1 ]; then
643 if [ \
( ! -d "$NETSCAPEDIR/plugins" \
) -a \
( $NETSCAPE_NOT_W -eq 0 \
) ]; then
644 mkdir
-p "$NETSCAPEDIR/plugins"
646 if [ \
( $NETSCAPE_NOT_W -eq 0 \
) -a \
( $NETSCAPEPLUGIN_NOT_W -eq 0 \
) ]; then
647 cp -f "$cwd/libflashplayer.so" "$NETSCAPEDIR/plugins"
652 #----------------------
653 # remove xpti.dat file
654 #----------------------
655 if [ $ROOTINSTALL -eq 1 ]; then
656 if [ -f "$BROWSERDIR/components/xpti.dat" ]; then
657 rm -f "$BROWSERDIR/components/xpti.dat"
660 if [ \
( $MOZILLA -eq 1 \
) -o \
( $NETSCAPE -eq 1 \
) ]; then
661 # don't know where xpti.dat file is located
663 echo "NOTE: Please ask your administrator to remove the xpti.dat from the"
664 echo " components directory of the Mozilla or Netscape browser."
672 if [ $ROOTINSTALL -eq 1 ]; then
673 chmod 755 "$BROWSERDIR/plugins/libflashplayer.so"
675 if [ $MOZILLA -eq 1 ]; then
676 if [ \
( $MOZILLA_NOT_W -eq 0 \
) -a \
( $MOZILLAPLUGIN_NOT_W -eq 0 \
) ]; then
677 chmod 755 "$MOZILLADIR/plugins/libflashplayer.so"
680 if [ $NETSCAPE -eq 1 ]; then
681 if [ \
( $NETSCAPE_NOT_W -eq 0 \
) -a \
( $NETSCAPEPLUGIN_NOT_W -eq 0 \
) ]; then
682 chmod 755 "$NETSCAPEDIR/plugins/libflashplayer.so"
688 echo "Installation complete."
691 # Ask to repeat installation?
694 printf 'Perform another installation? (y/n): '
707 echo "Please enter 'y' or 'n'."
718 # check MOZ_PLUGIN_PATH
719 if [ ! -z "$MOZ_PLUGIN_PATH" ]; then
721 echo "WARNING: You have the MOZ_PLUGIN_PATH environment variable set."
722 echo " Either unset this environment variable or set the path in this"
723 echo " environment variable to the path you are installing the plug-in."
729 echo "Please log out of this session and log in for the changes to take effect."
733 echo "The $PRODUCT installation is complete."