Fix getCanStageUpdates check
authorRobert Strong <robert.bugzilla@gmail.com>
Fri, 24 Apr 2015 08:36:09 -0700
changeset 491413 e0a53ff0d29654da0d7e1b250cc73399c3561ceb
parent 491412 5cf45ef42c9f3457d627714a0acf5a5c604ec791
child 491414 0da3000e148b4eacdd6a597e2f577a563b4ef6ef
push id47343
push userbmo:dothayer@mozilla.com
push dateWed, 01 Mar 2017 22:58:58 +0000
milestone40.0a1
Fix getCanStageUpdates check
toolkit/mozapps/update/nsUpdateService.js
--- a/toolkit/mozapps/update/nsUpdateService.js
+++ b/toolkit/mozapps/update/nsUpdateService.js
@@ -643,22 +643,22 @@ XPCOMUtils.defineLazyGetter(this, "gCanS
 function getCanStageUpdates() {
   // If background updates are disabled, then just bail out!
   if (!getPref("getBoolPref", PREF_APP_UPDATE_STAGING_ENABLED, false)) {
     LOG("getCanStageUpdates - staging updates is disabled by preference " +
         PREF_APP_UPDATE_STAGING_ENABLED);
     return false;
   }
 
-  if (AppConstants.platform == "win" &&
-      !(isServiceInstalled() && shouldUseService())) {
+  if (AppConstants.platform == "win" && isServiceInstalled() &&
+      shouldUseService()) {
     // No need to perform directory write checks, the maintenance service will
     // be able to write to all directories.
-    LOG("getCanStageUpdates - unable to stage updates on without the service");
-    return false;
+    LOG("getCanStageUpdates - able to stage updates using the service");
+    return true;
   }
 
   // For Gonk, the updater will remount the /system partition to move staged
   // files into place.
   if (AppConstants.platform == "gonk") {
     LOG("getCanStageUpdates - able to stage updates because this is gonk");
     return true;
   }