From a5616f038e4c5e04f00dce455e6a6f114e68d210 Mon Sep 17 00:00:00 2001
From: Tristan Walter <twalter@orn.mpg.de>
Date: Tue, 27 Oct 2020 18:32:04 +0100
Subject: [PATCH] windows

---
 Application/src/tracker/main.cpp | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/Application/src/tracker/main.cpp b/Application/src/tracker/main.cpp
index d66f8a7..81fcbbf 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
-- 
GitLab