mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-06-15 23:23:14 +00:00
Add global/common user folder for Windows (#2589)
* Add global windows user folder * Add button for creating portable folder * Add notice about restarting after creating the portable folder --------- Co-authored-by: rainmakerv2 <30595646+jpau02@users.noreply.github.com>
This commit is contained in:
parent
c2adaf41c0
commit
a4b35f275c
3 changed files with 92 additions and 17 deletions
|
@ -17,6 +17,8 @@
|
|||
#ifdef _WIN32
|
||||
// This is the maximum number of UTF-16 code units permissible in Windows file paths
|
||||
#define MAX_PATH 260
|
||||
#include <Shlobj.h>
|
||||
#include <windows.h>
|
||||
#else
|
||||
// This is the maximum number of UTF-8 code units permissible in all other OSes' file paths
|
||||
#define MAX_PATH 1024
|
||||
|
@ -106,6 +108,10 @@ static auto UserPaths = [] {
|
|||
} else {
|
||||
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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue