From 0e356801e7648788ca332d5b350421c40ec9e8cc Mon Sep 17 00:00:00 2001 From: Peter Repukat Date: Mon, 30 Jan 2023 19:15:49 +0100 Subject: [PATCH] common: utils: add util to get executableDir --- common/util.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/common/util.h b/common/util.h index b12da09..148dfbe 100644 --- a/common/util.h +++ b/common/util.h @@ -73,6 +73,14 @@ namespace util { std::filesystem::create_directories(path); return path; } + + inline std::filesystem::path getGlosSIDir() + { + wchar_t result[MAX_PATH]; + std::filesystem::path res{ std::wstring{result, GetModuleFileNameW(NULL, result, MAX_PATH)} }; + return res.parent_path(); + } + } #ifdef _WIN32