зеркало из https://github.com/mozilla/gecko-dev.git
Bug 305361 install-global-extension and install-global-theme work inconsistently. r=bsmedberg
This commit is contained in:
Родитель
93d08d4477
Коммит
0ca5a4921f
|
@ -2420,21 +2420,45 @@ ExtensionManager.prototype = {
|
||||||
var globalExtension = commandLine.handleFlagWithParam("install-global-extension", false);
|
var globalExtension = commandLine.handleFlagWithParam("install-global-extension", false);
|
||||||
if (globalExtension) {
|
if (globalExtension) {
|
||||||
var file = commandLine.resolveFile(globalExtension);
|
var file = commandLine.resolveFile(globalExtension);
|
||||||
this.installItemFromFile(file, KEY_APP_GLOBAL);
|
this._installGlobalItem(file);
|
||||||
}
|
}
|
||||||
var globalTheme = commandLine.handleFlagWithParam("install-global-theme", false);
|
var globalTheme = commandLine.handleFlagWithParam("install-global-theme", false);
|
||||||
if (globalTheme) {
|
if (globalTheme) {
|
||||||
var file = commandLine.resolveFile(globalExtension);
|
file = commandLine.resolveFile(globalTheme);
|
||||||
this.installItemFromFile(file, KEY_APP_GLOBAL);
|
this._installGlobalItem(file);
|
||||||
}
|
}
|
||||||
this._finishOperations();
|
|
||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
LOG("Failed to install Global Item: invalid parameter format or file path");
|
LOG("ExtensionManager:handleCommandLineArgs - failure, catching exception - lineno: " +
|
||||||
|
e.lineNumber + " - file: " + e.fileName + " - " + e);
|
||||||
}
|
}
|
||||||
commandLine.preventDefault = true;
|
commandLine.preventDefault = true;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Installs an XPI/JAR file into the KEY_APP_GLOBAL install location.
|
||||||
|
* @param file
|
||||||
|
* The XPI/JAR file to extract
|
||||||
|
*/
|
||||||
|
_installGlobalItem: function(file) {
|
||||||
|
if (!file || !file.exists())
|
||||||
|
throw new Error("Unable to find the file specified on the command line!");
|
||||||
|
var installManifestFile = extractRDFFileToTempDir(file, FILE_INSTALL_MANIFEST, true);
|
||||||
|
if (!installManifestFile || !installManifestFile.exists())
|
||||||
|
throw new Error("The package is missing an install manifest!");
|
||||||
|
var installManifest = getInstallManifest(installManifestFile);
|
||||||
|
installManifestFile.remove(false);
|
||||||
|
var installData = this._getInstallData(installManifest);
|
||||||
|
var installer = new Installer(installManifest, installData.id,
|
||||||
|
InstallLocations.get(KEY_APP_GLOBAL),
|
||||||
|
installData.type);
|
||||||
|
installer._installExtensionFiles(file);
|
||||||
|
if (installData.type == nsIUpdateItem.TYPE_EXTENSION)
|
||||||
|
installer.upgradeExtensionChrome();
|
||||||
|
else
|
||||||
|
installer.upgradeThemeChrome();
|
||||||
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check to see if a file is a XPI/JAR file that the user dropped into this
|
* Check to see if a file is a XPI/JAR file that the user dropped into this
|
||||||
* Install Location. (i.e. a XPI that is not a staged XPI from an install
|
* Install Location. (i.e. a XPI that is not a staged XPI from an install
|
||||||
|
|
Загрузка…
Ссылка в новой задаче