mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-28 21:38:01 +03:00
Implement RPCS3_CONFIG_DIR env variable (Win32)
Overrides config location, should end with / or \
This commit is contained in:
parent
bc27f5f75c
commit
20efed66e9
1 changed files with 3 additions and 2 deletions
|
@ -1384,8 +1384,9 @@ const std::string& fs::get_config_dir()
|
||||||
std::string dir;
|
std::string dir;
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
wchar_t buf[2048];
|
wchar_t buf[32768];
|
||||||
if (GetModuleFileName(NULL, buf, ::size32(buf)) - 1 >= ::size32(buf) - 1)
|
if (GetEnvironmentVariable(L"RPCS3_CONFIG_DIR", buf, std::size(buf)) - 1 >= std::size(buf) - 1 &&
|
||||||
|
GetModuleFileName(NULL, buf, std::size(buf)) - 1 >= std::size(buf) - 1)
|
||||||
{
|
{
|
||||||
MessageBoxA(0, fmt::format("GetModuleFileName() failed: error %u.", GetLastError()).c_str(), "fs::get_config_dir()", MB_ICONERROR);
|
MessageBoxA(0, fmt::format("GetModuleFileName() failed: error %u.", GetLastError()).c_str(), "fs::get_config_dir()", MB_ICONERROR);
|
||||||
return dir; // empty
|
return dir; // empty
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue