diff --git a/src/main.cpp b/src/main.cpp index f754d99..407cfcc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,6 +1,7 @@ #include "includes.hpp" #include +#include #include #include @@ -502,7 +503,13 @@ HANDLE gdMutex; si.cb = sizeof(si); ZeroMemory(&pi, sizeof(pi)); - if (!CreateProcess(CCFileUtils::get()->fullPathForFilename("linux-input.exe"_spr, true).c_str(), NULL, NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi)) { + std::string path = "\"" + CCFileUtils::get()->fullPathForFilename("linux-input.exe"_spr, true) + "\""; + std::replace(path.begin(), path.end(), '\\', '/'); + + std::unique_ptr cmd(new char[path.size() + 1]); + strcpy(cmd.get(), path.c_str()); + + if (!CreateProcess(NULL, cmd.get(), NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi)) { log::error("Failed to launch Linux input program: {}", GetLastError()); CloseHandle(hMutex); CloseHandle(gdMutex);