UnicodeString TConfiguration::GetVersionStr() const { UnicodeString Result; TGuard Guard(FCriticalSection); try { TVSFixedFileInfo * Info = GetFixedApplicationInfo(); /*return FMTLOAD(VERSION, HIWORD(Info->dwFileVersionMS), LOWORD(Info->dwFileVersionMS), HIWORD(Info->dwFileVersionLS), LOWORD(Info->dwFileVersionLS));*/ UnicodeString BuildStr; if (!GetIsUnofficial()) { BuildStr = LoadStr(VERSION_BUILD); } else { #ifdef _DEBUG BuildStr = LoadStr(VERSION_DEBUG_BUILD); #else BuildStr = LoadStr(VERSION_DEV_BUILD); #endif } int Build = LOWORD(Info->dwFileVersionLS); if (Build > 0) { BuildStr += L" " + ::IntToStr(Build); } // #ifndef BUILD_OFFICIAL // UnicodeString BuildDate = __DATE__; // UnicodeString MonthStr = CutToChar(BuildDate, L' ', true); // int Month = ParseShortEngMonthName(MonthStr); // int Day = StrToInt64(CutToChar(BuildDate, L' ', true)); // int Year = StrToInt64(Trim(BuildDate)); // UnicodeString DateStr = FORMAT("%d-%2.2d-%2.2d", Year, Month, Day); // AddToList(BuildStr, DateStr, L" "); // #endif Result = FMTLOAD(VERSION2, GetVersion().c_str(), Build); // #ifndef BUILD_OFFICIAL // Result += L" " + LoadStr(VERSION_DONT_DISTRIBUTE); // #endif } catch (Exception & E) { throw ExtException(&E, "Can't get application version"); } return Result; }
UnicodeString TConfiguration::GetProductVersionStr() const { UnicodeString Result; #ifndef __linux__ TGuard Guard(FCriticalSection); try { TVSFixedFileInfo * Info = GetFixedApplicationInfo(); /*return FMTLOAD(VERSION, HIWORD(Info->dwFileVersionMS), LOWORD(Info->dwFileVersionMS), HIWORD(Info->dwFileVersionLS), LOWORD(Info->dwFileVersionLS));*/ UnicodeString BuildStr; if (!GetIsUnofficial()) { BuildStr = LoadStr(VERSION_BUILD); } else { #ifdef _DEBUG BuildStr = LoadStr(VERSION_DEBUG_BUILD); #else BuildStr = LoadStr(VERSION_DEV_BUILD); #endif } int Build = LOWORD(Info->dwFileVersionLS); if (Build > 0) { BuildStr += L" " + ::IntToStr(Build); } #if 0 #ifndef BUILD_OFFICIAL UnicodeString BuildDate = __DATE__; UnicodeString MonthStr = CutToChar(BuildDate, L' ', true); int Month = ParseShortEngMonthName(MonthStr); int Day = StrToInt64(CutToChar(BuildDate, L' ', true)); int Year = StrToInt64(Trim(BuildDate)); UnicodeString DateStr = FORMAT("%d-%2.2d-%2.2d", Year, Month, Day); AddToList(BuildStr, DateStr, L" "); #endif #endif UnicodeString FullVersion = GetProductVersion(); UnicodeString AReleaseType = GetReleaseType(); if (DebugAlwaysTrue(!AReleaseType.IsEmpty()) && !SameText(AReleaseType, L"stable") && !SameText(AReleaseType, L"development")) { FullVersion += L" " + AReleaseType; } Result = FMTLOAD(VERSION2, GetProductVersion().c_str(), Build); #if 0 #ifndef BUILD_OFFICIAL Result += L" " + LoadStr(VERSION_DONT_DISTRIBUTE); #endif #endif } catch (Exception & E) { throw ExtException(&E, "Can't get application version"); } #endif return Result; }