diff --git a/toolkit/mozapps/update/content/updates.js b/toolkit/mozapps/update/content/updates.js index 1847c6ab6d22..971bf67a09f9 100644 --- a/toolkit/mozapps/update/content/updates.js +++ b/toolkit/mozapps/update/content/updates.js @@ -223,7 +223,7 @@ var gUpdates = { // // Encode version since it could be a non-ascii string (bug 359093) var neverPrefName = PREF_UPDATE_NEVER_BRANCH + - encodeURIComponent(gUpdates.update.version); + encodeURIComponent(gUpdates.update.version); gPref.setBoolPref(neverPrefName, true); this.wiz.cancel(); }, @@ -762,6 +762,13 @@ var gManualUpdatePage = { manualUpdateLinkLabel.value = manualURL; manualUpdateLinkLabel.setAttribute("url", manualURL); + // Prevent multiple notifications for the same update when the user is + // unable to apply updates. + // Encode version since it could be a non-ascii string (bug 359093) + var neverPrefName = PREF_UPDATE_NEVER_BRANCH + + encodeURIComponent(gUpdates.update.version); + gPref.setBoolPref(neverPrefName, true); + gUpdates.setButtons(null, null, "okButton", true); gUpdates.wiz.getButton("finish").focus(); } diff --git a/toolkit/mozapps/update/src/nsUpdateService.js.in b/toolkit/mozapps/update/src/nsUpdateService.js.in index 4909812c52eb..87785e090755 100644 --- a/toolkit/mozapps/update/src/nsUpdateService.js.in +++ b/toolkit/mozapps/update/src/nsUpdateService.js.in @@ -1325,6 +1325,21 @@ UpdateService.prototype = { // Encode version since it could be a non-ascii string (bug 359093) var neverPrefName = PREF_UPDATE_NEVER_BRANCH + encodeURIComponent(update.version); + + if (!gCanApplyUpdates) { + if (getPref("getBoolPref", neverPrefName, false)) { + LOG("Checker:_selectAndInstallUpdate - the user is unable to apply " + + "updates. Not prompting because the preference " + neverPrefName + + " is true"); + } + else { + LOG("Checker:_selectAndInstallUpdate - the user is unable to apply " + + "updates... prompting"); + this._showPrompt(update); + } + return; + } + if (update.type == "major" && getPref("getBoolPref", neverPrefName, false)) { LOG("Checker:_selectAndInstallUpdate - not prompting because this is a " + @@ -1357,13 +1372,6 @@ UpdateService.prototype = { return; } - if (!gCanApplyUpdates) { - LOG("Checker:_selectAndInstallUpdate - prompting because the user is " + - "unable to apply updates"); - this._showPrompt(update); - return; - } - if (!getPref("getBoolPref", PREF_APP_UPDATE_AUTO, true)) { LOG("Checker:_selectAndInstallUpdate - prompting because silent " + "install is disabled");