Page 1 of 19 12311 ... LastLast
Results 1 to 10 of 183

Thread: Firefox Installation Script Development Thread

  1. #1
    Join Date
    May 2005
    Location
    US
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Firefox Installation Script Development Thread

    Introduction
    Starting with the second post in this thread, nanotube brought to life a sophisticated script translating the many copy-and-paste commands from the Ubuntu Wiki for getting the Mozilla (not Ubuntu) build of Firefox installed.

    News
    We now have a subforum in the Ubuntu Forums! You're in it right now.
    Last edited by aysiu; April 24th, 2007 at 05:52 PM.

  2. #2
    Join Date
    Jan 2006
    Location
    Philadelphia
    Beans
    4,073
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: firefox 1.5 installed via wiki howto

    Quote Originally Posted by aysiu
    For the future, you might want to know that I've created a script that automates the Wiki instructions:
    http://www.psychocats.net/ubuntu/firefox
    by the way, i was looking at your script, and it lacks exit status checking in a big way. it just plods through the wiki instructions. so, for example, say, if the wget fails, it will just keep going on trying to untar, and that will fail, and it will try to do other stuff... in other words, not really smooth. you "should" check the exit status of the command before moving on to the next step.

  3. #3
    Join Date
    May 2005
    Location
    US
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: firefox 1.5 installed via wiki howto

    Quote Originally Posted by nanotube
    by the way, i was looking at your script, and it lacks exit status checking in a big way. it just plods through the wiki instructions. so, for example, say, if the wget fails, it will just keep going on trying to untar, and that will fail, and it will try to do other stuff... in other words, not really smooth. you "should" check the exit status of the command before moving on to the next step.
    I'm not a programmer, so I don't know how to do that.

    The script is open source (after all, I just lifted it straight off the Wiki instructions). Go ahead and modify it as you see fit. I have no doubt that it can be improved--right now, though, it's the easiest way to get 1.5.0.3 on Breezy.

    Ideally, it would have these exit things you're talking about. Ideally, it would ask the user what version of Firefox to get (British, American, etc.) and fetch that. Ideally, it would figure out if the mirror it's trying to pull from is dead and pull from another mirror instead.

    Right now, though, the only other alternatives are:

    Wiki (copy and paste a lot of instructions)
    Automatix (install a whole new program and change up your sources.list--not a bad thing at all, but it's a bit more involved)
    Upgrade Dapper (extremely involved, possibly resulting in a lot of breakage)

    In other words, it's the best at what it does right now. If you want to make it better, I'm all for it!

  4. #4
    Join Date
    Jan 2006
    Location
    Philadelphia
    Beans
    4,073
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: firefox 1.5 installed via wiki howto

    Quote Originally Posted by aysiu
    I'm not a programmer, so I don't know how to do that.

    The script is open source (after all, I just lifted it straight off the Wiki instructions). Go ahead and modify it as you see fit. I have no doubt that it can be improved--right now, though, it's the easiest way to get 1.5.0.3 on Breezy.

    Ideally, it would have these exit things you're talking about. Ideally, it would ask the user what version of Firefox to get (British, American, etc.) and fetch that. Ideally, it would figure out if the mirror it's trying to pull from is dead and pull from another mirror instead.

    Right now, though, the only other alternatives are:

    Wiki (copy and paste a lot of instructions)
    Automatix (install a whole new program and change up your sources.list--not a bad thing at all, but it's a bit more involved)
    Upgrade Dapper (extremely involved, possibly resulting in a lot of breakage)

    In other words, it's the best at what it does right now. If you want to make it better, I'm all for it!
    heh ok, i will take a crack at it and see what comes out!

  5. #5
    Join Date
    May 2005
    Location
    US
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: firefox 1.5 installed via wiki howto

    Quote Originally Posted by nanotube
    heh ok, i will take a crack at it and see what comes out!
    Thanks.

    I'm wondering how much demand there will be for it in a week, though.

    Do you think people would be cool with Ubuntu's Firefox as long as they use the "take back the Firefox logo" script? Or would they, for some other reason, want the official Mozilla version anyway?

  6. #6
    Join Date
    Jan 2006
    Location
    Philadelphia
    Beans
    4,073
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: firefox 1.5 installed via wiki howto

    Quote Originally Posted by aysiu
    Thanks.

    I'm wondering how much demand there will be for it in a week, though.

    Do you think people would be cool with Ubuntu's Firefox as long as they use the "take back the Firefox logo" script? Or would they, for some other reason, want the official Mozilla version anyway?
    well, at some point in the future, i'm sure firefox 1.6 or 2.0 will come out, and just like ff15 on breezy now, it will be absent from the dapper repositories, and then everyone will be asking "how come i still have ff 1.5 when on mozilla.org it shows 2.0 is released? how do i install it?" and that's when interest in your firefox install script will be revived anew.

    also, i am not sure, but if ubuntu makes some changes to the official ubuntu firefox, that makes automatic updates through firefox not work correctly, then there might still be reason to use "original" firefox.

    and another thing - i, for one, would probably wait until 1 or 2 months have passed since the dapper release, so that most bugs have time to be ironed out. since i use ubuntu on my main workhorse computer, i would hate for anything untoward to ruin the show after an upgrade. i am sure there will be quite a few people thinking the same thing - so maybe there will be some use for ff1.5 install on breely for a few months yet.

    so, at any rate, i figure i can use a bit of practice in my bash scripting, no matter what the future has in store for this firefox install script.

  7. #7
    Join Date
    May 2005
    Location
    US
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: firefox 1.5 installed via wiki howto

    Quote Originally Posted by nanotube
    so, at any rate, i figure i can use a bit of practice in my bash scripting, no matter what the future has in store for this firefox install script.
    Sounds like as good a reason as any other. Go for it!

  8. #8
    Join Date
    Jan 2006
    Location
    Philadelphia
    Beans
    4,073
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: firefox 1.5 installed via wiki howto

    Quote Originally Posted by aysiu
    Sounds like as good a reason as any other. Go for it!
    well, i went for it. here is the result:
    Code:
    #!/bin/bash
    check_exit_status () {
      if [ $? -ne 0 ]; then
        echo "Previous command did not complete successfully."
        exit 1
      fi
    }
    
    echo -e "Updating repositories list\n"
    sudo apt-get update
    check_exit_status
    
    echo -e "\nMaking sure libstdc++5 and the old Firefox are installed\n"
    sudo apt-get -y install firefox libstdc++5
    check_exit_status
    
    echo -e "\nBacking up old Firefox preferences\n"
    cp -R ~/.mozilla ~/.mozilla_backup
    check_exit_status
    
    echo -e "\nChanging to home directory\n"
    cd
    check_exit_status
    
    echo -e "\nDownloading Firefox from the Mozilla site\n"
    wget -c http://ftp-mozilla.netscape.com/pub/mozilla.org/firefox/releases/1.5.0.3/linux-i686/en-US/firefox-1.5.0.3.tar.gz
    check_exit_status
    
    echo -e "\nUnzipping the .tar.gz file\n"
    sudo tar -C /opt -x -z -v -f firefox-1.5.0.3.tar.gz
    check_exit_status
    
    echo -e "\nRemoving the unzipped .tar.gz\n"
    rm firefox-1.5.0.3.tar.gz
    check_exit_status
    
    echo -e "\nLinking plugins\n"
    cd /opt/firefox/plugins/
    sudo ln -s /usr/lib/mozilla-firefox/plugins/* .
    check_exit_status
    
    echo -e "\nLinking launcher to new Firefox\n"
    sudo dpkg-divert --divert /usr/bin/firefox.ubuntu --rename /usr/bin/firefox
    check_exit_status
    sudo ln -s /opt/firefox/firefox /usr/bin/firefox
    check_exit_status
    sudo dpkg-divert --divert /usr/bin/mozilla-firefox.ubuntu --rename /usr/bin/mozilla-firefox
    check_exit_status
    sudo ln -s /opt/firefox/firefox /usr/bin/mozilla-firefox
    check_exit_status
    
    echo -e "\nThe new Firefox has been installed successfully."
    
    exit
    basically, all i did was create a check_exit_status function that checks if the previous command has completed successfully, and invoked it after every command that the script performs.

    i also changed your multiline echo-s to single-line commands, by shoving in explicit \n-s and using "echo -e" so that they are interpreted correctly.

    feel free to post this on your website in replacement of your original script. (a credit to me would be appreciated. )

    and another note of warning - since my firefox new version is already installed, i did not actually run the script to test it - so it "may" have some undetected typos.
    Last edited by nanotube; May 25th, 2006 at 05:01 AM.

  9. #9
    Join Date
    May 2005
    Location
    US
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: firefox 1.5 installed via wiki howto

    Thanks, nanotube.

    I'm going to do some extensive testing on my test Ubuntu box before posting it.

    I also want to see if my uninstall script will work with your revised install script, too.

  10. #10
    Join Date
    Jan 2006
    Location
    Philadelphia
    Beans
    4,073
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: firefox 1.5 installed via wiki howto

    Quote Originally Posted by aysiu
    Thanks, nanotube.

    I'm going to do some extensive testing on my test Ubuntu box before posting it.

    I also want to see if my uninstall script will work with your revised install script, too.
    ah, testing is good. especially before passing it on to a bunch of unsuspecting users

    hm, the uninstall should work just as well, since no changes have been made to the "meat" of the install script. but i suppose it doesnt hurt to check...

Page 1 of 19 12311 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •