170006 more updates - make -install-global shut the app down after it installs

This commit is contained in:
ben%bengoodger.com 2004-05-04 22:31:52 +00:00
Родитель 7e39ef123e
Коммит 934ff227c8
1 изменённых файлов: 13 добавлений и 8 удалений

Просмотреть файл

@ -623,10 +623,19 @@ nsExtensionManager.prototype = {
win.close(); win.close();
} }
this._checkForGlobalInstalls(cmdLineSvc.getCmdLineValue("-install-global")); var globalFlags = cmdLineSvc.getCmdLineValue("-install-global");
if (globalFlags)
this._checkForGlobalInstalls(globalFlags);
this._finishOperations(); this._finishOperations();
this._loadDefaults(); this._loadDefaults();
if (globalFlags) {
// If we did a global install, shut down the app now.
// XXXben - change to nsIAppStartup w/bsmedberg change
var appStartup = Components.classes['@mozilla.org/appshell/appShellService;1']
.getService(Components.interfaces.nsIAppShellService);
appStartup.quit(Components.interfaces.nsIAppShellService.eForceQuit);
}
} }
else { else {
var win = this._showProgressWindow(); var win = this._showProgressWindow();
@ -649,9 +658,6 @@ nsExtensionManager.prototype = {
_checkForGlobalInstalls: function (aPath) _checkForGlobalInstalls: function (aPath)
{ {
if (!aPath)
return;
// First see if the path supplied is a file path // First see if the path supplied is a file path
var file = Components.classes["@mozilla.org/file/local;1"] var file = Components.classes["@mozilla.org/file/local;1"]
.createInstance(Components.interfaces.nsILocalFile); .createInstance(Components.interfaces.nsILocalFile);
@ -669,9 +675,8 @@ nsExtensionManager.prototype = {
if (file.exists()) if (file.exists())
this.installExtensionFromXPI(file, nsIExtensionManager.FLAG_INSTALL_GLOBAL); this.installExtensionFromXPI(file, nsIExtensionManager.FLAG_INSTALL_GLOBAL);
else { else
printf("Invalid XPI Path: " + aPath + "\n"); dump("Invalid XPI Path: " + aPath + "\n");
}
}, },
_finishOperations: function () _finishOperations: function ()