WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Firefox - Extension to install the latest version  (Read 67712 times)

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Firefox - Extension to install the latest version
« on: December 29, 2014, 08:53:21 PM »
First, this script was designed to download and package as a tcz extension the latest version of firefox for TC-5.x and TC-6.x, however it has become a little more than that.

This version will attempt to detect the current latest official firefox download, then package it up as a firefox-official extension and install it.
There are options to specify the exact version desired if this differs from the latest, or if this script is no longer able to detect the latest version.because of a change in the mozilla latest web page..??
Additionally, an option to manually edit the firefox download http or ftp address is provided should anyone have specific localization requests.

This script is an updater and an installer.  it does not require any previous install of firefox at all.
This version of the script supports

tc-5-x86
tc-5-x86_64
tc-6-x86
tc-6-x86_64

The newly created firefox-official extension is a direct replacement, therefore will upgrade a previously installed version if found
eg: firefox-official.tcz from both tc-5-x86 & tc-6-x86 repo's

Additionally is a direct replacement for
firefox.tcz from the tc-5-x86_64 repo, however this extension will not be automatically upgraded, there will be an option to uninstall it before the script exit's

With this script (soon to be extension) these previously mentioned firefox-official extensions will no longer be supported and are likely redundant.

In the case of
firefox.tcz from the tc-5-x86_64 and
firefox.tcz from both tc-5-x86 & tc-6-x86 repo's
there is provided a means of uninstalling these outdated firefox extensions if currently installed in the systems onboot.lst
this script will not uninstall any previously installed firefox extensions unless you opt-in to do so
The onus is on the user to uninstall older and possibly conflicting firefox extensions, but I've tried to do the next best thing in that regard.

The only drawback as far as I can see is the process will probably require a reasonably good connection and some free space in terms of memory and permanent storage. 

I'll be grateful for feedback and suggestions



A huge thank you to those who have been helping to test this script.
I should also thank aus9 who's original script inspired me

« Last Edit: October 07, 2015, 01:37:42 AM by Juanito »

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Topic: Firefox - Extension to install the latest version
« Reply #1 on: December 29, 2014, 09:01:15 PM »
To use:

download the script
set executable permissions
run the script until completion
uninstall old version as required
then reboot

:)
« Last Edit: October 07, 2015, 01:30:05 AM by Juanito »

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: Topic: Firefox - Extension to install the latest version
« Reply #2 on: December 29, 2014, 10:27:29 PM »
Quote
The only drawback as far as I can see is the process will probably require a reasonably good connection [...]

I will test and report back as soon as my 3G connection limit kicks in (after downloading 5GB of data the speed is limited to 56Kbit/s). For now I know it works flawlessly at ~2Mbit/s. I'll go watching some youtube with firefox-official. (;
« Last Edit: October 07, 2015, 01:30:37 AM by Juanito »
Download a copy and keep it handy: Core book ;)

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Topic: Firefox - Extension to install the latest version
« Reply #3 on: December 29, 2014, 11:00:48 PM »
I'm guessing if you have no problems with a 3G connection then I think we're safe!!  concern debunked..   2Mbit/s is fast compared to data plans we used to have
[emoji12]




Sent from my iPhone using Tapatalk
« Last Edit: October 07, 2015, 01:32:06 AM by Juanito »

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Topic: Firefox - Extension to install the latest version
« Reply #4 on: December 29, 2014, 11:05:57 PM »
So how long did it take to download the Firefox tar file, 20 seconds?


Sent from my iPhone using Tapatalk
« Last Edit: October 07, 2015, 01:31:17 AM by Juanito »

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: Topic: Firefox - Extension to install the latest version
« Reply #5 on: December 29, 2014, 11:47:24 PM »
~260 - ~310 Kilo Bytes per second it takes about 2 minutes 37 seconds. Just tested.

~8 Kilo Bytes per second, for a 40+ MB file will probably take like two hours. At least.. q:

Still downloading random stuff. (:
« Last Edit: October 07, 2015, 01:32:23 AM by Juanito »
Download a copy and keep it handy: Core book ;)

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Topic: Firefox - Extension to install the latest version
« Reply #6 on: December 30, 2014, 03:33:51 AM »
Yikes but that is in throttled me de?


Sent from my iPad using Tapatalk HD
« Last Edit: October 07, 2015, 01:32:40 AM by Juanito »

Offline Misalf

  • Hero Member
  • *****
  • Posts: 1702
