summaryrefslogtreecommitdiff
path: root/modules/mono
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2022-01-14 20:57:57 +0100
committerGitHub <noreply@github.com>2022-01-14 20:57:57 +0100
commitafaf0c98f87f1289653f42fc7f5b18409b26d0d6 (patch)
treea1ff889f54550caa4bb8319207e964db1c8273e6 /modules/mono
parentd5fb68bbaec6f20638b5c586b443fbb997b6b369 (diff)
parentfff3c38af92382d138426c2772257d8620071624 (diff)
Merge pull request #56762 from bruvzg/mac_fix_sc
Diffstat (limited to 'modules/mono')
-rw-r--r--modules/mono/godotsharp_dirs.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/modules/mono/godotsharp_dirs.cpp b/modules/mono/godotsharp_dirs.cpp
index 02739f0480..c0cd18e29d 100644
--- a/modules/mono/godotsharp_dirs.cpp
+++ b/modules/mono/godotsharp_dirs.cpp
@@ -68,7 +68,14 @@ String _get_mono_user_dir() {
} else {
String settings_path;
+ // Self-contained mode if a `._sc_` or `_sc_` file is present in executable dir.
String exe_dir = OS::get_singleton()->get_executable_path().get_base_dir();
+
+ // On macOS, look outside .app bundle, since .app bundle is read-only.
+ if (OS::get_singleton()->has_feature("macos") && exe_dir.ends_with("MacOS") && exe_dir.plus_file("..").simplify_path().ends_with("Contents")) {
+ exe_dir = exe_dir.plus_file("../../..").simplify_path();
+ }
+
DirAccessRef d = DirAccess::create_for_path(exe_dir);
if (d->file_exists("._sc_") || d->file_exists("_sc_")) {