Index: toolkit/mozapps/extensions/src/nsExtensionManager.js.in =================================================================== RCS file: /cvsroot/mozilla/toolkit/mozapps/extensions/src/nsExtensionManager.js.in,v retrieving revision 1.144.2.16 diff -u -p -6 -r1.144.2.16 nsExtensionManager.js.in --- toolkit/mozapps/extensions/src/nsExtensionManager.js.in 21 Oct 2005 01:27:44 -0000 1.144.2.16 +++ toolkit/mozapps/extensions/src/nsExtensionManager.js.in 28 Dec 2005 06:58:07 -0000 @@ -118,12 +118,13 @@ const OP_NEEDS_UPGRADE = const OP_NEEDS_UNINSTALL = "needs-uninstall"; const OP_NEEDS_ENABLE = "needs-enable"; const OP_NEEDS_DISABLE = "needs-disable"; const KEY_APP_PROFILE = "app-profile"; const KEY_APP_GLOBAL = "app-global"; +const KEY_APP_SYSTEM = "app-system"; const CATEGORY_INSTALL_LOCATIONS = "extension-install-locations"; const PREFIX_NS_EM = "http://www.mozilla.org/2004/em-rdf#"; const PREFIX_NS_CHROME = "http://www.mozilla.org/rdf/chrome#"; const PREFIX_ITEM_URI = "urn:mozilla:item:"; @@ -2215,12 +2216,22 @@ function ExtensionManager() { var priority = nsIInstallLocation.PRIORITY_APP_PROFILE; var profileLocation = new DirectoryInstallLocation(KEY_APP_PROFILE, appProfileExtensions, false, priority); InstallLocations.put(profileLocation); + // Register App-System Install Location + try { + var appSystemExtensions = getDirNoCreate("DrvD", ["usr","lib","browser-extensions","thunderbird"]); + var priority = nsIInstallLocation.PRIORITY_APP_PROFILE - 1; + var systemLocation = new DirectoryInstallLocation(KEY_APP_SYSTEM, + appSystemExtensions, true, + priority); + InstallLocations.put(systemLocation); + } catch (e) {} + #ifdef XP_WIN // Register HKEY_LOCAL_MACHINE Install Location InstallLocations.put( new WinRegInstallLocation("winreg-app-global", nsIWindowsRegKey.ROOT_KEY_LOCAL_MACHINE, true, @@ -3236,13 +3247,13 @@ ExtensionManager.prototype = { "{641d8d09-7dda-4850-8228-ac0ab65e2ac9}"]); if (profileDOMi && profileDOMi.exists()) removeDirRecursive(profileDOMi); // Prepare themes for installation // Only enumerate directories in the app-profile and app-global locations. - var locations = [KEY_APP_PROFILE, KEY_APP_GLOBAL]; + var locations = [KEY_APP_PROFILE, KEY_APP_GLOBAL, KEY_APP_SYSTEM]; for (var i = 0; i < locations.length; ++i) { var location = InstallLocations.get(locations[i]); if (!location.canAccess) continue; var entries = location.itemLocations; @@ -3300,13 +3311,14 @@ ExtensionManager.prototype = { if (this._checkForFileChanges()) { // Create a list of all items that are to be installed so we can migrate // these items's settings to the new datasource. var items = PendingOperations.getOperations(OP_NEEDS_INSTALL); for (i = items.length - 1; i >= 0; --i) { if (items[i].locationKey == KEY_APP_PROFILE || - items[i].locationKey == KEY_APP_GLOBAL) + items[i].locationKey == KEY_APP_GLOBAL || + items[i].locationKey == KEY_APP_SYSTEM) itemsToCheck.push(items[i].id); } this._finishOperations(); } // If there are no items to migrate settings for return early. @@ -4303,13 +4315,14 @@ ExtensionManager.prototype = { var restartRequired = this.installRequiresRestart(id, ds.getItemProperty(id, "type")) this._updateManifests(restartRequired); return; } } else if (installLocation.name == KEY_APP_PROFILE || - installLocation.name == KEY_APP_GLOBAL) { + installLocation.name == KEY_APP_GLOBAL || + installLocation.name == KEY_APP_SYSTEM) { // Check for a pointer file and remove it if it exists var pointerFile = installLocation.location.clone(); pointerFile.append(id); if (pointerFile.exists() && !pointerFile.isDirectory()) pointerFile.remove(false); }