Re: Topic: Firefox - Extension to install the latest version
« Reply #7 on: December 30, 2014, 05:37:08 PM »
2h would be throttled mode, yes. I'm living in the stone age of the internet from time to time. ):
However, my ISP is either too lazy or doesn't care to check my bandwidth consumption or it really likes me because the bandwidth limit don't want to kick in this month for some reason. It usually does. Yay! (:

Anyway, I'm using a quite simple wget script to make sure a troublesome download will not totally fail:
Some stuff might look familiar.. (:
Code: [Select]
#!/bin/sh
## Author: Misalf
## v 0.1
## Jun-6-2014

echo -e "\033]0;Wget...\007"

#. /etc/init.d/tc-functions
#useBusybox

trap 'echo -e "\033]0;$\007" ; line="=" ; f_line ; trap 2 ; kill -2 $$' 1 2 3 13 15

##******************************************************************************************************************
##***************************************************Functions******************************************************
## coreplayer2

## Draws a line at full screen-width  ( use xy=(line#) for row position ;   linecolor=([0]-[7]) linebold=([0]-[7]) ;  line=([char]) )
f_line() {
wide=`stty size | cut -d" " -f2`
#printf "\033[3;0H"
echo -ne "\033[0${linebold};3${linecolor}m "
printf '%*s\n' "$(( wide-2 ))" '' | tr ' ' $line
printf "\033[00m"
}

## Check Connection / URL
f_chkconn () {
echo -ne "\033[00;35m Using\033[01;30m: \033[00;32m${WGET} \033[01;30m::"
echo -e "\033[00;35m URL\033[01;30m: \033[00;36m${URL}"

line="-"
f_line

echo -ne "\033[00;36m Testing connection to server\033[01;30m... \033[00m"
${WGET} -s -T 20 "${URL}" 2>/dev/null &
rotdash $!
case $? in
0) echo -e "\033[00;32mOK \033[00m"; cx=0;;
1) echo -e "\033[00;31mFail\033[00;33m!\033[00m"; cx=1; f_line; exit 1;;
esac
}
##******************************************************************************************************************
##******************************************************************************************************************

f_resolve_url() {
url=$1
domain=`echo $url | sed 's-^[^/]*/*\([^/]*\)/\?.*$-\1-'`
ipaddr=`ping -c 1 $domain | sed -n 's@^.*(\([0-9]*\.[0-9]*\.[0-9]*\.[0-9]*\).*$@\1@p' | head -1`
req_url=`echo $url | sed "s-/[^/]\+-/$ipaddr-"`
wget $req_url
}

##******************************************************************************************************************

#WGET="$(which wget)"
WGET="$(which busybox) wget"

if [ -z "$1" ]; then
echo -e "\033[00;31m No download specified\033[01;30m."
echo -e "\033[00;33m Exiting\033[01;30m..."
sleep 3
exit 1
else
if [ -z "$2" ]; then
DIR="."
URL="$1"
else
DIR="$1"
if [ ! -d "${DIR}" ]; then
echo -e "\033[00;31m Directory does not exist\033[01;30m:"
echo -e "\033[01;34m ${DIR}/"
echo -e "\033[00;33m Exiting\033[01;30m..."
sleep 3
exit 1
fi
URL="$2"
fi
fi

linebold=1
linecolor=0
line="="
f_line

f_chkconn

echo -e "\033[00;35m Downloading to\033[01;30m:"
echo -e "\033[00;34m ${DIR}/\033[00;33m${URL##*/}"
line="-"
f_line

if [ -f ${DIR}/${URL##*/} ]; then
echo -e "\033[00;35m Continuing download\033[01;30m..."
else
echo -e "\033[00;35m Starting download\033[01;30m..."
fi

##******************************************************************************************************************

echo -ne "\033]0;Wget: ${URL##*/}\007"

RETRYNUM=0
while true; do
RETRYNUM=$((RETRYNUM+1))
###xterm -title "Wget: ${URL}" -e $(which busybox) wget -P ${DIR} -c ${URL}
echo -ne "\033[00;32m"
#${WGET} -P ${DIR} -c ${URL} && (echo -e "\n\033[00;33m DONE.") ; break || (echo -e "\033[00;31mERROR\033[01;30m = \033[00;33m$?\n\n\033[00;35mRetrying...\033[00m" ; sleep 2)
${WGET} -P ${DIR} -c ${URL}
EL=$?
case $EL in
0)
echo -e "\n\033[00;33m DONE. Press any key to exit."
line="="
f_line
break
;;
*)
echo -e "\033[00;31m ERROR\033[01;30m = \033[00;33m${EL}"
linebold=0
linecolor=1
line="-"
f_line
linebold=1
linecolor=0
echo -ne "\033[00;35m Waiting 5 seconds\033[01;30m... \033[00;33m"
sleep 5 &
rotdash $!
echo -e "\033[00;35mRetrying\033[01;30m (\033[00;35m#${RETRYNUM}\033[01;30m)\033[00m"
;;
esac
done

