
commit ac15e62dc45841a3a21f091fcfa3dc0e455ed637 Author: Kathy Brade <brade@pearlcrescent.com> Date: Thu Sep 17 11:15:41 2015 -0400 Bug 16906: Don't depend on Windows crypto DLLs If not building the Windows Maintenance Service, avoid a dependency on crypt32.dll and wintrust.dll. Also, avoid setting sUsingService inside the updater code; this ensures that all Maintenance Service related codepaths are skipped. --- toolkit/mozapps/update/common/moz.build | 7 +++++-- toolkit/mozapps/update/common/sources.mozbuild | 15 +++++++++------ toolkit/mozapps/update/updater/updater.cpp | 6 ++++++ 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/toolkit/mozapps/update/common/moz.build b/toolkit/mozapps/update/common/moz.build index a977b0f..4beb56a 100644 --- a/toolkit/mozapps/update/common/moz.build +++ b/toolkit/mozapps/update/common/moz.build @@ -12,13 +12,16 @@ EXPORTS += [ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows': EXPORTS += [ - 'certificatecheck.h', 'pathhash.h', - 'registrycertificates.h', 'uachelper.h', 'updatehelper.cpp', 'updatehelper.h', ] + if CONFIG['MOZ_MAINTENANCE_SERVICE']: + EXPORTS += [ + 'certificatecheck.h', + 'registrycertificates.h', + ] Library('updatecommon') diff --git a/toolkit/mozapps/update/common/sources.mozbuild b/toolkit/mozapps/update/common/sources.mozbuild index 7ec1aff..6b8a9e3 100644 --- a/toolkit/mozapps/update/common/sources.mozbuild +++ b/toolkit/mozapps/update/common/sources.mozbuild @@ -6,16 +6,19 @@ sources = [] if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows': sources += [ - 'certificatecheck.cpp', 'pathhash.cpp', - 'registrycertificates.cpp', 'uachelper.cpp', 'updatehelper.cpp', ] - OS_LIBS += [ - 'crypt32', - 'wintrust', - ] + if CONFIG['MOZ_MAINTENANCE_SERVICE']: + sources += [ + 'certificatecheck.cpp', + 'registrycertificates.cpp', + ] + OS_LIBS += [ + 'crypt32', + 'wintrust', + ] sources += [ 'readstrings.cpp', diff --git a/toolkit/mozapps/update/updater/updater.cpp b/toolkit/mozapps/update/updater/updater.cpp index 9a01203..31a5dac 100644 --- a/toolkit/mozapps/update/updater/updater.cpp +++ b/toolkit/mozapps/update/updater/updater.cpp @@ -129,7 +129,9 @@ static bool sUseHardLinks = true; #endif #ifdef XP_WIN +#ifdef MOZ_MAINTENANCE_SERVICE #include "registrycertificates.h" +#endif BOOL PathAppendSafe(LPWSTR base, LPCWSTR extra); BOOL PathGetSiblingFilePath(LPWSTR destinationBuffer, LPCWSTR siblingFilePath, @@ -2031,6 +2033,7 @@ LaunchWinPostProcess(const WCHAR *installationDir, return false; } +#ifdef MOZ_MAINTENANCE_SERVICE // TEST_UPDATER is not available on esr38 //#if !defined(TEST_UPDATER) if (sUsingService && @@ -2038,6 +2041,7 @@ LaunchWinPostProcess(const WCHAR *installationDir, return false; } //#endif +#endif WCHAR dlogFile[MAX_PATH + 1]; if (!PathGetSiblingFilePath(dlogFile, exefullpath, L"uninstall.update")) { @@ -2981,8 +2985,10 @@ int NS_main(int argc, NS_tchar **argv) const int callbackIndex = 6; #if defined(XP_WIN) +#ifdef MOZ_MAINTENANCE_SERVICE sUsingService = getenv("MOZ_USING_SERVICE") != nullptr; putenv(const_cast<char*>("MOZ_USING_SERVICE=")); +#endif // lastFallbackError keeps track of the last error for the service not being // used, in case of an error when fallback is not enabled we write the // error to the update.status file.
participants (1)
-
gk@torproject.org