diff --git a/toolkit/components/maintenanceservice/workmonitor.cpp b/toolkit/components/maintenanceservice/workmonitor.cpp index 7d78bec5bdb5..2cff265b773c 100644 --- a/toolkit/components/maintenanceservice/workmonitor.cpp +++ b/toolkit/components/maintenanceservice/workmonitor.cpp @@ -587,16 +587,19 @@ ExecuteServiceCommand(int argc, LPWSTR *argv) oldUpdaterPath, secureUpdaterPath)); DeleteSecureUpdater(secureUpdaterPath); result = CopyFileW(oldUpdaterPath, secureUpdaterPath, FALSE); - if (!result) { - LOG_WARN(("Could not copy path to secure location. (%d)", - GetLastError())); - } } - // If we obtained the path and copied it successfully update the path to - // use for the service update. If there was a problem use the original - // path so things work like it used to. - if (result) { + if (!result) { + LOG_WARN(("Could not copy path to secure location. (%d)", + GetLastError())); + if (argc > 4 && !WriteStatusFailure(argv[4], + SERVICE_COULD_NOT_COPY_UPDATER)) { + LOG_WARN(("Could not write update.status could not copy updater error")); + } + } else { + + // We obtained the path and copied it successfully, update the path to + // use for the service update. argv[3] = secureUpdaterPath; WCHAR oldUpdaterINIPath[MAX_PATH + 1] = { L'\0' }; @@ -611,10 +614,10 @@ ExecuteServiceCommand(int argc, LPWSTR *argv) oldUpdaterINIPath, secureUpdaterINIPath, GetLastError())); } } - } - result = ProcessSoftwareUpdateCommand(argc - 3, argv + 3); - DeleteSecureUpdater(secureUpdaterPath); + result = ProcessSoftwareUpdateCommand(argc - 3, argv + 3); + DeleteSecureUpdater(secureUpdaterPath); + } // We might not reach here if the service install succeeded // because the service self updates itself and the service diff --git a/toolkit/mozapps/update/common/errors.h b/toolkit/mozapps/update/common/errors.h index 585938427e10..360f2e3f2539 100644 --- a/toolkit/mozapps/update/common/errors.h +++ b/toolkit/mozapps/update/common/errors.h @@ -51,6 +51,7 @@ #define SERVICE_UPDATER_NOT_FIXED_DRIVE 31 #define SERVICE_COULD_NOT_LOCK_UPDATER 32 #define SERVICE_INSTALLDIR_ERROR 33 +#define SERVICE_COULD_NOT_COPY_UPDATER 49 #define NO_INSTALLDIR_ERROR 34 #define WRITE_ERROR_ACCESS_DENIED 35 diff --git a/toolkit/mozapps/update/nsUpdateService.js b/toolkit/mozapps/update/nsUpdateService.js index 4a17a695e0ce..5cee849a6008 100644 --- a/toolkit/mozapps/update/nsUpdateService.js +++ b/toolkit/mozapps/update/nsUpdateService.js @@ -136,6 +136,7 @@ const SERVICE_STILL_APPLYING_ON_FAILURE = 30; const SERVICE_UPDATER_NOT_FIXED_DRIVE = 31; const SERVICE_COULD_NOT_LOCK_UPDATER = 32; const SERVICE_INSTALLDIR_ERROR = 33; +const SERVICE_COULD_NOT_COPY_UPDATER = 49; const WRITE_ERROR_ACCESS_DENIED = 35; // const WRITE_ERROR_SHARING_VIOLATION = 36; // Replaced with errors 46-48 @@ -152,7 +153,6 @@ const WRITE_ERROR_SHARING_VIOLATION_SIGNALED = 46; const WRITE_ERROR_SHARING_VIOLATION_NOPROCESSFORPID = 47; const WRITE_ERROR_SHARING_VIOLATION_NOPID = 48; - const CERT_ATTR_CHECK_FAILED_NO_UPDATE = 100; const CERT_ATTR_CHECK_FAILED_HAS_UPDATE = 101; const BACKGROUNDCHECK_MULTIPLE_FAILURES = 110; @@ -1305,6 +1305,7 @@ function handleUpdateFailure(update, errorCode) { update.errorCode == SERVICE_STILL_APPLYING_ON_FAILURE || update.errorCode == SERVICE_UPDATER_NOT_FIXED_DRIVE || update.errorCode == SERVICE_COULD_NOT_LOCK_UPDATER || + update.errorCode == SERVICE_COULD_NOT_COPY_UPDATER || update.errorCode == SERVICE_INSTALLDIR_ERROR) { var failCount = getPref("getIntPref",