From 6a9ec99dfe9a85cf84833f1c59632b8a7f321c38 Mon Sep 17 00:00:00 2001 From: "ben%bengoodger.com" Date: Tue, 4 May 2004 22:31:52 +0000 Subject: [PATCH] 170006 more updates - make -install-global shut the app down after it installs --- .../extensions/src/nsExtensionManager.js.in | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/toolkit/mozapps/extensions/src/nsExtensionManager.js.in b/toolkit/mozapps/extensions/src/nsExtensionManager.js.in index 4337672a01c..913225b89f4 100644 --- a/toolkit/mozapps/extensions/src/nsExtensionManager.js.in +++ b/toolkit/mozapps/extensions/src/nsExtensionManager.js.in @@ -623,10 +623,19 @@ nsExtensionManager.prototype = { win.close(); } - this._checkForGlobalInstalls(cmdLineSvc.getCmdLineValue("-install-global")); + var globalFlags = cmdLineSvc.getCmdLineValue("-install-global"); + if (globalFlags) + this._checkForGlobalInstalls(globalFlags); 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 { var win = this._showProgressWindow(); @@ -649,9 +658,6 @@ nsExtensionManager.prototype = { _checkForGlobalInstalls: function (aPath) { - if (!aPath) - return; - // First see if the path supplied is a file path var file = Components.classes["@mozilla.org/file/local;1"] .createInstance(Components.interfaces.nsILocalFile); @@ -669,9 +675,8 @@ nsExtensionManager.prototype = { if (file.exists()) this.installExtensionFromXPI(file, nsIExtensionManager.FLAG_INSTALL_GLOBAL); - else { - printf("Invalid XPI Path: " + aPath + "\n"); - } + else + dump("Invalid XPI Path: " + aPath + "\n"); }, _finishOperations: function ()