Add global windows user folder

This commit is contained in:
rainmakerv2 2025-03-04 16:17:06 +08:00
parent 517d7f04c6
commit 15304ef913

View File

@ -17,6 +17,8 @@
#ifdef _WIN32 #ifdef _WIN32
// This is the maximum number of UTF-16 code units permissible in Windows file paths // This is the maximum number of UTF-16 code units permissible in Windows file paths
#define MAX_PATH 260 #define MAX_PATH 260
#include <Shlobj.h>
#include <windows.h>
#else #else
// This is the maximum number of UTF-8 code units permissible in all other OSes' file paths // This is the maximum number of UTF-8 code units permissible in all other OSes' file paths
#define MAX_PATH 1024 #define MAX_PATH 1024
@ -106,6 +108,10 @@ static auto UserPaths = [] {
} else { } else {
user_dir = std::filesystem::path(getenv("HOME")) / ".local" / "share" / "shadPS4"; user_dir = std::filesystem::path(getenv("HOME")) / ".local" / "share" / "shadPS4";
} }
#elif _WIN32
TCHAR appdata[MAX_PATH] = {0};
SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, 0, appdata);
user_dir = std::filesystem::path(appdata) / "shadPS4";
#endif #endif
} }