nsIInstallLocation

IID:D3D4DADA-C6EB-11D9-A68F-001124787B2E
Inherits From:nsISupports

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


Constants

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.
PRUint32 PRIORITY_APP_PROFILE = 0
PRUint32 PRIORITY_APP_SYSTEM_USER = 10
PRUint32 PRIORITY_XRE_SYSTEM_USER = 100
PRUint32 PRIORITY_APP_SYSTEM_GLOBAL = 1000
PRUint32 PRIORITY_XRE_SYSTEM_GLOBAL = 10000

Properties

readonly PRBool canAccess

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.

readonly 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 nsIFile location

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 AString name

The string identifier of this Install Location

readonly PRInt32 priority

The priority level of this Install Location in loading.

readonly PRBool 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.


Methods

AString getIDForLocation ( nsIFile file ) nsIFile getItemFile ( AString id , AString path ) nsIFile getItemLocation ( AString id ) PRBool itemIsManagedIndependently ( AString id )

AString getIDForLocation ( nsIFile file )

Retrieves the GUID for an item at the specified location.

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

Arguments:
file: The location where an item might live.

nsIFile getItemFile ( AString id , AString path )

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

Arguments:
id: The GUID of the item.
path: The path to the file beneath an Extension's directory

nsIFile getItemLocation ( AString id )

Gets the directory that contains an item.

Arguments:
id: The GUID of the item.

PRBool itemIsManagedIndependently ( 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.

Arguments:
id: The GUID of the item.

References

This interface is returned from the following methods:

nsIExtensionManager.getInstallLocation

Reference documentation is generated from Mozilla's source.

Add a note User Contributed Notes
No comments available

Copyright © 1999 - 2005 XULPlanet.com