Pier Angelo Vendrame pushed to branch mullvad-browser-115.7.0esr-13.5-1 at The Tor Project / Applications / Mullvad Browser
Commits: 3ea5b1dc by Pier Angelo Vendrame at 2024-02-07T15:27:23+00:00 fixup! Bug 9173: Change the default Firefox profile directory to be relative.
Add a method to query whether the browser is in portable mode.
- - - - - 7c5facb8 by Pier Angelo Vendrame at 2024-02-07T15:27:23+00:00 fixup! Bug 4234: Use the Firefox Update Process for Base Browser.
Allow running the postupdate process and change the update directory for when not running in portable mode.
- - - - - 438c7fe9 by Pier Angelo Vendrame at 2024-02-07T15:27:23+00:00 fixup! MB 112: Updater customization for Mullvad Browser
MB 200: Enable system installs for Mullvad Browser
Customize the post update executable name, to avoid any confusion with Mozilla's helper.exe, since we intend using a much simpler post update binary.
- - - - -
4 changed files:
- browser/installer/windows/nsis/updater_append.ini - toolkit/mozapps/update/updater/updater.cpp - toolkit/xre/nsIXREDirProvider.idl - toolkit/xre/nsXREDirProvider.cpp
Changes:
===================================== browser/installer/windows/nsis/updater_append.ini ===================================== @@ -7,6 +7,8 @@ [PostUpdateWin] ; ExeRelPath is the path to the PostUpdateWin executable relative to the ; application executable. -ExeRelPath=uninstall\helper.exe +ExeRelPath=postupdate.exe ; ExeArg is the argument to pass to the PostUpdateWin exe +; We do not need any argument, but an empty string here will make updater.exe +; not run this step. ExeArg=/PostUpdate
===================================== toolkit/mozapps/update/updater/updater.cpp ===================================== @@ -2807,7 +2807,7 @@ int LaunchCallbackAndPostProcessApps(int argc, NS_tchar** argv, #endif
if (argc > callbackIndex) { -#if defined(XP_WIN) && !defined(BASE_BROWSER_UPDATE) +#if defined(XP_WIN) if (gSucceeded) { if (!LaunchWinPostProcess(gInstallDirPath, gPatchDirPath)) { fprintf(stderr, "The post update process was not launched");
===================================== toolkit/xre/nsIXREDirProvider.idl ===================================== @@ -20,4 +20,9 @@ interface nsIXREDirProvider : nsISupports * Gets the hash for the current installation directory. */ AString getInstallHash(); + + /** + * Tells whether the browser has been started in portable mode. + */ + readonly attribute bool isPortableMode; };
===================================== toolkit/xre/nsXREDirProvider.cpp ===================================== @@ -1109,7 +1109,14 @@ nsresult nsXREDirProvider::GetUpdateRootDir(nsIFile** aResult, rv = GetUserDataDirectory(getter_AddRefs(updRoot), false); NS_ENSURE_SUCCESS(rv, rv); # else - rv = GetUserDataDirectoryHome(getter_AddRefs(updRoot), false); + bool isPortable = true; + rv = GetIsPortableMode(&isPortable); + NS_ENSURE_SUCCESS(rv, rv); + if (isPortable) { + rv = GetUserDataDirectoryHome(getter_AddRefs(updRoot), false); + } else { + rv = GetUserDataDirectory(getter_AddRefs(updRoot), true); + } NS_ENSURE_SUCCESS(rv, rv); # endif rv = updRoot->AppendNative("UpdateInfo"_ns); @@ -1324,6 +1331,20 @@ nsresult nsXREDirProvider::GetPortableDataDir(nsIFile** aFile, } #endif
+NS_IMETHODIMP nsXREDirProvider::GetIsPortableMode(bool* aIsPortableMode) { +#ifdef RELATIVE_DATA_DIR + if (gDataDirPortable) { + *aIsPortableMode = *gDataDirPortable; + } else { + nsCOMPtr<nsIFile> dir; + GetPortableDataDir(getter_AddRefs(dir), *aIsPortableMode); + } +#else + *aIsPortableMode = false; +#endif + return NS_OK; +} + nsresult nsXREDirProvider::GetUserDataDirectoryHome(nsIFile** aFile, bool aLocal) { // Copied from nsAppFileLocationProvider (more or less)
View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/compare/7f2...
tbb-commits@lists.torproject.org