├── README.md ├── bits ├── base.png ├── box.png ├── create_firefox_image_with_version ├── fx-icon_source.psd ├── fx10.png ├── fx11.png ├── fx12.png ├── fx13.png ├── fx14.png ├── fx15.png ├── fx16.png ├── fx17.png ├── fx18.png ├── fx19.png ├── fx2.png ├── fx20.png ├── fx21.png ├── fx22.png ├── fx23.png ├── fx24.png ├── fx25.png ├── fx26.png ├── fx27.png ├── fx28.png ├── fx29.png ├── fx3-5.png ├── fx3-6.png ├── fx3.png ├── fx30.png ├── fx31.png ├── fx32.png ├── fx33.png ├── fx34.png ├── fx35.png ├── fx36.png ├── fx37.png ├── fx38.png ├── fx39.png ├── fx4.png ├── fx40.png ├── fx41.png ├── fx42.png ├── fx43.png ├── fx44.png ├── fx45.png ├── fx46.png ├── fx47.png ├── fx48.png ├── fx49.png ├── fx5.png ├── fx50.png ├── fx51.png ├── fx52.png ├── fx53.png ├── fx6.png ├── fx7.png ├── fx8.png ├── fx9.png ├── fxa.png ├── fxb.png ├── fxfirefox-folder.png ├── fxn.png ├── fxux.png └── setfileicon ├── bootstrap.sh ├── firefoxes.sh └── install-all-firefox.sh /README.md: -------------------------------------------------------------------------------- 1 | # This script is no longer supported 2 | 3 | ![](http://cl.ly/I8MM/by%20default%202012-07-18%20at%2010.35.56.png) 4 | ![](http://cl.ly/I8gZ/by%20default%202012-07-18%20at%2010.33.26.png) 5 | 6 | --- 7 | ## ABOUT 8 | 9 | This is a bash script to install all major versions of Firefox on OS X. 10 | 11 | Currently it installs: 12 | 13 | - Firefox 2.0.0.20 14 | - Firefox 3.0.19 15 | - Firefox 3.5.19 16 | - Firefox 3.6.28 17 | - All version from 4.0.1 to latest version on rolling release 18 | 19 | Optionally, the script can install Firebug for each version of Firefox too. 20 | 21 | ### What does it do? 22 | 23 | 1. The `firefoxes.sh` script downloads the latest version of `install-all-firefox.sh` beforerunning to ensure that the script is up to date. 24 | 25 | 2. The script downloads all of the associated resources (icons) and utilities (seticon) to the `/tmp/firefoxes` directory. 26 | 27 | 3. The script downloads the `.dmg` files from Mozilla's server into `/tmp/firefoxes`. 28 | 29 | 4. The script installs the Firefoxes to `/Applications/Firefoxes/`. 30 | 31 | 5. The script creates a Firefox profile for each installed version of Firefox. 32 | 33 | 6. The script modifies each Firefox app to launch with its specific profile, and customises the application icon. 34 | 35 | 7. The script can optionally download the latest Firebug available for each version of Firefox, and install it upon first launch. 36 | 37 | ### What else does it do? 38 | 39 | You can see which versions of Firefox you've already installed using this script, using the following command: 40 | 41 | ```bash 42 | $ ./firefoxes.sh 43 | ``` 44 | 45 | or 46 | 47 | ```bash 48 | $ ./firefoxes.sh status 49 | ``` 50 | 51 | You can specify the `version` to install, or use any of the pre-defined installation groups: 52 | 53 | ```bash 54 | # Default, installs all versions available 55 | $ ./firefoxes.sh 56 | 57 | # You can also use the 'all' keyword to install all versions available 58 | $ ./firefoxes.sh "all" 59 | 60 | # 'current' installs the current version of Firefox only (other allowed keywords: 'newest', 'latest') 61 | $ ./firefoxes.sh "current" 62 | $ ./firefoxes.sh "newest" 63 | $ ./firefoxes.sh "latest" 64 | 65 | # 'min_point_one', 'min_point_two', 'min_point_three', 'min_point_four' 66 | # install versions with at least 0.1%, 0.2%, 0.3% or 0.4% global usage share, respectively 67 | $ ./firefoxes.sh "min_point_one" 68 | $ ./firefoxes.sh "min_point_two" 69 | 70 | # Specify the versions you would like to install, from the list at the top of this README, separated by spaces 71 | # New: You can now use shorthand for versions, such as: 2, 3, 3.5, 10, 24, etc. 72 | $ ./firefoxes.sh "2 3" 73 | ``` 74 | 75 | Usage share options are based on data from [StatCounter's global statistics](http://gs.statcounter.com) for April 2014. 76 | 77 | You can specify the `locale` to use, from the list of available `locale` options. By default `en-GB` is used. 78 | 79 | ``` 80 | af, ar, be , bg, ca, cs, da, de, el, en-GB, en-US, es-AR, es-ES, eu, fi, fr, 81 | fy-NL, ga-IE, he, hu, it, ja-JP-mac, ko, ku, lt, mk, mn, nb-NO, nl, nn-NO, 82 | pa-IN, pl, pt-BR, pt-PT, ro, ru, sk, sl, sv-SE, tr, uk, zh-CN, zh-TW 83 | ``` 84 | 85 | ```bash 86 | $ ./firefoxes.sh "all" "en-US" 87 | ``` 88 | 89 | If you want to just install all versions and leave the installation process unattended, there is a `no_prompt` option, this will default all of the `Y/n` prompts to answering `y`. 90 | 91 | ```bash 92 | $ ./firefoxes.sh "all" "en-GB" "no_prompt" 93 | ``` 94 | (You will still need to manually accept the EULA if installing Firefox 2.0.0.20) 95 | 96 | If you want to install to a different directory, pass that as the last option. Include a trailing slash. 97 | 98 | ```bash 99 | $ ./firefoxes.sh "all" "en-GB" "no_prompt" "/Users/myhomedir/Applications/" 100 | ``` 101 | 102 | --- 103 | ## INSTALLATION 104 | 105 | From a terminal prompt, enter the following: 106 | 107 | ```bash 108 | curl -L -O https://github.com/omgmog/install-all-firefox/raw/master/firefoxes.sh 109 | chmod +x firefoxes.sh 110 | ./firefoxes.sh [version] [locale] [no_prompt] [install_directory] 111 | ``` 112 | 113 | It'll take a little while to grab the `.dmg` files, but it should only need to do this once. 114 | (Until you reboot, and the contents of `/tmp` are deleted.) 115 | 116 | 117 | --- 118 | ## CONTRIBUTING 119 | If a new version of Firefox has been released but it's not yet here, feel free to add it and submit a pull request. You can even generate a new application icon using the `create_firefox_image_with_version` tool found in the [`bits`](https://github.com/omgmog/install-all-firefox/tree/master/bits) directory. 120 | 121 | ### Checklist when adding a new version 122 | You should only need to make changes in `install-all-firefox.sh` when adding a new version, and also generating a new `fx[version].png` in the `bits` directory. 123 | 124 | 1. Update `default_versions_current` 125 | 2. Update `default_versions_past` 126 | 3. Add a new version to the massive case statement in `get_associated_information()` 127 | 4. Ensure that we're using the correct/latest version of Firebug. The [Firebug blog](http://getfirebug.com/) is pretty good at mentioning which versions of Firefox are supported with each release. 128 | 5. Generate a new version icon: 129 | 130 | ```bash 131 | cd bits 132 | ./create_firefox_image_with_version "36.0" fx36.png 133 | ``` 134 | 135 | `create_firefox_image_with_version` uses ImageMagick's `convert` utility to composite the two base images together with text, so make sure you've got that installed first: 136 | 137 | ```bash 138 | $ brew install imagemagick gs 139 | ``` 140 | 141 | --- 142 | ## CREDITS 143 | - [setfileicon](http://maxao.free.fr/telechargements/setfileicon.m) is a utility created by Damien Bobillot (damien.bobillot.2002_setfileicon@m4x.org) http://maxao.free.fr/telechargements/setfileicon.gz 144 | - [Firebug](http://getfirebug.com/) 145 | - Thanks to the community for using/reporting issues/making suggestions for features! 146 | - Thanks to Lurst for his [`create_firefox_image_with_version`](https://github.com/LuRsT/create_firefox_image_with_version) tool. 147 | -------------------------------------------------------------------------------- /bits/base.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/base.png -------------------------------------------------------------------------------- /bits/box.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/box.png -------------------------------------------------------------------------------- /bits/create_firefox_image_with_version: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | in_text=$1 4 | out_image=$2 5 | 6 | # Position of text inside box 7 | TEXT_X_OFFSET="270" 8 | TEXT_Y_OFFSET="265" 9 | 10 | FONT_POINT_SIZE=120 11 | 12 | IN_ICON_BASE="base.png" 13 | IN_TEXT_CONTAINER="box.png" 14 | 15 | TMP_DIR="/tmp/" 16 | TMP_TEXT="${TMP_DIR}text.png" 17 | TMP_TEXT_SHADOW="${TMP_DIR}shadow.png" 18 | TMP_TEXT_CONTAINER="${TMP_DIR}text_box.png" 19 | 20 | 21 | # Check Arguments 22 | if [ -z $in_text ] || [ -z $out_image ]; then 23 | echo "Need more arguments. Expecting at least two arguments." 24 | echo "$ create_firefox_image_with_version " 25 | exit; 26 | fi 27 | 28 | 29 | # White text 30 | convert \ 31 | -background transparent \ 32 | -fill white \ 33 | -pointsize $FONT_POINT_SIZE \ 34 | label:$in_text \ 35 | $TMP_TEXT 36 | 37 | 38 | # Create text shadow 39 | convert \ 40 | -background transparent \ 41 | -fill black \ 42 | -pointsize $FONT_POINT_SIZE \ 43 | label:$in_text \ 44 | $TMP_TEXT_SHADOW 45 | 46 | convert $TMP_TEXT_SHADOW \ 47 | -gaussian-blur 5x5 \ 48 | $TMP_TEXT_SHADOW 49 | 50 | 51 | # Merge text shadow with white text 52 | convert $TMP_TEXT \ 53 | -colorize 0% \ 54 | miff:- | \ 55 | composite \ 56 | -dissolve 100 \ 57 | - $TMP_TEXT_SHADOW \ 58 | $TMP_TEXT 59 | 60 | 61 | # Insert text into box 62 | convert $TMP_TEXT \ 63 | -fill white \ 64 | -colorize 0% \ 65 | miff:- | \ 66 | composite \ 67 | -dissolve 100 \ 68 | -geometry +$TEXT_X_OFFSET+$TEXT_Y_OFFSET \ 69 | - $IN_TEXT_CONTAINER \ 70 | $TMP_TEXT_CONTAINER 71 | 72 | 73 | # Insert box into base image 74 | convert $TMP_TEXT_CONTAINER \ 75 | -fill white \ 76 | -colorize 0% \ 77 | miff:- | \ 78 | composite \ 79 | -dissolve 100 \ 80 | -gravity southeast \ 81 | - $IN_ICON_BASE \ 82 | $out_image 83 | 84 | 85 | # Clean up 86 | rm $TMP_TEXT 87 | rm $TMP_TEXT_SHADOW 88 | rm $TMP_TEXT_CONTAINER 89 | -------------------------------------------------------------------------------- /bits/fx-icon_source.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx-icon_source.psd -------------------------------------------------------------------------------- /bits/fx10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx10.png -------------------------------------------------------------------------------- /bits/fx11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx11.png -------------------------------------------------------------------------------- /bits/fx12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx12.png -------------------------------------------------------------------------------- /bits/fx13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx13.png -------------------------------------------------------------------------------- /bits/fx14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx14.png -------------------------------------------------------------------------------- /bits/fx15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx15.png -------------------------------------------------------------------------------- /bits/fx16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx16.png -------------------------------------------------------------------------------- /bits/fx17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx17.png -------------------------------------------------------------------------------- /bits/fx18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx18.png -------------------------------------------------------------------------------- /bits/fx19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx19.png -------------------------------------------------------------------------------- /bits/fx2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx2.png -------------------------------------------------------------------------------- /bits/fx20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx20.png -------------------------------------------------------------------------------- /bits/fx21.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx21.png -------------------------------------------------------------------------------- /bits/fx22.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx22.png -------------------------------------------------------------------------------- /bits/fx23.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx23.png -------------------------------------------------------------------------------- /bits/fx24.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx24.png -------------------------------------------------------------------------------- /bits/fx25.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx25.png -------------------------------------------------------------------------------- /bits/fx26.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx26.png -------------------------------------------------------------------------------- /bits/fx27.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx27.png -------------------------------------------------------------------------------- /bits/fx28.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx28.png -------------------------------------------------------------------------------- /bits/fx29.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx29.png -------------------------------------------------------------------------------- /bits/fx3-5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx3-5.png -------------------------------------------------------------------------------- /bits/fx3-6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx3-6.png -------------------------------------------------------------------------------- /bits/fx3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx3.png -------------------------------------------------------------------------------- /bits/fx30.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx30.png -------------------------------------------------------------------------------- /bits/fx31.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx31.png -------------------------------------------------------------------------------- /bits/fx32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx32.png -------------------------------------------------------------------------------- /bits/fx33.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx33.png -------------------------------------------------------------------------------- /bits/fx34.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx34.png -------------------------------------------------------------------------------- /bits/fx35.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx35.png -------------------------------------------------------------------------------- /bits/fx36.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx36.png -------------------------------------------------------------------------------- /bits/fx37.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx37.png -------------------------------------------------------------------------------- /bits/fx38.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx38.png -------------------------------------------------------------------------------- /bits/fx39.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx39.png -------------------------------------------------------------------------------- /bits/fx4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx4.png -------------------------------------------------------------------------------- /bits/fx40.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx40.png -------------------------------------------------------------------------------- /bits/fx41.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx41.png -------------------------------------------------------------------------------- /bits/fx42.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx42.png -------------------------------------------------------------------------------- /bits/fx43.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx43.png -------------------------------------------------------------------------------- /bits/fx44.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx44.png -------------------------------------------------------------------------------- /bits/fx45.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx45.png -------------------------------------------------------------------------------- /bits/fx46.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx46.png -------------------------------------------------------------------------------- /bits/fx47.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx47.png -------------------------------------------------------------------------------- /bits/fx48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx48.png -------------------------------------------------------------------------------- /bits/fx49.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx49.png -------------------------------------------------------------------------------- /bits/fx5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx5.png -------------------------------------------------------------------------------- /bits/fx50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx50.png -------------------------------------------------------------------------------- /bits/fx51.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx51.png -------------------------------------------------------------------------------- /bits/fx52.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx52.png -------------------------------------------------------------------------------- /bits/fx53.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx53.png -------------------------------------------------------------------------------- /bits/fx6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx6.png -------------------------------------------------------------------------------- /bits/fx7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx7.png -------------------------------------------------------------------------------- /bits/fx8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx8.png -------------------------------------------------------------------------------- /bits/fx9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fx9.png -------------------------------------------------------------------------------- /bits/fxa.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fxa.png -------------------------------------------------------------------------------- /bits/fxb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fxb.png -------------------------------------------------------------------------------- /bits/fxfirefox-folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fxfirefox-folder.png -------------------------------------------------------------------------------- /bits/fxn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fxn.png -------------------------------------------------------------------------------- /bits/fxux.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/fxux.png -------------------------------------------------------------------------------- /bits/setfileicon: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/omgmog/install-all-firefox/856eb0df33bcf463b5744037587a72bfccf9d60a/bits/setfileicon -------------------------------------------------------------------------------- /bootstrap.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | readonly PROGNAME=$(basename $0) 4 | 5 | main () { 6 | local remote_dir="https://raw.githubusercontent.com/omgmog/install-all-firefox/master/" 7 | local script_name="firefoxes.sh" 8 | local temp_dir="/tmp/" 9 | local remote_script="${remote_dir}${script_name}" 10 | local local_script="${temp_dir}${script_name}" 11 | local choice_made=0 12 | local current_dir="${PWD}/" 13 | 14 | echo -e "You should be using ${script_name} not ${PROGNAME}." 15 | echo -e "I'll download the new script for you now." 16 | 17 | if curl -L "${remote_script}" -o "${local_script}"; then 18 | 19 | echo -e "Successfully downloaded ${script_name} to ${local_script}" 20 | 21 | chmod +x "${local_script}" 22 | 23 | echo -e "Do you want to copy ${local_script} to your current directory?" 24 | read user_choice 25 | while [[ "${choice_made}" < 1 ]]; do 26 | 27 | case "$(echo ${user_choice} | tr '[:upper:]' '[:lower:]')" in 28 | "y" | "yes") 29 | choice_made=1 30 | echo -e "Copying ${script_name} to ${current_dir}" 31 | cp "${local_script}" "${current_dir}${script_name}" 32 | ;; 33 | "n" | "no") 34 | choice_made=1 35 | echo -e "Okay, I'll leave it in ${local_script}" 36 | ;; 37 | *) 38 | echo -e "Please enter 'y' or 'n'." 39 | read user_choice 40 | ;; 41 | esac 42 | done 43 | fi 44 | } 45 | 46 | main "$@" 47 | -------------------------------------------------------------------------------- /firefoxes.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | main () { 4 | local remote_dir="https://raw.githubusercontent.com/omgmog/install-all-firefox/master/" 5 | local temp_dir="/tmp/" 6 | local output_dir="${temp_dir}firefoxes/" 7 | local script_name="install-all-firefox.sh" 8 | local remote_script="${remote_dir}${script_name}" 9 | local local_script="${temp_dir}${script_name}" 10 | local script_output="${output_dir}${script_name}" 11 | local existing_script_md5="" 12 | local remote_script_md5="" 13 | 14 | if [[ "$(uname -s)" != "Darwin" ]]; then 15 | echo "This script is designed to be used on OS X only." 16 | echo "Exiting..." 17 | exit 1 18 | fi 19 | 20 | mkdir -p "${output_dir}" 21 | 22 | if [[ -e "${script_output}" ]]; then 23 | existing_script_md5="$(md5 -q "${script_output}")" 24 | fi 25 | 26 | if curl -L "${remote_script}" -o "${local_script}"; then 27 | remote_script_md5="$(md5 -q "${local_script}")" 28 | fi 29 | 30 | if [[ "${existing_script_md5}" != "${remote_script_md5}" ]]; then 31 | mv "${local_script}" "${script_output}" 32 | chmod +x "${script_output}" 33 | fi 34 | 35 | if [[ "$@" == "" ]]; then 36 | sh "${script_output}" "status" 37 | else 38 | sh "${script_output}" "$@" 39 | fi 40 | } 41 | 42 | main "$@" 43 | -------------------------------------------------------------------------------- /install-all-firefox.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | default_versions_current="53" 3 | 4 | past_00s="2 3 3.5 3.6 4 5 6 7 8 9" 5 | past_10s="10 11 12 13 14 15 16 17 18 19" 6 | past_20s="20 21 22 23 24 25 26 27 28 29" 7 | past_30s="30 31 32 33 34 35 36 37 38 39" 8 | past_40s="40 41 42 43 44 45 46 47 48 49" 9 | past_50s="50 51 52" 10 | 11 | default_versions_past="${past_00s} ${past_10s} ${past_20s} ${past_30s} ${past_40s} ${past_50s}" 12 | 13 | # Using data from http://gs.statcounter.com/ 14 | versions_usage_point_one="43 44 45 46 50" 15 | versions_usage_point_two="" 16 | versions_usage_point_three="" 17 | versions_usage_point_four_up="47 48" 18 | 19 | default_versions="${default_versions_past} ${default_versions_current}" 20 | tmp_directory="/tmp/firefoxes/" 21 | bits_host="https://raw.githubusercontent.com/omgmog/install-all-firefox/master/bits/" 22 | bits_directory="${tmp_directory}bits/" 23 | dmg_host="http://ftp.mozilla.org/pub/mozilla.org/firefox/" 24 | 25 | locale_default="en-US" 26 | 27 | # Don't edit below this line (unless you're adding new version cases in get_associated_information) 28 | 29 | versions="${1:-$default_versions}" 30 | release_directory="" 31 | dmg_file="" 32 | sum_file="" 33 | sum_file_type="" 34 | sum_of_dmg="" 35 | sum_expected="" 36 | binary="" 37 | short_name="" 38 | nice_name="" 39 | vol_name_default="Firefox" 40 | release_name_default="Firefox" 41 | release_type="" 42 | binary_folder="/Contents/MacOS/" 43 | uses_v2_signing=false 44 | 45 | specified_locale=$2 46 | 47 | if [[ "${3}" == "no_prompt" ]]; then 48 | no_prompt=true 49 | else 50 | no_prompt=false 51 | fi 52 | 53 | if [[ "${4}" == "" ]]; then 54 | install_directory="/Applications/Firefoxes/" 55 | else 56 | install_directory=$4 57 | install_directory_length=${#install_directory}-1 58 | if [ "${install_directory:install_directory_length}" != "/" ]; then 59 | install_directory="${install_directory}/" 60 | fi 61 | fi 62 | 63 | ask(){ 64 | while true; do 65 | if [ "${2:-}" = "Y" ]; then 66 | prompt="Y/n" 67 | default=Y 68 | elif [ "${2:-}" = "N" ]; then 69 | prompt="y/N" 70 | default=N 71 | else 72 | prompt="y/n" 73 | default= 74 | fi 75 | echo 76 | read -p "$1 [$prompt] " REPLY 77 | if [ -z "$REPLY" ]; then 78 | REPLY=$default 79 | fi 80 | case "$REPLY" in 81 | Y*|y*) return 0 ;; 82 | N*|n*) return 1 ;; 83 | esac 84 | done 85 | } 86 | 87 | get_associated_information(){ 88 | # Reset everything 89 | vol_name=$vol_name_default 90 | release_name=$release_name_default 91 | firebug_version="" 92 | 93 | case $1 in 94 | 2 | 2.0 | 2.0.0.20) 95 | release_directory="2.0.0.20" 96 | dmg_file="Firefox 2.0.0.20.dmg" 97 | sum_file="MD5SUMS" 98 | sum_file_type="md5" 99 | binary="firefox-bin" 100 | short_name="fx2" 101 | nice_name="Firefox 2.0" 102 | 103 | firebug_version="1.3.1" 104 | firebug_root="http://getfirebug.com/releases/firebug/1.3/" 105 | firebug_file="firebug-1.3.1.xpi" 106 | ;; 107 | 3 | 3.0 | 3.0.19) 108 | release_directory="3.0.19-real-real" 109 | dmg_file="Firefox 3.0.19.dmg" 110 | sum_file="MD5SUMS" 111 | sum_file_type="md5" 112 | binary="firefox-bin" 113 | short_name="fx3" 114 | nice_name="Firefox 3.0" 115 | 116 | firebug_version="1.3.4b2" 117 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 118 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 119 | firebug_file="firebug-${firebug_version}.xpi" 120 | ;; 121 | 3.5 | 3.5.19) 122 | release_directory="3.5.19" 123 | dmg_file="Firefox 3.5.19.dmg" 124 | sum_file="MD5SUMS" 125 | sum_file_type="md5" 126 | binary="firefox-bin" 127 | short_name="fx3-5" 128 | nice_name="Firefox 3.5" 129 | 130 | firebug_version="1.5.4" 131 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 132 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 133 | firebug_file="firebug-${firebug_version}.xpi" 134 | ;; 135 | 3.6 | 3.6.28) 136 | release_directory="3.6.28" 137 | dmg_file="Firefox 3.6.28.dmg" 138 | sum_file="MD5SUMS" 139 | sum_file_type="md5" 140 | binary="firefox-bin" 141 | short_name="fx3-6" 142 | nice_name="Firefox 3.6" 143 | 144 | firebug_version="1.7.3" 145 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 146 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 147 | firebug_file="firebug-${firebug_version}.xpi" 148 | ;; 149 | 4 | 4.0 | 4.0.1) 150 | release_directory="4.0.1" 151 | dmg_file="Firefox 4.0.1.dmg" 152 | sum_file="MD5SUMS" 153 | sum_file_type="md5" 154 | binary="firefox-bin" 155 | short_name="fx4" 156 | nice_name="Firefox 4.0" 157 | 158 | firebug_version="1.8.0b7" 159 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 160 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 161 | firebug_file="firebug-${firebug_version}.xpi" 162 | ;; 163 | 5 | 5.0 | 5.0.1) 164 | release_directory="5.0.1" 165 | dmg_file="Firefox 5.0.1.dmg" 166 | sum_file="MD5SUMS" 167 | sum_file_type="md5" 168 | binary="firefox-bin" 169 | short_name="fx5" 170 | nice_name="Firefox 5.0" 171 | 172 | firebug_version="1.9.2" 173 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 174 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 175 | firebug_file="firebug-${firebug_version}.xpi" 176 | ;; 177 | 6 | 6.0 | 6.0.2) 178 | release_directory="6.0.2" 179 | dmg_file="Firefox 6.0.2.dmg" 180 | sum_file="MD5SUMS" 181 | sum_file_type="md5" 182 | binary="firefox-bin" 183 | short_name="fx6" 184 | nice_name="Firefox 6.0" 185 | 186 | firebug_version="1.9.2" 187 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 188 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 189 | firebug_file="firebug-${firebug_version}.xpi" 190 | ;; 191 | 7 | 7.0 | 7.0.1) 192 | release_directory="7.0.1" 193 | dmg_file="Firefox 7.0.1.dmg" 194 | sum_file="MD5SUMS" 195 | sum_file_type="md5" 196 | binary="firefox" 197 | short_name="fx7" 198 | nice_name="Firefox 7.0" 199 | 200 | firebug_version="1.9.2" 201 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 202 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 203 | firebug_file="firebug-${firebug_version}.xpi" 204 | ;; 205 | 8 | 8.0 | 8.0.1) 206 | release_directory="8.0.1" 207 | dmg_file="Firefox 8.0.1.dmg" 208 | sum_file="MD5SUMS" 209 | sum_file_type="md5" 210 | binary="firefox" 211 | short_name="fx8" 212 | nice_name="Firefox 8.0" 213 | 214 | firebug_version="1.9.2" 215 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 216 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 217 | firebug_file="firebug-${firebug_version}.xpi" 218 | ;; 219 | 9 | 9.0 | 9.0.1) 220 | release_directory="9.0.1" 221 | dmg_file="Firefox 9.0.1.dmg" 222 | sum_file="MD5SUMS" 223 | sum_file_type="md5" 224 | binary="firefox" 225 | short_name="fx9" 226 | nice_name="Firefox 9.0" 227 | 228 | firebug_version="1.9.2" 229 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 230 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 231 | firebug_file="firebug-${firebug_version}.xpi" 232 | ;; 233 | 10 | 10.0 | 10.0.2) 234 | release_directory="10.0.2" 235 | dmg_file="Firefox 10.0.2.dmg" 236 | sum_file="MD5SUMS" 237 | sum_file_type="md5" 238 | binary="firefox" 239 | short_name="fx10" 240 | nice_name="Firefox 10.0" 241 | 242 | firebug_version="1.9.2" 243 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 244 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 245 | firebug_file="firebug-${firebug_version}.xpi" 246 | ;; 247 | 11 | 11.0) 248 | release_directory="11.0" 249 | dmg_file="Firefox 11.0.dmg" 250 | sum_file="MD5SUMS" 251 | sum_file_type="md5" 252 | binary="firefox" 253 | short_name="fx11" 254 | nice_name="Firefox 11.0" 255 | 256 | firebug_version="1.9.2" 257 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 258 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 259 | firebug_file="firebug-${firebug_version}.xpi" 260 | ;; 261 | 12 | 12.0) 262 | release_directory="12.0" 263 | dmg_file="Firefox 12.0.dmg" 264 | sum_file="MD5SUMS" 265 | sum_file_type="md5" 266 | binary="firefox" 267 | short_name="fx12" 268 | nice_name="Firefox 12.0" 269 | 270 | firebug_version="1.9.2" 271 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 272 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 273 | firebug_file="firebug-${firebug_version}.xpi" 274 | ;; 275 | 13 | 13.0 | 13.0.1) 276 | release_directory="13.0.1" 277 | dmg_file="Firefox 13.0.1.dmg" 278 | sum_file="MD5SUMS" 279 | sum_file_type="md5" 280 | binary="firefox" 281 | short_name="fx13" 282 | nice_name="Firefox 13.0" 283 | 284 | firebug_version="1.10.6" 285 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 286 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 287 | firebug_file="firebug-${firebug_version}.xpi" 288 | ;; 289 | 14 | 14.0 | 14.0.1) 290 | release_directory="14.0.1" 291 | dmg_file="Firefox 14.0.1.dmg" 292 | sum_file="MD5SUMS" 293 | sum_file_type="md5" 294 | binary="firefox" 295 | short_name="fx14" 296 | nice_name="Firefox 14.0" 297 | 298 | firebug_version="1.10.6" 299 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 300 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 301 | firebug_file="firebug-${firebug_version}.xpi" 302 | ;; 303 | 15 | 15.0 | 15.0.1) 304 | release_directory="15.0.1" 305 | dmg_file="Firefox 15.0.1.dmg" 306 | sum_file="MD5SUMS" 307 | sum_file_type="md5" 308 | binary="firefox" 309 | short_name="fx15" 310 | nice_name="Firefox 15.0" 311 | 312 | firebug_version="1.10.6" 313 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 314 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 315 | firebug_file="firebug-${firebug_version}.xpi" 316 | ;; 317 | 16 | 16.0 | 16.0.1) 318 | release_directory="16.0.1" 319 | dmg_file="Firefox 16.0.1.dmg" 320 | sum_file="MD5SUMS" 321 | sum_file_type="md5" 322 | binary="firefox" 323 | short_name="fx16" 324 | nice_name="Firefox 16.0" 325 | 326 | firebug_version="1.10.6" 327 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 328 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 329 | firebug_file="firebug-${firebug_version}.xpi" 330 | ;; 331 | 17 | 17.0 | 17.0.1) 332 | release_directory="17.0.1" 333 | dmg_file="Firefox 17.0.1.dmg" 334 | sum_file="MD5SUMS" 335 | sum_file_type="md5" 336 | binary="firefox" 337 | short_name="fx17" 338 | nice_name="Firefox 17.0" 339 | 340 | firebug_version="1.11.3" 341 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 342 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 343 | firebug_file="firebug-${firebug_version}.xpi" 344 | ;; 345 | 18 | 18.0 | 18.0.2) 346 | release_directory="18.0.2" 347 | dmg_file="Firefox 18.0.2.dmg" 348 | sum_file="MD5SUMS" 349 | sum_file_type="md5" 350 | binary="firefox" 351 | short_name="fx18" 352 | nice_name="Firefox 18.0" 353 | 354 | firebug_version="1.11.3" 355 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 356 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 357 | firebug_file="firebug-${firebug_version}.xpi" 358 | ;; 359 | 19 | 19.0 | 19.0.2) 360 | release_directory="19.0.2" 361 | dmg_file="Firefox 19.0.2.dmg" 362 | sum_file="MD5SUMS" 363 | sum_file_type="md5" 364 | binary="firefox" 365 | short_name="fx19" 366 | nice_name="Firefox 19.0" 367 | 368 | firebug_version="1.11.3" 369 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 370 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 371 | firebug_file="firebug-${firebug_version}.xpi" 372 | ;; 373 | 20 | 20.0) 374 | release_directory="20.0" 375 | dmg_file="Firefox 20.0.dmg" 376 | sum_file="MD5SUMS" 377 | sum_file_type="md5" 378 | binary="firefox" 379 | short_name="fx20" 380 | nice_name="Firefox 20.0" 381 | 382 | firebug_version="1.11.3" 383 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 384 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 385 | firebug_file="firebug-${firebug_version}.xpi" 386 | ;; 387 | 21 | 21.0) 388 | release_directory="21.0" 389 | dmg_file="Firefox 21.0.dmg" 390 | sum_file="MD5SUMS" 391 | sum_file_type="md5" 392 | binary="firefox" 393 | short_name="fx21" 394 | nice_name="Firefox 21.0" 395 | 396 | firebug_version="1.11.3" 397 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 398 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 399 | firebug_file="firebug-${firebug_version}.xpi" 400 | ;; 401 | 22 | 22.0) 402 | release_directory="22.0" 403 | dmg_file="Firefox 22.0.dmg" 404 | sum_file="MD5SUMS" 405 | sum_file_type="md5" 406 | binary="firefox" 407 | short_name="fx22" 408 | nice_name="Firefox 22.0" 409 | 410 | firebug_version="1.11.3" 411 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 412 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 413 | firebug_file="firebug-${firebug_version}.xpi" 414 | ;; 415 | 23 | 23.0 | 23.0.1) 416 | release_directory="23.0.1" 417 | dmg_file="Firefox 23.0.1.dmg" 418 | sum_file="MD5SUMS" 419 | sum_file_type="md5" 420 | binary="firefox" 421 | short_name="fx23" 422 | nice_name="Firefox 23.0" 423 | 424 | firebug_version="1.12.0" 425 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 426 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 427 | firebug_file="firebug-${firebug_version}.xpi" 428 | ;; 429 | 24 | 24.0) 430 | release_directory="24.0" 431 | dmg_file="Firefox 24.0.dmg" 432 | sum_file="MD5SUMS" 433 | sum_file_type="md5" 434 | binary="firefox" 435 | short_name="fx24" 436 | nice_name="Firefox 24.0" 437 | 438 | firebug_version="1.12.0" 439 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 440 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 441 | firebug_file="firebug-${firebug_version}.xpi" 442 | ;; 443 | 25 | 25.0 | 25.0.1) 444 | release_directory="25.0.1" 445 | dmg_file="Firefox 25.0.1.dmg" 446 | sum_file="MD5SUMS" 447 | sum_file_type="md5" 448 | binary="firefox" 449 | short_name="fx25" 450 | nice_name="Firefox 25.0" 451 | 452 | firebug_version="1.12.0" 453 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 454 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 455 | firebug_file="firebug-${firebug_version}.xpi" 456 | ;; 457 | 26 | 26.0) 458 | release_directory="26.0" 459 | dmg_file="Firefox 26.0.dmg" 460 | sum_file="MD5SUMS" 461 | sum_file_type="md5" 462 | binary="firefox" 463 | short_name="fx26" 464 | nice_name="Firefox 26.0" 465 | 466 | firebug_version="1.12.0" 467 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 468 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 469 | firebug_file="firebug-${firebug_version}.xpi" 470 | ;; 471 | 27 | 27.0 | 27.0.1) 472 | release_directory="27.0.1" 473 | dmg_file="Firefox 27.0.1.dmg" 474 | sum_file="MD5SUMS" 475 | sum_file_type="md5" 476 | binary="firefox" 477 | short_name="fx27" 478 | nice_name="Firefox 27.0" 479 | 480 | firebug_version="1.12.0" 481 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 482 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 483 | firebug_file="firebug-${firebug_version}.xpi" 484 | ;; 485 | 28 | 28.0) 486 | release_directory="28.0" 487 | dmg_file="Firefox 28.0.dmg" 488 | sum_file="MD5SUMS" 489 | sum_file_type="md5" 490 | binary="firefox" 491 | short_name="fx28" 492 | nice_name="Firefox 28.0" 493 | 494 | firebug_version="1.12.0" 495 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 496 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 497 | firebug_file="firebug-${firebug_version}.xpi" 498 | ;; 499 | 29 | 29.0 | 29.0.1) 500 | release_directory="29.0.1" 501 | dmg_file="Firefox 29.0.1.dmg" 502 | sum_file="MD5SUMS" 503 | sum_file_type="md5" 504 | binary="firefox" 505 | short_name="fx29" 506 | nice_name="Firefox 29.0" 507 | 508 | firebug_version="1.12.0" 509 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 510 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 511 | firebug_file="firebug-${firebug_version}.xpi" 512 | ;; 513 | 30 | 30.0) 514 | release_directory="30.0" 515 | dmg_file="Firefox 30.0.dmg" 516 | sum_file="MD5SUMS" 517 | sum_file_type="md5" 518 | binary="firefox" 519 | short_name="fx30" 520 | nice_name="Firefox 30.0" 521 | 522 | firebug_version="2.0.6" 523 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 524 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 525 | firebug_file="firebug-${firebug_version}.xpi" 526 | ;; 527 | 31 | 31.0) 528 | release_directory="31.0" 529 | dmg_file="Firefox 31.0.dmg" 530 | sum_file="MD5SUMS" 531 | sum_file_type="md5" 532 | binary="firefox" 533 | short_name="fx31" 534 | nice_name="Firefox 31.0" 535 | 536 | firebug_version="2.0.6" 537 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 538 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 539 | firebug_file="firebug-${firebug_version}.xpi" 540 | ;; 541 | 32 | 32.0) 542 | release_directory="32.0" 543 | dmg_file="Firefox 32.0.dmg" 544 | sum_file="MD5SUMS" 545 | sum_file_type="md5" 546 | binary="firefox" 547 | short_name="fx32" 548 | nice_name="Firefox 32.0" 549 | 550 | firebug_version="2.0.6" 551 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 552 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 553 | firebug_file="firebug-${firebug_version}.xpi" 554 | ;; 555 | 33 | 33.0 | 33.1 | 33.1.1) 556 | release_directory="33.1.1" 557 | dmg_file="Firefox 33.1.1.dmg" 558 | sum_file="MD5SUMS" 559 | sum_file_type="md5" 560 | binary="firefox" 561 | short_name="fx33" 562 | nice_name="Firefox 33.0" 563 | 564 | firebug_version="2.0.6" 565 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 566 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 567 | firebug_file="firebug-${firebug_version}.xpi" 568 | ;; 569 | 34 | 34.0) 570 | release_directory="34.0" 571 | dmg_file="Firefox 34.0.dmg" 572 | sum_file="MD5SUMS" 573 | sum_file_type="md5" 574 | binary="firefox" 575 | short_name="fx34" 576 | nice_name="Firefox 34.0" 577 | 578 | uses_v2_signing=true 579 | 580 | firebug_version="2.0.6" 581 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 582 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 583 | firebug_file="firebug-${firebug_version}.xpi" 584 | ;; 585 | 35 | 35.0 | 35.0.1) 586 | release_directory="35.0.1" 587 | dmg_file="Firefox 35.0.1.dmg" 588 | sum_file="MD5SUMS" 589 | sum_file_type="md5" 590 | binary="firefox" 591 | short_name="fx35" 592 | nice_name="Firefox 35.0" 593 | 594 | uses_v2_signing=true 595 | 596 | firebug_version="2.0.6" 597 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 598 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 599 | firebug_file="firebug-${firebug_version}.xpi" 600 | ;; 601 | 36 | 36.0) 602 | release_directory="36.0" 603 | dmg_file="Firefox 36.0.dmg" 604 | sum_file="MD5SUMS" 605 | sum_file_type="md5" 606 | binary="firefox" 607 | short_name="fx36" 608 | nice_name="Firefox 36.0" 609 | 610 | uses_v2_signing=true 611 | 612 | firebug_version="2.0.6" 613 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 614 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 615 | firebug_file="firebug-${firebug_version}.xpi" 616 | ;; 617 | 37 | 37.0) 618 | release_directory="37.0" 619 | dmg_file="Firefox 37.0.dmg" 620 | sum_file="MD5SUMS" 621 | sum_file_type="md5" 622 | binary="firefox" 623 | short_name="fx37" 624 | nice_name="Firefox 37.0" 625 | 626 | uses_v2_signing=true 627 | 628 | firebug_version="2.0.8" 629 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 630 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 631 | firebug_file="firebug-${firebug_version}.xpi" 632 | ;; 633 | 38 | 38.0) 634 | release_directory="38.0" 635 | dmg_file="Firefox 38.0.dmg" 636 | sum_file="MD5SUMS" 637 | sum_file_type="md5" 638 | binary="firefox" 639 | short_name="fx38" 640 | nice_name="Firefox 38.0" 641 | 642 | uses_v2_signing=true 643 | 644 | firebug_version="2.0.9" 645 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 646 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 647 | firebug_file="firebug-${firebug_version}.xpi" 648 | ;; 649 | 39 | 39.0) 650 | release_directory="39.0.3" 651 | dmg_file="Firefox 39.0.3.dmg" 652 | sum_file="MD5SUMS" 653 | sum_file_type="md5" 654 | binary="firefox" 655 | short_name="fx39" 656 | nice_name="Firefox 39.0" 657 | 658 | uses_v2_signing=true 659 | 660 | firebug_version="2.0.11" 661 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 662 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 663 | firebug_file="firebug-${firebug_version}.xpi" 664 | ;; 665 | 40 | 40.0) 666 | release_directory="40.0.3" 667 | dmg_file="Firefox 40.0.3.dmg" 668 | sum_file="MD5SUMS" 669 | sum_file_type="md5" 670 | binary="firefox" 671 | short_name="fx40" 672 | nice_name="Firefox 40.0" 673 | 674 | uses_v2_signing=true 675 | 676 | firebug_version="2.0.12" 677 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 678 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 679 | firebug_file="firebug-${firebug_version}.xpi" 680 | ;; 681 | 41 | 41.0) 682 | release_directory="41.0" 683 | dmg_file="Firefox 41.0.dmg" 684 | sum_file="MD5SUMS" 685 | sum_file_type="md5" 686 | binary="firefox" 687 | short_name="fx41" 688 | nice_name="Firefox 41.0" 689 | 690 | uses_v2_signing=true 691 | 692 | firebug_version="2.0.12" 693 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 694 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 695 | firebug_file="firebug-${firebug_version}.xpi" 696 | ;; 697 | 42 | 42.0) 698 | release_directory="42.0" 699 | dmg_file="Firefox 42.0.dmg" 700 | sum_file="MD5SUMS" 701 | sum_file_type="md5" 702 | binary="firefox" 703 | short_name="fx42" 704 | nice_name="Firefox 42.0" 705 | 706 | uses_v2_signing=true 707 | 708 | firebug_version="2.0.13" 709 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 710 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 711 | firebug_file="firebug-${firebug_version}.xpi" 712 | ;; 713 | 43 | 43.0) 714 | release_directory="43.0" 715 | dmg_file="Firefox 43.0.dmg" 716 | sum_file="MD5SUMS" 717 | sum_file_type="md5" 718 | binary="firefox" 719 | short_name="fx43" 720 | nice_name="Firefox 43.0" 721 | 722 | uses_v2_signing=true 723 | 724 | firebug_version="2.0.13" 725 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 726 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 727 | firebug_file="firebug-${firebug_version}.xpi" 728 | ;; 729 | 44 | 44.0) 730 | release_directory="44.0" 731 | dmg_file="Firefox 44.0.dmg" 732 | sum_file="MD5SUMS" 733 | sum_file_type="md5" 734 | binary="firefox" 735 | short_name="fx44" 736 | nice_name="Firefox 44.0" 737 | 738 | uses_v2_signing=true 739 | 740 | firebug_version="2.0.13" 741 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 742 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 743 | firebug_file="firebug-${firebug_version}.xpi" 744 | ;; 745 | 45 | 45.0) 746 | release_directory="45.0" 747 | dmg_file="Firefox 45.0.dmg" 748 | sum_file="MD5SUMS" 749 | sum_file_type="md5" 750 | binary="firefox" 751 | short_name="fx45" 752 | nice_name="Firefox 45.0" 753 | 754 | uses_v2_signing=true 755 | 756 | firebug_version="2.0.14" 757 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 758 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 759 | firebug_file="firebug-${firebug_version}.xpi" 760 | ;; 761 | 46 | 46.0) 762 | release_directory="46.0" 763 | dmg_file="Firefox 46.0.dmg" 764 | sum_file="MD5SUMS" 765 | sum_file_type="md5" 766 | binary="firefox" 767 | short_name="fx46" 768 | nice_name="Firefox 46.0" 769 | 770 | uses_v2_signing=true 771 | 772 | firebug_version="2.0.16" 773 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 774 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 775 | firebug_file="firebug-${firebug_version}.xpi" 776 | ;; 777 | 47 | 47.0) 778 | release_directory="47.0" 779 | dmg_file="Firefox 47.0.dmg" 780 | sum_file="MD5SUMS" 781 | sum_file_type="md5" 782 | binary="firefox" 783 | short_name="fx47" 784 | nice_name="Firefox 47.0" 785 | 786 | uses_v2_signing=true 787 | 788 | firebug_version="2.0.17" 789 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 790 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 791 | firebug_file="firebug-${firebug_version}.xpi" 792 | ;; 793 | 48 | 48.0) 794 | release_directory="48.0" 795 | dmg_file="Firefox 48.0.dmg" 796 | sum_file="MD5SUMS" 797 | sum_file_type="md5" 798 | binary="firefox" 799 | short_name="fx48" 800 | nice_name="Firefox 48.0" 801 | 802 | uses_v2_signing=true 803 | 804 | firebug_version="2.0.17" 805 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 806 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 807 | firebug_file="firebug-${firebug_version}.xpi" 808 | ;; 809 | 49 | 49.0) 810 | release_directory="49.0" 811 | dmg_file="Firefox 49.0.dmg" 812 | sum_file="MD5SUMS" 813 | sum_file_type="md5" 814 | binary="firefox" 815 | short_name="fx49" 816 | nice_name="Firefox 49.0" 817 | 818 | uses_v2_signing=true 819 | 820 | firebug_version="2.0.17" 821 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 822 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 823 | firebug_file="firebug-${firebug_version}.xpi" 824 | ;; 825 | 50 | 50.0) 826 | release_directory="50.0" 827 | dmg_file="Firefox 50.0.dmg" 828 | sum_file="MD5SUMS" 829 | sum_file_type="md5" 830 | binary="firefox" 831 | short_name="fx50" 832 | nice_name="Firefox 50.0" 833 | 834 | uses_v2_signing=true 835 | 836 | firebug_version="2.0.18" 837 | firebug_version_short=$(echo "${firebug_version}" | sed 's/\.[0-9a-zA-Z]*$//') 838 | firebug_root="http://getfirebug.com/releases/firebug/${firebug_version_short}/" 839 | firebug_file="firebug-${firebug_version}.xpi" 840 | ;; 841 | 51 | 51.0) 842 | release_directory="51.0" 843 | dmg_file="Firefox 51.0.dmg" 844 | sum_file="MD5SUMS" 845 | sum_file_type="md5" 846 | binary="firefox" 847 | short_name="fx51" 848 | nice_name="Firefox 51.0" 849 | 850 | uses_v2_signing=true 851 | ;; 852 | 52 | 52.0) 853 | release_directory="52.0" 854 | dmg_file="Firefox 52.0.dmg" 855 | sum_file="MD5SUMS" 856 | sum_file_type="md5" 857 | binary="firefox" 858 | short_name="fx52" 859 | nice_name="Firefox 52.0" 860 | 861 | uses_v2_signing=true 862 | ;; 863 | 53 | 53.0 | 53.0.3) 864 | release_directory="53.0.3" 865 | dmg_file="Firefox 53.0.3.dmg" 866 | sum_file="MD5SUMS" 867 | sum_file_type="md5" 868 | binary="firefox" 869 | short_name="fx53" 870 | nice_name="Firefox 53.0" 871 | 872 | uses_v2_signing=true 873 | ;; 874 | *) 875 | error " Invalid version specified!\n\n Please choose one of:\n all current $default_versions\n\n" 876 | error " To see which versions you have installed, type:\n ./firefoxes.sh status" 877 | exit 1 878 | ;; 879 | esac 880 | } 881 | setup_dirs(){ 882 | if [[ ! -d "$tmp_directory" ]]; then 883 | mkdir -p "$tmp_directory" 884 | fi 885 | if [[ ! -d "$bits_directory" ]]; then 886 | mkdir -p "$bits_directory" 887 | fi 888 | if [[ ! -d "$install_directory" ]]; then 889 | mkdir -p "$install_directory" 890 | fi 891 | } 892 | get_bits(){ 893 | log "Downloading bits" 894 | current_dir=$(pwd) 895 | cd "$bits_directory" 896 | if [[ ! -f "setfileicon" ]]; then 897 | curl -C - -L --progress-bar "${bits_host}setfileicon" -o "setfileicon" 898 | chmod +x setfileicon 899 | fi 900 | if [[ ! -f "${short_name}.png" ]]; then 901 | new_icon="true" 902 | icon_file="${current_dir}/bits/${short_name}.png" 903 | if [[ -f $icon_file ]]; then 904 | cp -r $icon_file "${short_name}.png" 905 | else 906 | curl -C - -L --progress-bar "${bits_host}${short_name}.png" -o "${short_name}.png" 907 | fi 908 | fi 909 | if [[ ! -f "${short_name}.icns" || $new_icon == "true" ]]; then 910 | sips -s format icns "${short_name}.png" --out "${short_name}.icns" &> /dev/null 911 | fi 912 | if [[ ! -f "${install_directory}{$nice_name}.app/Icon" ]]; then 913 | if [[ ! -f "fxfirefox-folder.png" ]]; then 914 | curl -C - -L --progress-bar "${bits_host}fxfirefox-folder.png" -o "fxfirefox-folder.png" 915 | fi 916 | if [[ ! -f "fxfirefox-folder.icns" ]]; then 917 | sips -s format icns "fxfirefox-folder.png" --out "fxfirefox-folder.icns" &> /dev/null 918 | fi 919 | ./setfileicon "fxfirefox-folder.icns" "${install_directory}" 920 | fi 921 | } 922 | check_dmg(){ 923 | if [[ ! -f "${tmp_directory}/${dmg_file}" ]]; then 924 | log "Downloading ${dmg_file}" 925 | download_dmg 926 | else 927 | get_sum_file 928 | case $sum_file_type in 929 | md5) 930 | sum_of_dmg=$(md5 -q "${tmp_directory}${dmg_file}") 931 | sum_expected=$(cat "${sum_file}-${short_name}" | grep "${locale}/${dmg_file}" | cut -c 1-32) 932 | ;; 933 | sha512) 934 | sum_of_dmg=$(openssl dgst -sha512 "${tmp_directory}${dmg_file}" | sed "s/^.*\(.\{128\}\)$/\1/") 935 | sum_expected=$(cat "${sum_file}-${short_name}" | grep "${sum_of_dmg}" | cut -c 1-128) 936 | ;; 937 | *) 938 | error "✖ Invalid sum type specified!" 939 | ;; 940 | esac 941 | if [[ "${sum_expected}" == *"${sum_of_dmg}"* ]]; then 942 | log "✔ ${sum_file_type} of ${dmg_file} matches" 943 | else 944 | error "✖ ${sum_file_type} of ${dmg_file} doesn't match!" 945 | log "Redownloading.\n" 946 | download_dmg 947 | fi 948 | fi 949 | } 950 | get_sum_file(){ 951 | cd "${tmp_directory}" 952 | curl -C - -L --progress-bar "${ftp_root}${sum_file_folder}${sum_file}" -o "${sum_file}-${short_name}" 953 | } 954 | download_dmg(){ 955 | cd "${tmp_directory}" 956 | dmg_file_safe=$(echo "${dmg_file}" | sed 's/ /\%20/g') 957 | dmg_url="${dmg_host}releases/${release_directory}/mac/$locale/${dmg_file_safe}" 958 | log "Downloading from ${dmg_url}" 959 | if ! curl -C - -L --progress-bar "${dmg_url}" -o "${dmg_file}" 960 | then 961 | error "✖ Failed to download ${dmg_file}!" 962 | fi 963 | } 964 | download_firebug(){ 965 | cd "${tmp_directory}" 966 | if [[ ! -f "${firebug_file}" ]]; then 967 | log "Downloading Firebug ${firebug_version}" 968 | if ! curl -C - -L --progress-bar "${firebug_root}${firebug_file}" -o "${firebug_file}" 969 | then 970 | error "✖ Failed to download ${firebug_file}" 971 | else 972 | log "✔ Downloaded ${firebug_file}" 973 | fi 974 | fi 975 | } 976 | prompt_firebug(){ 977 | # Only do anything if we've got a firebug version 978 | if [[ "${firebug_version}" != "" ]]; then 979 | if [ ${no_prompt} == false ]; then 980 | if ask "Install Firebug ${firebug_version} for ${nice_name}?" Y; then 981 | download_firebug 982 | install_firebug 983 | fi 984 | else 985 | download_firebug 986 | install_firebug 987 | fi 988 | fi 989 | } 990 | install_firebug(){ 991 | if [[ -f "${install_directory}${nice_name}.app${binary_folder}${binary}" ]]; then 992 | is_legacy="false" 993 | if [ "${short_name}" == "fx2" -o "${short_name}" == "fx3" -o "${short_name}" == "fx3-5" -o "${short_name}" == "fx3-6" ]; then 994 | is_legacy="true" 995 | fi 996 | if [ "${is_legacy}" == "true" ]; then 997 | ext_dir=$(cd $HOME/Library/Application\ Support/Firefox/Profiles/;cd $(ls -1 | grep ${short_name}); pwd) 998 | else 999 | if [ "${uses_v2_signing}" == "true" ];then 1000 | ext_dir="${install_directory}${nice_name}.app/Contents/Resources/" 1001 | else 1002 | ext_dir="${install_directory}${nice_name}.app${binary_folder}" 1003 | fi 1004 | fi 1005 | cd "${ext_dir}" 1006 | if [ "${is_legacy}" != "true" ]; then 1007 | if [[ ! -d "distribution" ]]; then 1008 | mkdir "distribution" 1009 | fi 1010 | cd "distribution" 1011 | fi 1012 | if [[ ! -d "extensions" ]]; then 1013 | mkdir "extensions" 1014 | fi 1015 | cd "extensions" 1016 | ext_dir=$(pwd) 1017 | if [[ "${is_legacy}" == "true" ]]; then 1018 | cp -r "${tmp_directory}${firebug_file}" "${ext_dir}" 1019 | else 1020 | unzip -qqo "${tmp_directory}${firebug_file}" -d "${tmp_directory}${firebug_version}" 1021 | cd "${tmp_directory}${firebug_version}" 1022 | FILE="$(cat install.rdf)" 1023 | for i in $FILE;do 1024 | if echo "$i"|grep "urn:mozilla:install-manifest" &> /dev/null ; then 1025 | GET="true" 1026 | fi 1027 | if [ "$GET" = "true" ] ; then 1028 | if echo "$i"|grep "" &> /dev/null; then 1029 | ID=$(echo "$i" | sed 's#.*\(.*\).*#\1#') 1030 | GET="false" 1031 | elif echo "$i"|grep "em:id=\"" &> /dev/null; then 1032 | ID=$(echo "$i" | sed 's/.*em:id="\(.*\)".*/\1/') 1033 | GET="false" 1034 | fi 1035 | fi 1036 | done 1037 | cd .. 1038 | mv "${firebug_version}" "${ext_dir}/${ID}/" 1039 | fi 1040 | log "✔ Installed Firebug ${firebug_version}" 1041 | else 1042 | error "${nice_name} not installed so we can't install Firebug ${firebug_version}!" 1043 | fi 1044 | } 1045 | mount_dmg(){ 1046 | echo Y | PAGER=true hdiutil attach -plist -nobrowse -readonly -quiet "${dmg_file}" > /dev/null 1047 | } 1048 | unmount_dmg(){ 1049 | if [[ -d "/Volumes/${vol_name}" ]]; then 1050 | hdiutil detach "/Volumes/${vol_name}" -force > /dev/null 1051 | fi 1052 | } 1053 | install_app(){ 1054 | if [[ -d "${install_directory}${nice_name}.app" ]]; then 1055 | 1056 | if [ ${no_prompt} == false ]; then 1057 | if ask "Delete your existing ${nice_name}.app and reinstall?" Y; then 1058 | log "Reinstalling ${nice_name}.app" 1059 | remove_app 1060 | process_install 1061 | else 1062 | log "Skipping reinstallation of ${nice_name}.app" 1063 | fi 1064 | else 1065 | remove_app 1066 | process_install 1067 | fi 1068 | else 1069 | process_install 1070 | fi 1071 | } 1072 | remove_app(){ 1073 | if rm -rf "${install_directory}${nice_name}.app" 1074 | then 1075 | log "✔ Removed ${install_directory}${nice_name}.app" 1076 | else 1077 | error "✖ Could not remove ${install_directory}${nice_name}.app!" 1078 | fi 1079 | } 1080 | process_install(){ 1081 | cd "/Volumes/${vol_name}" 1082 | if cp -r "${release_name}.app/" "${install_directory}${nice_name}.app/" 1083 | then 1084 | log "✔ Installed ${nice_name}.app" 1085 | else 1086 | unmount_dmg 1087 | error "✖ Could not install ${nice_name}.app!" 1088 | fi 1089 | unmount_dmg 1090 | create_profile 1091 | modify_launcher 1092 | install_complete 1093 | } 1094 | create_profile(){ 1095 | if exec "${install_directory}${nice_name}.app${binary_folder}${binary}" -CreateProfile "${short_name}" &> /dev/null & 1096 | then 1097 | log "✔ Created profile '${short_name}' for ${nice_name}" 1098 | else 1099 | error "✖ Could not create profile '${short_name}' for ${nice_name}" 1100 | fi 1101 | } 1102 | modify_launcher(){ 1103 | plist_old="${install_directory}${nice_name}.app/Contents/Info.plist" 1104 | plist_new="${tmp_directory}Info.plist" 1105 | sed -e "s/${binary}/${binary}-af/g" "${plist_old}" > "${plist_new}" 1106 | mv "${plist_new}" "${plist_old}" 1107 | 1108 | # No indentation while catting 1109 | cat > "${install_directory}${nice_name}.app${binary_folder}${binary}-af" < "${prefs_file}" < "${config_file}" < "fr-FR" 1193 | cleaned_specified_locale=$(echo ${specified_locale/_/-} | sed 's/\..*//') 1194 | cleaned_system_locale=$(echo ${LANG/_/-} | sed 's/\..*//') 1195 | 1196 | # ex: "fr-FR" => "fr" 1197 | cleaned_system_locale_short=$(echo $cleaned_system_locale | sed 's/-.*//') 1198 | 1199 | # Will make something more scalable if needed later 1200 | # But for now, we make these locales use en-US 1201 | if [[ $cleaned_system_locale == 'en-AU' || $cleaned_system_locale == 'en-CA' ]]; then 1202 | echo "Your system locale is set to ${cleaned_system_locale}. As there is no ${cleaned_system_locale} localization available for Firefox, en-US has been used instead." 1203 | cleaned_system_locale='en-US' 1204 | fi 1205 | 1206 | if [[ $all_locales != *" $cleaned_system_locale "* && $all_locales == *" $cleaned_system_locale_short "* ]]; then 1207 | echo "Your system locale \"$cleaned_system_locale\" is not available, but \"$cleaned_system_locale_short\" is!" 1208 | echo "We'll use \"$cleaned_system_locale_short\" as the default locale if you've not specified a valid locale." 1209 | cleaned_system_locale=$cleaned_system_locale_short 1210 | fi 1211 | 1212 | if [[ -n $specified_locale ]]; then 1213 | if [[ $all_locales != *" $cleaned_specified_locale "* ]]; then 1214 | echo "\"${cleaned_specified_locale}\" was not found in our list of valid locales." 1215 | locale=$cleaned_system_locale 1216 | else 1217 | locale=$cleaned_specified_locale 1218 | fi 1219 | else 1220 | locale=$cleaned_system_locale 1221 | fi 1222 | 1223 | echo "We're using ${locale} as your locale." 1224 | 1225 | echo "If this is wrong, use './firefoxes.sh [version] [locale]' to specify the locale." 1226 | echo "" 1227 | echo "The valid locales are:" 1228 | echo " ${all_locales}" 1229 | } 1230 | 1231 | clean_up() { 1232 | if ask "Delete all files from temp directory (${tmp_directory})?" Y; then 1233 | log "Deleting temp directory (${tmp_directory})!" 1234 | rm -rf ${tmp_directory} 1235 | else 1236 | log "Keeping temp directory (${tmp_directory}), though it will be deleted upon reboot!\n" 1237 | fi 1238 | return 0 1239 | } 1240 | 1241 | if [ "$(uname -s)" != "Darwin" ]; then 1242 | error "This script is designed to be run on OS X\nExiting..." 1243 | exit 0 1244 | fi 1245 | 1246 | get_locale 1247 | 1248 | for VERSION in $versions; do 1249 | get_associated_information $VERSION 1250 | log "====================\nInstalling ${nice_name}" 1251 | setup_dirs 1252 | get_bits 1253 | check_dmg 1254 | mount_dmg 1255 | install_app 1256 | unmount_dmg 1257 | prompt_firebug 1258 | done 1259 | 1260 | clean_up 1261 | --------------------------------------------------------------------------------