Refactor word plugin installer
This commit is contained in:
parent
d4fce3c855
commit
21fadee7bb
|
@ -68,7 +68,7 @@ var ZoteroPluginInstaller = function(addon, failSilently, force) {
|
||||||
Zotero.debug("PluginInstaller: fetching addon info");
|
Zotero.debug("PluginInstaller: fetching addon info");
|
||||||
AddonManager.getAddonsByIDs(extensionIDs, function(addons) {
|
AddonManager.getAddonsByIDs(extensionIDs, function(addons) {
|
||||||
Zotero.debug("PluginInstaller: addon info fetched");
|
Zotero.debug("PluginInstaller: addon info fetched");
|
||||||
me._addons = addons;
|
me._addonInfo = addons[0];
|
||||||
me._addonInfoAvailable();
|
me._addonInfoAvailable();
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -78,7 +78,7 @@ ZoteroPluginInstaller.prototype = {
|
||||||
|
|
||||||
_addonInfoAvailable: function() {
|
_addonInfoAvailable: function() {
|
||||||
try {
|
try {
|
||||||
this._version = this._addons[0].version;
|
this._version = this._addonInfo.version;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
this._addon.verifyNotCorrupt(this);
|
this._addon.verifyNotCorrupt(this);
|
||||||
|
@ -127,19 +127,8 @@ ZoteroPluginInstaller.prototype = {
|
||||||
},
|
},
|
||||||
|
|
||||||
getAddonPath: function(addonID) {
|
getAddonPath: function(addonID) {
|
||||||
if(AddonManager) {
|
return this._addonInfo.getResourceURI().
|
||||||
for (var addon of this._addons) {
|
QueryInterface(Components.interfaces.nsIFileURL).file;
|
||||||
if(addon && addon.id == addonID) {
|
|
||||||
return addon.getResourceURI().
|
|
||||||
QueryInterface(Components.interfaces.nsIFileURL).file;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return Components.classes["@mozilla.org/extensions/manager;1"].
|
|
||||||
getService(Components.interfaces.nsIExtensionManager).
|
|
||||||
getInstallLocation(addonID).
|
|
||||||
getItemLocation(addonID);
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
setProgressWindowLabel: function(value) {
|
setProgressWindowLabel: function(value) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user