From 1a12b1f1f6256139427c2516d314f25c593087c5 Mon Sep 17 00:00:00 2001 From: Thomas Tanner Date: Wed, 4 Nov 2015 21:39:14 +0000 Subject: Decided it shouldn't be an error if i can't get information about the file. --- src/gameinfoimpl.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/gameinfoimpl.cpp') diff --git a/src/gameinfoimpl.cpp b/src/gameinfoimpl.cpp index 979e6c8d..98b0fddf 100644 --- a/src/gameinfoimpl.cpp +++ b/src/gameinfoimpl.cpp @@ -63,20 +63,20 @@ QString GetAppVersion(std::wstring const &app_name) DWORD info_len = ::GetFileVersionInfoSizeW(app_name.c_str(), &handle); if (info_len == 0) { qDebug("GetFileVersionInfoSizeW Error %d", ::GetLastError()); - throw std::runtime_error("Failed to get version info"); + return ""; } std::vector buff(info_len); if( ! ::GetFileVersionInfoW(app_name.c_str(), handle, info_len, buff.data())) { qDebug("GetFileVersionInfoW Error %d", ::GetLastError()); - throw std::runtime_error("Failed to get version info"); + return ""; } VS_FIXEDFILEINFO *pFileInfo; UINT buf_len; if ( ! ::VerQueryValueW(buff.data(), L"\\", reinterpret_cast(&pFileInfo), &buf_len)) { qDebug("VerQueryValueW Error %d", ::GetLastError()); - throw std::runtime_error("Failed to get version info"); + return ""; } return QString("%1.%2.%3.%4").arg(HIWORD(pFileInfo->dwFileVersionMS)) .arg(LOWORD(pFileInfo->dwFileVersionMS)) -- cgit v1.3.1