зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 2 changesets (bug 1705726) for causing build bustages. CLOSED TREE
Backed out changeset 1454949d2d8b (bug 1705726) Backed out changeset 4a2629df75a4 (bug 1705726)
This commit is contained in:
Родитель
6a9bab4543
Коммит
8dfb644a92
|
@ -223,21 +223,6 @@ var BackgroundUpdate = {
|
|||
}
|
||||
}
|
||||
|
||||
let serviceRegKeyExists;
|
||||
try {
|
||||
serviceRegKeyExists = Cc["@mozilla.org/updates/update-processor;1"]
|
||||
.createInstance(Ci.nsIUpdateProcessor)
|
||||
.getServiceRegKeyExists();
|
||||
} catch (ex) {
|
||||
log.error(
|
||||
`${SLUG}: Failed to check for Maintenance Service Registry Key: ${ex}`
|
||||
);
|
||||
serviceRegKeyExists = false;
|
||||
}
|
||||
if (!serviceRegKeyExists) {
|
||||
reasons.push(this.REASON.SERVICE_REGISTRY_KEY_MISSING);
|
||||
}
|
||||
|
||||
return reasons;
|
||||
},
|
||||
|
||||
|
@ -549,8 +534,6 @@ BackgroundUpdate.REASON = {
|
|||
NO_APP_UPDATE_BACKGROUND_ENABLED: "app.update.background.enabled=false",
|
||||
NO_MOZ_BACKGROUNDTASKS: "MOZ_BACKGROUNDTASKS=0",
|
||||
NO_OMNIJAR: "no omnijar",
|
||||
SERVICE_REGISTRY_KEY_MISSING:
|
||||
"the maintenance service registry key is not present",
|
||||
WINDOWS_CANNOT_USUALLY_USE_BITS: "on Windows but cannot usually use BITS",
|
||||
};
|
||||
|
||||
|
|
|
@ -483,21 +483,6 @@ interface nsIUpdateProcessor : nsISupports
|
|||
* the permissions.
|
||||
*/
|
||||
void fixUpdateDirectoryPerms(in boolean useServiceOnFailure);
|
||||
|
||||
/**
|
||||
* The installer writes an installation-specific registry key if the
|
||||
* Maintenance Service can be used for this installation. This function checks
|
||||
* for that key's existence (it does not read or verify the key's contents).
|
||||
*
|
||||
* This function should only be called on Windows.
|
||||
*
|
||||
* @returns true if the registry key exists, false if it does not.
|
||||
* @throws NS_ERROR_NOT_AVAILABLE
|
||||
* If registry access fails.
|
||||
* @throws NS_ERROR_NOT_IMPLEMENTED
|
||||
* If this is called on a non-Windows platform.
|
||||
*/
|
||||
bool getServiceRegKeyExists();
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -133,7 +133,6 @@ if CONFIG["MOZ_WIDGET_TOOLKIT"] != "android":
|
|||
|
||||
UNIFIED_SOURCES += [
|
||||
"/toolkit/mozapps/update/common/commonupdatedir.cpp",
|
||||
"/toolkit/mozapps/update/common/pathhash.cpp",
|
||||
"AutoSQLiteLifetime.cpp",
|
||||
"Bootstrap.cpp",
|
||||
"CmdLineAndEnvUtils.cpp",
|
||||
|
|
|
@ -46,7 +46,6 @@
|
|||
# include <strsafe.h>
|
||||
# include "commonupdatedir.h"
|
||||
# include "nsWindowsHelpers.h"
|
||||
# include "pathhash.h"
|
||||
# define getcwd(path, size) _getcwd(path, size)
|
||||
# define getpid() GetCurrentProcessId()
|
||||
#elif defined(XP_UNIX)
|
||||
|
@ -1078,47 +1077,3 @@ void nsUpdateProcessor::UpdateDone() {
|
|||
|
||||
ShutdownWatcherThread();
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsUpdateProcessor::GetServiceRegKeyExists(bool* aResult) {
|
||||
#ifndef XP_WIN
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else // #ifdef XP_WIN
|
||||
nsCOMPtr<nsIProperties> dirSvc(
|
||||
do_GetService("@mozilla.org/file/directory_service;1"));
|
||||
NS_ENSURE_TRUE(dirSvc, NS_ERROR_SERVICE_NOT_AVAILABLE);
|
||||
|
||||
nsCOMPtr<nsIFile> installBin;
|
||||
nsresult rv = dirSvc->Get(XRE_EXECUTABLE_FILE, NS_GET_IID(nsIFile),
|
||||
getter_AddRefs(installBin));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIFile> installDir;
|
||||
rv = installBin->GetParent(getter_AddRefs(installDir));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsAutoString installPath;
|
||||
rv = installDir->GetPath(installPath);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
wchar_t maintenanceServiceKey[MAX_PATH + 1];
|
||||
BOOL success = CalculateRegistryPathFromFilePath(
|
||||
PromiseFlatString(installPath).get(), maintenanceServiceKey);
|
||||
NS_ENSURE_TRUE(success, NS_ERROR_FAILURE);
|
||||
|
||||
HKEY regHandle;
|
||||
LSTATUS ls = RegOpenKeyExW(HKEY_LOCAL_MACHINE, maintenanceServiceKey, 0,
|
||||
KEY_QUERY_VALUE | KEY_WOW64_64KEY, ®Handle);
|
||||
if (ls == ERROR_SUCCESS) {
|
||||
RegCloseKey(regHandle);
|
||||
*aResult = true;
|
||||
return NS_OK;
|
||||
}
|
||||
if (ls == ERROR_FILE_NOT_FOUND) {
|
||||
*aResult = false;
|
||||
return NS_OK;
|
||||
}
|
||||
// We got an error we weren't expecting reading the registry.
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
#endif // #ifdef XP_WIN
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче