Public Member Functions | Public Attributes

nsIInstallLocation Interface Reference

Interface representing a location where extensions, themes etc are installed. More...

import "nsIExtensionManager.idl";

Collaboration diagram for nsIInstallLocation:

List of all members.

Public Member Functions

nsIFile getItemLocation (in AString id)
 Gets the directory that contains an item.
AString getIDForLocation (in nsIFile file)
 Retrieves the GUID for an item at the specified location.
nsIFile getItemFile (in AString id, in AString path)
 Gets a nsIFile object for a file within an item's directory structure.
boolean itemIsManagedIndependently (in AString id)
 Determines whether or not an item's resources are managed by the Extension System or by some other user or process.
nsIFile stageFile (in nsIFile file, in AString id)
 Stages the specified file by copying it to some location from where it can be retrieved later to complete installation.
nsIFile getStageFile (in AString id)
 Returns the most recently staged package (e.g.
void removeFile (in nsIFile file)
 Removes a file from the stage.

Public Attributes

readonly attribute AString name
 The string identifier of this Install Location.
readonly attribute
nsIDirectoryEnumerator 
itemLocations
 An enumeration of nsIFiles for:

  • locations that contain items
  • potential dropped-in XPIs Note: This enumeration resolves Text Links to the directories they refer to.

readonly attribute nsIFile location
 The file system location where items live.
readonly attribute boolean restricted
 Whether or not this Install Location is on an area of the file system that could be restricted on a restricted-access account, regardless of whether or not the location is restricted with the current user privileges.
readonly attribute boolean canAccess
 Whether or not the user can write to the Install Location with the current access privileges.
const unsigned long PRIORITY_APP_PROFILE = 0
 Constants representing priority of some default Install Locations.
const unsigned long PRIORITY_APP_SYSTEM_USER = 10
const unsigned long PRIORITY_XRE_SYSTEM_USER = 100
const unsigned long PRIORITY_APP_SYSTEM_GLOBAL = 1000
const unsigned long PRIORITY_XRE_SYSTEM_GLOBAL = 10000
readonly attribute long priority
 The priority level of this Install Location in loading.

Detailed Description

Interface representing a location where extensions, themes etc are installed.


Member Function Documentation

AString nsIInstallLocation::getIDForLocation ( in nsIFile  file  ) 

Retrieves the GUID for an item at the specified location.

Parameters:
file The location where an item might live.
Returns:
The ID for an item that might live at the location specified.

N.B. This function makes no promises about whether or not this path is actually maintained by this Install Location.

nsIFile nsIInstallLocation::getItemFile ( in AString  id,
in AString  path 
)

Gets a nsIFile object for a file within an item's directory structure.

Parameters:
id The GUID of the item.
path The path to the file beneath an Extension's directory
Returns:
A file object at the requested location. The file does not necessarily have to exist.
nsIFile nsIInstallLocation::getItemLocation ( in AString  id  ) 

Gets the directory that contains an item.

Parameters:
id The GUID of the item.
Returns:
The location of the item.
nsIFile nsIInstallLocation::getStageFile ( in AString  id  ) 

Returns the most recently staged package (e.g.

the last XPI or JAR in a directory) for an item and removes items that do not qualify.

Parameters:
id The ID of the staged package
Returns:
an nsIFile if the package exists otherwise null.
boolean nsIInstallLocation::itemIsManagedIndependently ( in AString  id  ) 

Determines whether or not an item's resources are managed by the Extension System or by some other user or process.

For example, items linked to by text links are managed by the user, and items linked to from Registry Install Locations are usually managed by other applications or installers.

Parameters:
id The GUID of the item.
Returns:
true if the item's resources are managed independently of the Extension System, false otherwise.
void nsIInstallLocation::removeFile ( in nsIFile  file  ) 

Removes a file from the stage.

This cleans up the stage if there is nothing else left after the remove operation.

Parameters:
file The file to remove.
nsIFile nsIInstallLocation::stageFile ( in nsIFile  file,
in AString  id 
)

Stages the specified file by copying it to some location from where it can be retrieved later to complete installation.

Parameters:
file The file to stage
id The GUID of the item the file represents
Returns:
The staged file

Member Data Documentation

Whether or not the user can write to the Install Location with the current access privileges.

This is different from restricted because it's not whether or not the location *might* be restricted, it's whether or not it actually *is* restricted right now.

An enumeration of nsIFiles for:

  • locations that contain items
  • potential dropped-in XPIs Note: This enumeration resolves Text Links to the directories they refer to.

The file system location where items live.

Items can be dropped in at this location. Can be null for Install Locations that don't have a file system presence. Note: This is a clone of the actual location which the caller can modify freely.

readonly attribute AString nsIInstallLocation::name

The string identifier of this Install Location.

readonly attribute long nsIInstallLocation::priority

The priority level of this Install Location in loading.

Constants representing priority of some default Install Locations.

XXXben - priority ranking of user-level items vs. global-level items here is debatable. Should app-system-global trump xre-system-user? You should not use the exact values here, you should offset from these values each time you create a new Install Location. Offsetting can be brittle but you should know what Install Locations are being defined for your own application.

Whether or not this Install Location is on an area of the file system that could be restricted on a restricted-access account, regardless of whether or not the location is restricted with the current user privileges.


The documentation for this interface was generated from the following file: