summaryrefslogtreecommitdiffstats
path: root/toolkit/mozapps/update/common/commonupdatedir.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /toolkit/mozapps/update/common/commonupdatedir.h
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'toolkit/mozapps/update/common/commonupdatedir.h')
-rw-r--r--toolkit/mozapps/update/common/commonupdatedir.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/toolkit/mozapps/update/common/commonupdatedir.h b/toolkit/mozapps/update/common/commonupdatedir.h
new file mode 100644
index 0000000000..5d7f88b15e
--- /dev/null
+++ b/toolkit/mozapps/update/common/commonupdatedir.h
@@ -0,0 +1,39 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+#ifndef COMMONUPDATEDIR_H
+#define COMMONUPDATEDIR_H
+
+#include "mozilla/UniquePtr.h"
+
+#ifdef XP_WIN
+# include <windows.h>
+typedef WCHAR NS_tchar;
+#else
+typedef char NS_tchar;
+#endif
+
+bool GetInstallHash(const char16_t* installPath,
+ mozilla::UniquePtr<NS_tchar[]>& result);
+
+#ifdef XP_WIN
+// In addition to getting the update directory, this function also creates it.
+// This is to ensure that, when it is created, it is created with the correct
+// permissions. The default permissions on the containing directory can cause
+// problems, so it is very, very important that we make sure that the
+// permissions are set properly. Thus, we won't even give out the path of the
+// update directory without ensuring that it was created with the correct
+// permissions.
+HRESULT GetCommonUpdateDirectory(const wchar_t* installPath,
+ mozilla::UniquePtr<wchar_t[]>& result);
+// Returns the old common update directory. Since this directory was used before
+// we made sure to always set the correct permissions, it is possible that the
+// permissions on this directory are set such that files can only be modified
+// or deleted by the user that created them. This function exists entirely to
+// allow us to migrate files out of the old update directory and into the new
+// one.
+HRESULT GetOldUpdateDirectory(const wchar_t* installPath,
+ mozilla::UniquePtr<wchar_t[]>& result);
+#endif
+
+#endif