Skip to content

Instantly share code, notes, and snippets.

@morisono
Forked from noraj/README.md
Last active June 30, 2025 13:05
Show Gist options
  • Save morisono/6cfb043e6308946f23cc5dfaa00c06e4 to your computer and use it in GitHub Desktop.
Save morisono/6cfb043e6308946f23cc5dfaa00c06e4 to your computer and use it in GitHub Desktop.
Install Firefox Developer Edition

Install Firefox Developer Edition

This script intend to provide an automatic installation of Mozilla Firefox Developer Edition for x86_64 Linux distros.

Firefox Developer Edition

Firefox Developer Edition is installed to /opt/firefox-dev/.

Note:

  • Default language is en-US, feel free to manually change it in the script.
  • The same script can be used for installation or update.
#!/bin/bash
#title : install_firefix_dev.sh
#description : This script will install Firefox Developer Edition x86_64
#author : Alexandre ZANNi
#date : 2016/08/30
#version : 0.1
#bash_version : GNU bash, version 4.2.47(1)-release (x86_64-suse-linux-gnu)
#=============================================================================
#
# Warning: Require sudo to move files into /opt/
# You can choose lang
lang="en-US"
url="https://download.mozilla.org/?product=firefox-devedition-latest-ssl&os=linux64&lang=$lang"
# Get filename
solved_URL=$(curl -L --head -w '%{url_effective}' $url 2>/dev/null | tail -n1)
filename_with_ext=$(echo $solved_URL | sed 's/.*\///')
# Download the file
wget $url -P $HOME --trust-server-names
# Remove archive extension (ex: bz2)
filename=$(echo $filename_with_ext | sed 's/\.[^.]*$//')
# Remove tar extension
filename=$(echo $filename | sed 's/\.[^.]*$//')
temp_folder="$HOME/$filename/"
sub_folder="firefox/"
absolut_filename="$HOME/$filename_with_ext"
if [ ! -d $temp_folder ]
then
# Create a temporary folder, extract archive
mkdir -p $temp_folder && tar xaf $absolut_filename -C $temp_folder
rm -rf "/opt/firefox-dev/" # remove if updating and don't prompt if not existing
mv -f "$temp_folder$sub_folder" "/opt/firefox-dev/"
# Create a shortcut
cat > ~/.local/share/applications/firefox-dev.desktop << EOF
[Desktop Entry]
Name=Firefox Developer
GenericName=Firefox Developer Edition
Exec=/opt/firefox-dev/firefox
Terminal=false
Icon=/opt/firefox-dev/browser/icons/mozicon128.png
Type=Application
Categories=Application;Network;X-Developer;
Comment=Firefox Developer Edition Web Browser
EOF
# Remove the temporary folder & archive
rmdir $temp_folder
rm $absolut_filename
fi
$installerName = "installer.ps1"
# インストール順序をディレクトリ名の降順にすることで、サブディレクトリに保存されている依存関係のあるものを先にインストールしている
$f = ((Get-ChildItem * -Recurse | Where-Object { $_.PSIsContainer }).fullname | Sort-Object -Descending)
(Write-Output "# This installer was generated on ") + (Get-date -f "[yyyy/MM/dd HH:mm:ss.ff]") > $installerName
for ($i=0; $i -lt $f.length; $i++){
Write-Output ("Write-Output {0}" -f $f[$i]) >> $installerName
$installerPath = $f[$i] + "\" + (Get-ChildItem $f[$i] -include *.msi,*.exe -Name)
$installerPath = "`"" + (Convert-Path $installerPath) + "`""
$installerArgv = ((Get-Content (Get-ChildItem $f[$i]*.yaml).fullname) -like "*Silent:*").split(":")[1]
$installerArgv = $installerArgv + ("$i" + ((Get-Content (Get-ChildItem $f[$i]*.yaml).fullname) -like '*Custom:*')).split(":")[1]
$isExe = (Get-ChildItem $f[$i] -include *.exe -Name)
if($isExe){
$installerArgv = "`"" + $installerArgv + "`""
Write-Output "Start-Process -FilePath $installerPath -ArgumentList $installerArgv -Wait -NoNewWindow -PassThru" >> $installerName
}else{
$installerPath = "`'/i " + $installerPath + $installerArgv + "`'"
Write-Output "Start-Process -FilePath msiexec -ArgumentList $installerPath -Wait -NoNewWindow -PassThru" >> $installerName
}
}
@morisono
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment