diff --git a/src/common/path_util.cpp b/src/common/path_util.cpp index 8d369fc7..16564ffd 100644 --- a/src/common/path_util.cpp +++ b/src/common/path_util.cpp @@ -82,11 +82,19 @@ static std::filesystem::path GetBundleParentDirectory() { static auto UserPaths = [] { #ifdef __APPLE__ - std::filesystem::current_path(GetBundleParentDirectory()); + const auto base_dir = GetBundleParentDirectory(); + const auto user_dir = base_dir / "user"; + if (std::filesystem::exists(base_dir)) { + return std::filesystem::path{user_dir}; + } else { + const auto base_dir = std::filesystem::path(getenv("HOME")) / "Library/Application Support/shadPS4"; + const auto user_dir = base_dir / "user"; + std::filesystem::create_directories(user_dir); + return user_dir; + } #endif std::unordered_map paths; - const auto user_dir = std::filesystem::current_path() / PORTABLE_DIR; const auto create_path = [&](PathType shad_path, const fs::path& new_path) { std::filesystem::create_directory(new_path); @@ -155,4 +163,4 @@ void SetUserPath(PathType shad_path, const fs::path& new_path) { UserPaths.insert_or_assign(shad_path, new_path); } -} // namespace Common::FS +} // namespace Common::FS \ No newline at end of file