Extension Manager:Install Locations

From MozillaWiki
Jump to navigation Jump to search

Overview

The extension manager uses a number of install locations where extensions will be loaded from. Currently there is a very simple structure in place. Any add-ons installed by the user go into the profile install location, any other install locations are simply scanned for new items during startup. Any new items detected during startup are installed and activated with no user intervention (except in the case of xpi files dropped in). The install locations have priorities. If the same add-on exists in two different install locations then the one in the higher priority install location is used. The general set of install locations, ranging from low to high priority are:

  1. Application installation directory
  2. Computer-wide locations
  3. User-wide locations
  4. Profile directory

There are also certain flags that are allowed to be used in some of the install locations to control what behaviours are available for the add-on:

  • appManaged instructs the application that the add-on is provided with the application and should not be updated
  • locked indicates that the user should not be allowed to uninstall the add-on
  • hidden tells the application to hide the add-on from the user

Tweaking install locations

This proposal is to change the priority of some of the install locations and more explicitly define their purpose as well as to remove the use of the behaviour flags. The following install locations will exist (mostly the same locations as above, but re-ordered and explained). At the moment the computer-wide, user-wide and profile locations still follow a priority system for deciding which add-on to use. An alternative would be to use the newest compatible add-on from them.

Computer-wide and user-wide

Locations: <user app data>/<vendor>/Extensions <system app data>/<vendor>/Extensions (Registry on Windows)

These install locations are for the purpose of allowing outside applications or the OS to provide extensions to enhance the user's experience. The add-ons installed here will be optional for the user. When new items are detected the user will be offered them during the next startup, they may decline to install them. If they decline then they will be able to add them at a later stage through some as yet undetermined UI. If they have added them then they can uninstall them, and again they may add them again later if they wish. Users cannot however upgrade these items. They are considered as managed by outside applications which should take care of upgrading them.

As the items in these locations are managed externally, any that aren't compatible with the application will not be shown to the user.

Profile directory

Location: <profile>/extensions

This is the general location where any add-ons that are installed by the user through the application go.

Application/distribution directory

Location: <appdir>/extensions

This location is for system administrators or distributors to include add-ons with their distribution of the application. Users have no choice whether to install these items, they are always installed. Users may not install new versions of add-ons that are in this location. It might be appropriate to allow a flag that makes it impossible for users to disable items in this location.

Distribution defaults

Location: <appdir>/distribution/addons (and default user registry on windows)

This is an additional location inside the application directory, however it is not really an install location. It allows distributions to ship add-ons that the user then has complete control over. When a new version of the application is started, any add-ons here that have not been installed previously will be copied to the profile directory where the user may update or uninstall the add-on as they wish.

Replacing flags

The flags are mostly replaced by the behaviours of the install locations. locked and appManaged simply apply to all add-ons in the application directory. The exception is hidden which no longer exists for regular add-ons. If system administrators need to install an add-on that the user cannot see then they can do so by including it as a regular distribution bundle (in <appdir>/distribution/bundles). These will not show up in the extension manager. The only downside is that certain add-ons may not work there if they use certain APIs like the nsIInstallLocation APIs to find their files.