[tbb-commits] [Git][tpo/applications/mullvad-browser][mullvad-browser-115.7.0esr-13.5-1] 3 commits: fixup! Bug 9173: Change the default Firefox profile directory to be relative.

Pier Angelo Vendrame (@pierov) git at gitlab.torproject.org
Wed Feb 7 15:29:34 UTC 2024



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/7f263eaf4ddd8aff810851c6e6f762cd4ad6fec6...438c7fe99901f2e564af10b16dcd2b3c42033469

-- 
View it on GitLab: https://gitlab.torproject.org/tpo/applications/mullvad-browser/-/compare/7f263eaf4ddd8aff810851c6e6f762cd4ad6fec6...438c7fe99901f2e564af10b16dcd2b3c42033469
You're receiving this email because of your account on gitlab.torproject.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.torproject.org/pipermail/tbb-commits/attachments/20240207/26e7821b/attachment-0001.htm>


More information about the tbb-commits mailing list