Commit d646ae03 authored by Pier Angelo Vendrame's avatar Pier Angelo Vendrame 🎃
Browse files

BB 41108: Remove privileged macOS installation

parent 90e50e2b
Loading
Loading
Loading
Loading
+7 −7
Changes for browser/app/moz.build: 7 added lines, 7 removed lines.
Original line number Diff line number Diff line
@@ -80,6 +80,12 @@ if CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa":
            f"!/{FINAL_TARGET}/org.mozilla.updater",
            "Library/LaunchServices/org.mozilla.updater",
        ))
    moves = [("ChannelPrefs.framework", "Frameworks/ChannelPrefs.framework")]
    if not CONFIG["BASE_BROWSER"]:
        moves.append((
            "org.mozilla.dmgInstallHelper",
            "Library/LaunchServices/org.mozilla.dmgInstallHelper",
        ))
    MacOSBundle(
        f"!/dist/{CONFIG['MOZ_MACBUNDLE_NAME']}",
        skeleton="macbuild/Contents",
@@ -93,13 +99,7 @@ if CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa":
            (f"!/{FINAL_TARGET}/{CONFIG['MOZ_APP_NAME']}", CONFIG["MOZ_APP_NAME"])
        ],
        extra_files=extra_files,
        moves=[
            ("ChannelPrefs.framework", "Frameworks/ChannelPrefs.framework"),
            (
                "org.mozilla.dmgInstallHelper",
                "Library/LaunchServices/org.mozilla.dmgInstallHelper",
            ),
        ],
        moves=moves,
        pkginfo="APPLTORB",
    )

+2 −1
Changes for toolkit/moz.build: 2 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -63,11 +63,12 @@ if CONFIG["MOZ_WIDGET_TOOLKIT"] == "gtk":
    ]
elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "cocoa":
    DIRS += [
        "mozapps/dmgInstallHelper",
        "mozapps/macos-frameworks",
        "system/commonproxy",
        "system/osxproxy",
    ]
    if not CONFIG["BASE_BROWSER"]:
        DIRS += ["mozapps/dmgInstallHelper"]
elif CONFIG["MOZ_WIDGET_TOOLKIT"] == "windows":
    DIRS += [
        "system/commonproxy",
+4 −0
Changes for toolkit/xre/MacRunFromDmgUtils.mm: 4 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -279,6 +279,7 @@ static void ShowInstallFailedDialog() {
  NS_OBJC_END_TRY_IGNORE_BLOCK;
}

#ifndef BASE_BROWSER_VERSION
// Install the DMGInstallHelper as an elevated helper and use it to install
bool LaunchElevatedDmgInstall(NSString* aBundlePath, NSString* aDestPath) {
  NS_OBJC_BEGIN_TRY_BLOCK_RETURN;
@@ -355,6 +356,7 @@ bool LaunchElevatedDmgInstall(NSString* aBundlePath, NSString* aDestPath) {

  NS_OBJC_END_TRY_BLOCK_RETURN(false);
}
#endif

// Note: both arguments are expected to contain the app name (to end with
// '.app').
@@ -381,6 +383,7 @@ static bool InstallFromPath(NSString* aBundlePath, NSString* aDestPath) {
  os_log_info(runFromDMGLogger, "Unelevated installation: %s",
              installSuccessful ? "success" : "failed");

#ifndef BASE_BROWSER_VERSION
  // The installation may have been unsuccessful if the user did not have the
  // rights to write to the Applications directory. Check for this situation and
  // launch an elevated helper application.
@@ -396,6 +399,7 @@ static bool InstallFromPath(NSString* aBundlePath, NSString* aDestPath) {
      return false;
    }
  }
#endif

  if (!installSuccessful) {
    os_log_error(runFromDMGLogger, "Unknown install failure.");