| 25 | } |
| 26 | |
| 27 | std::wstring getCurrentExecutableDir() { |
| 28 | wchar_t exeFilePathBuf[MAX_PATH]; |
| 29 | DWORD len = GetModuleFileNameW(NULL, exeFilePathBuf, MAX_PATH); |
| 30 | exeFilePathBuf[len] = '\0'; |
| 31 | |
| 32 | // strip the filename part to get dir path |
| 33 | wchar_t* p = wcsrchr(exeFilePathBuf, '\\'); |
| 34 | if (p) { |
| 35 | *p = '\0'; |
| 36 | } |
| 37 | return exeFilePathBuf; |
| 38 | } |
| 39 | |
| 40 | std::wstring getAppLocalDir() { |
| 41 | wchar_t* appLocalDataDirPath = nullptr; |