| 223 | } |
| 224 | |
| 225 | std::wstring GetBinaryPath(bool includeExeName) |
| 226 | { |
| 227 | static const int MAX_PATH_LENGTH = 1024; |
| 228 | wchar_t fileName[MAX_PATH_LENGTH] = {}; |
| 229 | |
| 230 | if (!GetModuleFileNameW(nullptr, fileName, MAX_PATH_LENGTH)) |
| 231 | { |
| 232 | TENLog("Can't get current assembly path", LogLevel::Error); |
| 233 | return std::wstring(); |
| 234 | } |
| 235 | |
| 236 | auto result = std::wstring(fileName); |
| 237 | std::replace(result.begin(), result.end(), '\\', '/'); |
| 238 | |
| 239 | if (includeExeName) |
| 240 | return result; |
| 241 | |
| 242 | size_t pos = result.find_last_of(L"/"); |
| 243 | return (pos != std::wstring::npos) ? result.substr(0, pos + 1) : std::wstring(); |
| 244 | } |
| 245 | |
| 246 | std::vector<unsigned short> GetProductOrFileVersion(bool productVersion) |
| 247 | { |
no test coverage detected