mozinstall — Install and uninstall Gecko-based applications

mozinstall is a small python module with several convenience methods useful for installing and uninstalling a gecko-based application (e.g. Firefox) on the desktop.

Simple example

import mozinstall
import tempfile

tempdir = tempfile.mkdtemp()
firefox_dmg = 'firefox-38.0a1.en-US.mac.dmg'
install_folder = mozinstall.install(src=firefox_dmg, dest=tempdir)
binary = mozinstall.get_binary(install_folder, 'Firefox')
# from here you can execute the binary directly
# ...

API Documentation


Tests if the given file is a valid installer package.

Supported types: Linux: tar.gz, tar.bz2 Mac: dmg Windows: zip, exe

On Windows pefile will be used to determine if the executable is the right type, if it is installed on the system.

Parameters:src – Path to the install file.
mozinstall.install(src, dest)

Install a zip, exe, tar.gz, tar.bz2 or dmg file, and return the path of the installation folder.

  • src – Path to the install file
  • dest – Path to install to (to ensure we do not overwrite any existent files the folder should not exist yet)
mozinstall.get_binary(path, app_name)

Find the binary in the specified path, and return its path. If binary is not found throw an InvalidBinary exception.

  • path – Path within to search for the binary
  • app_name – Application binary without file extension to look for

Uninstalls the application in the specified path. If it has been installed via an installer on Windows, use the uninstaller first.

Parameters:install_folder – Path of the installation folder
exception mozinstall.InstallError

Thrown when installation fails. Includes traceback if available.

exception mozinstall.InvalidBinary

Thrown when the binary cannot be found after the installation.

exception mozinstall.InvalidSource

Thrown when the specified source is not a recognized file type.

Supported types: Linux: tar.gz, tar.bz2 Mac: dmg Windows: zip, exe