diff --git a/Application/src/tracker/main.cpp b/Application/src/tracker/main.cpp index d66f8a7ba89252a6eac04af43540e1697932a498..81fcbbf6b4071cbd4a2339a2083e392e4c0f0dbc 100644 --- a/Application/src/tracker/main.cpp +++ b/Application/src/tracker/main.cpp @@ -542,11 +542,23 @@ int main(int argc, char** argv) #endif auto exec = wd.str() + " " + opening_result.cmd; Debug("Executing '%S'", &exec); + +#if defined(WIN32) + STARTUPINFO info={sizeof(info)}; + PROCESS_INFORMATION processInfo; + if (CreateProcess(wd.c_str(), opening_result.cmd.c_str(), NULL, NULL, TRUE, 0, NULL, NULL, &info, &processInfo)) + { + WaitForSingleObject(processInfo.hProcess, INFINITE); + CloseHandle(processInfo.hProcess); + CloseHandle(processInfo.hThread); + } +#else auto pid = fork(); if(pid == 0) { file::exec(exec.c_str()); exit(0); } +#endif return 0; } } else