From 24e31247afa25a7c66661a32fca7910203f0d08a Mon Sep 17 00:00:00 2001 From: Akash Mozumdar Date: Sun, 25 Nov 2018 21:40:19 -0500 Subject: [PATCH] fix current directory being wrong if launched in weird ways --- GUI/main.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/GUI/main.cpp b/GUI/main.cpp index 58fd6b8..c26a5e8 100644 --- a/GUI/main.cpp +++ b/GUI/main.cpp @@ -1,4 +1,5 @@ #include "mainwindow.h" +#include "misc.h" #include #include @@ -50,6 +51,8 @@ int main(int argc, char *argv[]) { AddVectoredExceptionHandler(FALSE, ExceptionLogger); SetUnhandledExceptionFilter((LPTOP_LEVEL_EXCEPTION_FILTER)Terminate); + QString exe = GetFullModuleName(GetCurrentProcessId()); + SetCurrentDirectoryW(exe.left(exe.lastIndexOf("\\")).toStdWString().c_str()); QApplication a(argc, argv); MainWindow w; w.show();