From bb2947dd29e9cef07f67fd67503311c3b35c551c Mon Sep 17 00:00:00 2001 From: DeaTh-G Date: Wed, 19 Mar 2025 12:32:52 +0100 Subject: [PATCH] change to GetModuleFileNameW instead --- UnleashedRecomp/main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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