diff options
| author | Yuri Sizov <11782833+YuriSizov@users.noreply.github.com> | 2023-03-27 20:14:47 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-03-27 20:14:47 +0200 |
| commit | 19501f8eb19481b029f67ecf78e711d42f2fc431 (patch) | |
| tree | 933ea3320b35bce6ba65ab1e1d1aa8ad662c90d4 /editor/editor_paths.cpp | |
| parent | cacf49999e3fb37281d66cc591ca8bebc5712d4d (diff) | |
| parent | 843f5adbc523ad2511322b4f09b5ce5a3fb9e225 (diff) | |
Merge pull request #75397 from YuriSizov/4.0-cherrypicks
Cherry-picks for the 4.0 branch (future 4.0.2) - 1st batch
Diffstat (limited to 'editor/editor_paths.cpp')
| -rw-r--r-- | editor/editor_paths.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/editor/editor_paths.cpp b/editor/editor_paths.cpp index 389c16fd66..d5ba841801 100644 --- a/editor/editor_paths.cpp +++ b/editor/editor_paths.cpp @@ -117,14 +117,20 @@ EditorPaths::EditorPaths() { // Self-contained mode if a `._sc_` or `_sc_` file is present in executable dir. String exe_path = OS::get_singleton()->get_executable_path().get_base_dir(); + Ref<DirAccess> d = DirAccess::create_for_path(exe_path); + if (d->file_exists(exe_path + "/._sc_")) { + self_contained = true; + self_contained_file = exe_path + "/._sc_"; + } else if (d->file_exists(exe_path + "/_sc_")) { + self_contained = true; + self_contained_file = exe_path + "/_sc_"; + } // On macOS, look outside .app bundle, since .app bundle is read-only. + // Note: This will not work if Gatekeeper path randomization is active. if (OS::get_singleton()->has_feature("macos") && exe_path.ends_with("MacOS") && exe_path.path_join("..").simplify_path().ends_with("Contents")) { exe_path = exe_path.path_join("../../..").simplify_path(); - } - { - Ref<DirAccess> d = DirAccess::create_for_path(exe_path); - + d = DirAccess::create_for_path(exe_path); if (d->file_exists(exe_path + "/._sc_")) { self_contained = true; self_contained_file = exe_path + "/._sc_"; |