diff --git a/UnleashedRecomp/main.cpp b/UnleashedRecomp/main.cpp index 34d9bce4..4149a4e4 100644 --- a/UnleashedRecomp/main.cpp +++ b/UnleashedRecomp/main.cpp @@ -185,7 +185,10 @@ void SetWorkingDirectoryToExecutable() std::filesystem::path exePath; #ifdef _WIN32 - exePath = std::filesystem::canonical(std::filesystem::path(_pgmptr)); + wchar_t path[MAX_PATH]; + GetModuleFileNameW(NULL, path, sizeof(path)); + + exePath = path; #else exePath = std::filesystem::canonical("/proc/self/exe"); #endif