Commit d07f4468 authored by Iulian Moraru's avatar Iulian Moraru
Browse files

Backed out 2 changesets (bug 1789390) for causing bc failures regarding...

Backed out 2 changesets (bug 1789390) for causing bc failures regarding unreferenced file on BackgroundTask_uninstall.jsm. CLOSED TREE

Backed out changeset 4cec525d92f4 (bug 1789390)
Backed out changeset 6fcec3502cb2 (bug 1789390)
parent 055516b0
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -416,15 +416,6 @@ Section "Uninstall"
  DetailPrint $(STATUS_UNINSTALL_MAIN)
  SetDetailsPrint none

  ; Some system cleanup is most easily handled when XPCOM functionality is
  ; available - e.g. removing notifications from Window's Action Center. We
  ; handle this in the `uninstall` background task.
  ;
  ; Return value is saved to an unused variable to prevent the the error flag
  ; from being set.
  Var /GLOBAL UnusedExecCatchReturn
  ExecWait '"$INSTDIR\${FileMainEXE}" --backgroundtask uninstall' $UnusedExecCatchReturn

  ; Delete the app exe to prevent launching the app while we are uninstalling.
  ClearErrors
  ${DeleteFile} "$INSTDIR\${FileMainEXE}"
+0 −41
Original line number Diff line number Diff line
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

var { AppConstants } = ChromeUtils.import(
  "resource://gre/modules/AppConstants.jsm"
);

var EXPORTED_SYMBOLS = ["runBackgroundTask"];
async function runBackgroundTask(commandLine) {
  if (AppConstants.platform !== "win") {
    console.log("Not a Windows install, skipping `uninstall` background task.");
    return;
  }
  console.log("Running BackgroundTask_uninstall.");

  removeNotifications();
}

function removeNotifications() {
  console.log("Removing Windows toast notifications.");

  if (!("nsIWindowsAlertsService" in Ci)) {
    console.log("nsIWindowsAlertService not present.");
    return;
  }

  let alertsService;
  try {
    alertsService = Cc["@mozilla.org/system-alerts-service;1"]
      .getService(Ci.nsIAlertsService)
      .QueryInterface(Ci.nsIWindowsAlertsService);
  } catch (e) {
    console.error("Error retrieving nsIWindowsAlertService: " + e.message);
    return;
  }

  alertsService.removeAllNotificationsForInstall();
  console.log("Finished removing Windows toast notifications.");
}
+0 −4
Original line number Diff line number Diff line
@@ -154,7 +154,3 @@ if CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
        "WindowsJumpLists.jsm",
        "WindowsPreviewPerTab.jsm",
    ]

    EXTRA_JS_MODULES.backgroundtasks += [
        "BackgroundTask_uninstall.jsm",
    ]
+2 −2
Original line number Diff line number Diff line
@@ -63,8 +63,8 @@ interface nsIAlertAction : nsISupports
   * we request Windows to process `action`.  At the time of writing, Windows
   * recognizes the following actions:
   *
   * - `action="dismiss"` dismisses the alert entirely.
   * - `action="snooze"` snoozes the alert, generally making it disappear before
   * - `action="dismiss"` dismisses the alert entirely;
   * - "action="snooze"` snoozes the alert, generally making it disappear before
   *   reappearing a Windows-determined amount of time later.
   *
   * On non-Windows, this field is ignored.
+0 −7
Original line number Diff line number Diff line
@@ -50,11 +50,4 @@ interface nsIWindowsAlertsService : nsIAlertsService
   */
  AString getXmlStringForWindowsAlert(in nsIAlertNotification aAlert,
                                      [optional] in AString aWindowsTag);

  /**
   * Removes all action center and snoozed notifications associated with this
   * install. Note that this removes all notifications regardless of which profile
   * they originated from.
   */
  void removeAllNotificationsForInstall();
};
Loading