| 20 | } |
| 21 | static bool RunPath(std::wstring path = L"") { if (path.size()) return SetCurrentDirectoryW(path.c_str()); else return SetCurrentDirectoryW(Path::RemoveFile(exePath()).c_str()); } |
| 22 | static std::wstring exePath() { PATH_BUFFERW(path); GetModuleFileNameW(0, path, PATH_BUFFER_SIZE); return path; } |
| 23 | static std::wstring exeName() { return Path::GetFile(exePath()); } |
| 24 | static bool isRunning(const std::wstring& mutexName) { HANDLE handle = CreateMutexW(0, 0, mutexName.c_str()); if (GetLastError() == ERROR_ALREADY_EXISTS) { CloseHandle(handle); return true; } if (handle) CloseHandle(handle); return false; } |
| 25 | static void RunOnce(LPCWSTR mutexName) { HANDLE handle = CreateMutexW(0, 0, mutexName); if (GetLastError() == ERROR_ALREADY_EXISTS) { CloseHandle(handle); exit(0); } } |
nothing calls this directly
no outgoing calls
no test coverage detected