From 916e67370ac9acade4ca6b2cf73731e0eb53758f Mon Sep 17 00:00:00 2001 From: "bsmedberg%covad.net" Date: Wed, 29 Jun 2005 13:58:16 +0000 Subject: [PATCH] Bug 295680 - extension should not install when chrome registration fails - patch by Robert Strong , r+a=bsmedberg git-svn-id: svn://10.0.0.236/trunk@175289 18797224-902f-48f8-a5cc-f745e15eee43 --- .../mozapps/extensions/src/nsExtensionManager.js.in | 12 ++++++++++++ mozilla/xpinstall/src/nsSoftwareUpdateRun.cpp | 1 + 2 files changed, 13 insertions(+) diff --git a/mozilla/toolkit/mozapps/extensions/src/nsExtensionManager.js.in b/mozilla/toolkit/mozapps/extensions/src/nsExtensionManager.js.in index 1e2b1a7cc24..5b4a769aafe 100644 --- a/mozilla/toolkit/mozapps/extensions/src/nsExtensionManager.js.in +++ b/mozilla/toolkit/mozapps/extensions/src/nsExtensionManager.js.in @@ -1553,7 +1553,13 @@ Installer.prototype = { "Failure exception: " + e); showMessage("malformedRegistrationTitle", [], "malformedRegistrationMessage", [BundleManager.appName]); + + var stageFile = this._installLocation.getStageFile(this._id); + if (stageFile) + this._installLocation.removeFile(stageFile); + StartupCache.put(this._installLocation, this._id, OP_NEEDS_UNINSTALL, true); + StartupCache.write(); } }, @@ -1611,7 +1617,13 @@ Installer.prototype = { "Failure exception: " + e); showMessage("malformedRegistrationTitle", [], "malformedRegistrationMessage", [BundleManager.appName]); + + var stageFile = this._installLocation.getStageFile(this._id); + if (stageFile) + this._installLocation.removeFile(stageFile); + StartupCache.put(this._installLocation, this._id, OP_NEEDS_UNINSTALL, true); + StartupCache.write(); } }, diff --git a/mozilla/xpinstall/src/nsSoftwareUpdateRun.cpp b/mozilla/xpinstall/src/nsSoftwareUpdateRun.cpp index 6116cb5948d..7cf62f19ad1 100644 --- a/mozilla/xpinstall/src/nsSoftwareUpdateRun.cpp +++ b/mozilla/xpinstall/src/nsSoftwareUpdateRun.cpp @@ -501,6 +501,7 @@ extern "C" void RunInstallOnThread(void *data) #ifdef MOZ_XUL_APP if (NS_SUCCEEDED(hZip->Test("install.rdf"))) { + hZip->Close(); // appears to be an Extension Manager install nsIExtensionManager* em = installInfo->GetExtensionManager(); if (em)