Skip to content

Commit 4a22e20

Browse files
committed
support for global user folder on Windows
1 parent 49c979c commit 4a22e20

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

modules/Common.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212

1313
#ifndef MAX_PATH
1414
#ifdef _WIN32
15+
#include <Shlobj.h>
16+
#include <windows.h>
1517
// This is the maximum number of UTF-16 code units permissible in Windows file paths
1618
#define MAX_PATH 260
1719
#else
@@ -42,6 +44,10 @@ std::filesystem::path GetShadUserDir() {
4244
} else {
4345
user_dir = std::filesystem::path(getenv("HOME")) / ".local" / "share" / "shadPS4";
4446
}
47+
#elif _WIN32
48+
TCHAR appdata[MAX_PATH] = {0};
49+
SHGetFolderPath(NULL, CSIDL_APPDATA, NULL, 0, appdata);
50+
user_dir = std::filesystem::path(appdata) / "shadPS4";
4551
#endif
4652
}
4753
return user_dir;

0 commit comments

Comments
 (0)