read junk

echo -e "\033[00m"

« Last Edit: October 07, 2015, 01:32:55 AM by Juanito »
Download a copy and keep it handy: Core book ;)

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Topic: Firefox - Extension to install the latest version
« Reply #8 on: January 05, 2015, 07:31:05 PM »
For now I know it works flawlessly at ~2Mbit/s. I'll go watching some youtube with firefox-official. (;

I take that as the script is working as intended..  :)

ok extension submitted ( named it  "firefox-latest.tcz" )
« Last Edit: October 07, 2015, 01:33:16 AM by Juanito »

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Topic: Firefox - Extension to install the latest version
« Reply #9 on: January 07, 2015, 09:36:42 PM »
I just noticed that Firefox v35.0 is soon to be released..    Unfortunately the download links and release page hasn't been updated yet..

The update script probably will not auto detect an update until 35.0.1 or higher is released :(


« Last Edit: October 07, 2015, 01:33:33 AM by Juanito »

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Topic: Firefox - Extension to install the latest version
« Reply #10 on: January 18, 2015, 02:24:06 AM »
**Update**

Get Latest Firefox script now updated to support cloud mode install (issue found and fixed while testing on TinyCorePure64.ISO/CD boot )
and fixed Firefox major version update detection
eg: firefox v34.0.05 to v35.0 now properly detected.

new script attached and updated extension submitted

« Last Edit: October 07, 2015, 01:33:56 AM by Juanito »

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Topic: Firefox - Extension to install the latest version
« Reply #11 on: January 27, 2015, 12:48:32 AM »
firefox-latest.tcz (extension) installs (or updates firefox-official to) latest version 35.0.1
« Last Edit: October 07, 2015, 01:34:12 AM by Juanito »

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Topic: Firefox - Extension to install the latest version
« Reply #12 on: April 02, 2015, 03:37:39 AM »
firefox-latest.tcz (extension) creates a new firefox-official extension (or updates a previously installed firefox-official.tcz) to latest version 37.0

in the following versions and architectures
tc-5-x86
tc-5-x86_64
tc-6-x86
tc-6-x86_64

Code: [Select]
Repo in use: http://repo.tinycorelinux.net/6.x/x86/tcz
 TCE directory in use: /mnt/sda2/tc6-x86/optional
 Warning! sda2 has only 10% free space remaining 
===============================================================================

 Fetching dependencies..
 Verifying connection to server, please wait...
 connection ok
squashfs-tools is already downloaded.
/etc/sysconfig/tcedir/optional/squashfs-tools.tcz: OK
wget is already downloaded.
wget.tcz: OK
bzip2 is already downloaded.
bzip2-lib.tcz: OK
bzip2.tcz: OK
file is already downloaded.
file is already installed!
gtk2 is already downloaded.
gtk2 is already installed!
libasound is already downloaded.
libasound is already installed!
dbus-glib is already downloaded.
dbus-glib is already installed!
hicolor-icon-theme is already downloaded.
hicolor-icon-theme is already installed!
cairo is already downloaded.
cairo is already installed!
gamin is already downloaded.
gamin is already installed!

 Acquiring latest version..
 You may choose from the selection at any time, however
   (1) The Latest version 37.0 is
       automatically processed after (30sec) timeout.
 
 Alternatively, choose a download option as desired
   (2) Specify firefox version, or
   (3) Edit download path directly,
       eg. for localization, version..

« Last Edit: October 07, 2015, 01:34:28 AM by Juanito »

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Topic: Firefox - Extension to install the latest version
« Reply #13 on: April 04, 2015, 01:46:20 AM »
Within a couple of days since Firefox version 37.0 release, there is yet another update..  version 37.0.1  is available

At least is a few Mb smaller


use firefox-latest.tcz to get it (install new or update current version)
or use update script from http://forum.tinycorelinux.net/index.php/topic,17942.msg108498.html#msg108498
« Last Edit: October 07, 2015, 01:34:46 AM by Juanito »

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Topic: Firefox - Extension to install the latest version
« Reply #14 on: April 23, 2015, 08:23:10 PM »
Firefox v37.0.2 is available

Use firefox-latest.tcz extension to fetch and create the latest firefox-official.tcz,
simply reboot to install.

Consider deleting the 'firefox-official.tcz.md5.txt' file to prevent Apps > Update from downgrading to an older version when you next run Apps > Update

« Last Edit: October 07, 2015, 01:35:02 AM by Juanito »