1
[Mozinstall](https://github.com/mozilla/mozbase/tree/master/mozinstall) is a
2
python package for installing and uninstalling Mozilla applications on
5
For example, depending on the platform, Firefox can be distributed as a
6
zip, tar.bz2, exe, or dmg file or cloned from a repository. Mozinstall takes
7
the hassle out of extracting and/or running these files and for convenience
8
returns the full path to the install directory. In the case that mozinstall
9
is invoked from the command line, the binary path will be printed to stdout.
11
To remove an installed application the uninstaller can be used. It requires
12
the installation path of the application and will remove all the installed
13
files. On Windows the uninstaller will be tried first.
16
Mozinstall can be used as API or via the CLI commands.
19
An application can be installed by running the commands below. The install
20
method will return the installation path of the application.
23
path = mozinstall.install(%installer%, %install_folder%)
25
To retrieve the real binary call get_binary with the path and
26
the application name as arguments:
28
mozinstall.get_binary(path, 'firefox')
30
If the application is not needed anymore the uninstaller will remove all
31
traces from the system:
33
mozinstall.uninstall(path)
36
The installer can also be used as a command line tool:
38
$ mozinstall -d firefox %installer%
40
Whereby the directory option is optional and will default to the current
41
working directory. If the installation was successful the path to the
42
binary will be printed to stdout.
44
Also the uninstaller can be called via the command line:
46
$ mozuninstall %install_path%
50
Mozinstall throws different types of exceptions:
52
- mozinstall.InstallError is thrown when the installation fails for any reason. A traceback is provided.
53
- mozinstall.InvalidBinary is thrown when the binary cannot be found.
54
- mozinstall.InvalidSource is thrown when the source is not a recognized file type (zip, exe, tar.bz2, tar.gz, dmg).
59
Mozinstall depends on the [mozinfo](https://github.com/mozilla/mozbase/tree/master/mozinfo)
60
package which is also found in the mozbase repository.