~ubuntu-branches/ubuntu/quantal/enigmail/quantal-security

« back to all changes in this revision

Viewing changes to testing/mozbase/mozinstall/README.md

  • Committer: Package Import Robot
  • Author(s): Chris Coulson
  • Date: 2013-09-13 16:02:15 UTC
  • mfrom: (0.12.16)
  • Revision ID: package-import@ubuntu.com-20130913160215-u3g8nmwa0pdwagwc
Tags: 2:1.5.2-0ubuntu0.12.10.1
* New upstream release v1.5.2 for Thunderbird 24

* Build enigmail using a stripped down Thunderbird 17 build system, as it's
  now quite difficult to build the way we were doing previously, with the
  latest Firefox build system
* Add debian/patches/no_libxpcom.patch - Don't link against libxpcom, as it
  doesn't exist anymore (but exists in the build system)
* Add debian/patches/use_sdk.patch - Use the SDK version of xpt.py and
  friends
* Drop debian/patches/ipc-pipe_rename.diff (not needed anymore)
* Drop debian/patches/makefile_depth.diff (not needed anymore)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
[Mozinstall](https://github.com/mozilla/mozbase/tree/master/mozinstall) is a
2
 
python package for installing and uninstalling Mozilla applications on
3
 
various platforms.
4
 
 
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.
10
 
 
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.
14
 
 
15
 
# Usage
16
 
Mozinstall can be used as API or via the CLI commands.
17
 
 
18
 
## API
19
 
An application can be installed by running the commands below. The install
20
 
method will return the installation path of the application.
21
 
 
22
 
    import mozinstall
23
 
    path = mozinstall.install(%installer%, %install_folder%)
24
 
 
25
 
To retrieve the real binary call get_binary with the path and
26
 
the application name as arguments:
27
 
 
28
 
    mozinstall.get_binary(path, 'firefox')
29
 
 
30
 
If the application is not needed anymore the uninstaller will remove all
31
 
traces from the system:
32
 
 
33
 
    mozinstall.uninstall(path)
34
 
 
35
 
## CLI
36
 
The installer can also be used as a command line tool:
37
 
 
38
 
    $ mozinstall -d firefox %installer%
39
 
 
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.
43
 
 
44
 
Also the uninstaller can be called via the command line:
45
 
 
46
 
    $ mozuninstall %install_path%
47
 
 
48
 
# Error Handling
49
 
 
50
 
Mozinstall throws different types of exceptions:
51
 
 
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).
55
 
 
56
 
 
57
 
# Dependencies
58
 
 
59
 
Mozinstall depends on the [mozinfo](https://github.com/mozilla/mozbase/tree/master/mozinfo) 
60
 
package which is also found in the mozbase repository.