Backed out changeset 2fd5aae2c05a (bug 1769265) for causing xpcshell failures on win 2004 CLOSED TREE

This commit is contained in:
Cristian Tuns
2022-10-27 13:25:48 -04:00
parent c7ff5dad24
commit 698f6bd3a6
6 changed files with 44 additions and 28 deletions

View File

@@ -94,10 +94,13 @@ async function init(aEvent) {
let channelLabel = document.getElementById("currentChannel");
let currentChannelText = document.getElementById("currentChannelText");
channelLabel.value = UpdateUtils.UpdateChannel;
if (
/^release($|\-)/.test(channelLabel.value) ||
Services.sysinfo.getProperty("isPackagedApp")
) {
let hasWinPackageId = false;
try {
hasWinPackageId = Services.sysinfo.getProperty("hasWinPackageId");
} catch (_ex) {
// The hasWinPackageId property doesn't exist; assume it should be false.
}
if (/^release($|\-)/.test(channelLabel.value) || hasWinPackageId) {
currentChannelText.hidden = true;
}
}

View File

@@ -191,8 +191,14 @@ if (AppConstants.MOZ_UPDATER) {
}
}
XPCOMUtils.defineLazyGetter(this, "gIsPackagedApp", () => {
return Services.sysinfo.getProperty("isPackagedApp");
XPCOMUtils.defineLazyGetter(this, "gHasWinPackageId", () => {
let hasWinPackageId = false;
try {
hasWinPackageId = Services.sysinfo.getProperty("hasWinPackageId");
} catch (_ex) {
// The hasWinPackageId property doesn't exist; assume it would be false.
}
return hasWinPackageId;
});
// A promise that resolves when the list of application handlers is loaded.
@@ -630,7 +636,7 @@ var gMainPane = {
let updateDisabled =
Services.policies && !Services.policies.isAllowed("appUpdate");
if (gIsPackagedApp) {
if (gHasWinPackageId) {
// When we're running inside an app package, there's no point in
// displaying any update content here, and it would get confusing if we
// did, because our updater is not enabled.
@@ -1867,7 +1873,7 @@ var gMainPane = {
if (
AppConstants.MOZ_UPDATER &&
(!Services.policies || Services.policies.isAllowed("appUpdate")) &&
!gIsPackagedApp
!gHasWinPackageId
) {
let radiogroup = document.getElementById("updateRadioGroup");
@@ -1887,7 +1893,7 @@ var gMainPane = {
if (
AppConstants.MOZ_UPDATER &&
(!Services.policies || Services.policies.isAllowed("appUpdate")) &&
!gIsPackagedApp
!gHasWinPackageId
) {
let radiogroup = document.getElementById("updateRadioGroup");
let updateAutoValue = radiogroup.value == "true";
@@ -1927,7 +1933,7 @@ var gMainPane = {
// properly if per-installation prefs aren't supported.
UpdateUtils.PER_INSTALLATION_PREFS_SUPPORTED &&
(!Services.policies || Services.policies.isAllowed("appUpdate")) &&
!gIsPackagedApp &&
!gHasWinPackageId &&
!UpdateUtils.appUpdateSettingIsLocked("app.update.background.enabled")
);
},

View File

@@ -443,7 +443,12 @@ class AppUpdater {
// may not be, and we don't have a good way to tell the difference from here,
// so we err to the side of less confusion for unmanaged users.
get #updateDisabledByPackage() {
return Services.sysinfo.getProperty("isPackagedApp");
try {
return Services.sysinfo.getProperty("hasWinPackageId");
} catch (_ex) {
// The hasWinPackageId property doesn't exist; assume it would be false.
}
return false;
}
// true when updating in background is enabled.

View File

@@ -44,7 +44,13 @@ window.addEventListener("load", function onload(event) {
populateActionBox();
setupEventListeners();
if (Services.sysinfo.getProperty("isPackagedApp")) {
let hasWinPackageId = false;
try {
hasWinPackageId = Services.sysinfo.getProperty("hasWinPackageId");
} catch (_ex) {
// The hasWinPackageId property doesn't exist; assume it would be false.
}
if (hasWinPackageId) {
$("update-dir-row").hidden = true;
$("update-history-row").hidden = true;
}

View File

@@ -3860,10 +3860,16 @@ UpdateService.prototype = {
* See nsIUpdateService.idl
*/
get disabled() {
let hasWinPackageId = false;
try {
hasWinPackageId = Services.sysinfo.getProperty("hasWinPackageId");
} catch (_ex) {
// The hasWinPackageId property doesn't exist; assume it would be false.
}
return (
(Services.policies && !Services.policies.isAllowed("appUpdate")) ||
this.disabledForTesting ||
Services.sysinfo.getProperty("isPackagedApp")
hasWinPackageId
);
},

View File

@@ -50,7 +50,6 @@
#ifdef MOZ_WIDGET_GTK
# include <gtk/gtk.h>
# include <dlfcn.h>
# include "mozilla/WidgetUtilsGtk.h"
#endif
#if defined(XP_LINUX) && !defined(ANDROID)
@@ -935,7 +934,9 @@ nsresult nsSystemInfo::Init() {
}
}
SetPropertyAsBool(u"isPackagedApp"_ns, false);
rv = SetPropertyAsBool(NS_ConvertASCIItoUTF16("hasWindowsTouchInterface"),
false);
NS_ENSURE_SUCCESS(rv, rv);
// Additional informations not available through PR_GetSystemInfo.
SetInt32Property(u"pagesize"_ns, PR_GetPageSize());
@@ -976,9 +977,8 @@ nsresult nsSystemInfo::Init() {
return rv;
}
boolean hasPackageIdentity = true;
rv = SetPropertyAsBool(u"hasWinPackageId"_ns, hasPackageIdentity);
rv = SetPropertyAsBool(u"hasWinPackageId"_ns,
widget::WinUtils::HasPackageIdentity());
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
@@ -989,11 +989,6 @@ nsresult nsSystemInfo::Init() {
return rv;
}
rv = SetPropertyAsBool(u"isPackagedApp"_ns, hasPackageIdentity);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
# ifndef __MINGW32__
nsAutoString avInfo, antiSpyInfo, firewallInfo;
if (NS_SUCCEEDED(
@@ -1096,11 +1091,6 @@ nsresult nsSystemInfo::Init() {
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
rv = SetPropertyAsBool(u"isPackagedApp"_ns,
widget::IsRunningUnderFlatpakOrSnap());
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
#endif
#ifdef MOZ_WIDGET_ANDROID