diff --git a/RetroFE/Source/Execute/Launcher.cpp b/RetroFE/Source/Execute/Launcher.cpp index 4a7b4dd..6cca4ba 100644 --- a/RetroFE/Source/Execute/Launcher.cpp +++ b/RetroFE/Source/Execute/Launcher.cpp @@ -153,6 +153,12 @@ bool Launcher::ExecuteCommand(std::string executable, std::string args, std::str if(!CreateProcess(NULL, applicationName, NULL, NULL, FALSE, CREATE_NO_WINDOW, NULL, currDir, &startupInfo, &processInfo)) #else + if (executable.find_last_of("/") != std::string::npos) + { + std::string workDir = executable.substr(0,executable.find_last_of("/")); + std::string progName = executable.substr(executable.find_last_of("/") + 1); + executionString="cd \"" + workDir + "\" && exec \"./" + progName + "\" " + args; + } if(system(executionString.c_str()) != 0) #endif {