Utils: Fix detection of DLL or EXE file/product version on Windows

We need to handle not only the most significant bits
of the file's binary version, but also the
least significant bits. Otherwise a returning file/product
version is not a complete.

Change-Id: I2372731ed4e6740c09785fc74c80dad6ecfe9fbe
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Denis Shienkov
2019-10-31 21:38:43 +03:00
parent deeed3dcd2
commit f02d5f4d7d

View File

@@ -120,10 +120,16 @@ QTCREATOR_UTILS_EXPORT QString winGetDLLVersion(WinDLLVersionType t,
QString rc;
switch (t) {
case WinDLLFileVersion:
QTextStream(&rc) << HIWORD(versionInfo->dwFileVersionMS) << '.' << LOWORD(versionInfo->dwFileVersionMS);
QTextStream(&rc) << HIWORD(versionInfo->dwFileVersionMS) << '.'
<< LOWORD(versionInfo->dwFileVersionMS) << '.'
<< HIWORD(versionInfo->dwFileVersionLS) << '.'
<< LOWORD(versionInfo->dwFileVersionLS);
break;
case WinDLLProductVersion:
QTextStream(&rc) << HIWORD(versionInfo->dwProductVersionMS) << '.' << LOWORD(versionInfo->dwProductVersionMS);
QTextStream(&rc) << HIWORD(versionInfo->dwProductVersionMS) << '.'
<< LOWORD(versionInfo->dwProductVersionMS) << '.'
<< HIWORD(versionInfo->dwProductVersionLS) << '.'
<< LOWORD(versionInfo->dwProductVersionLS);
break;
}
return rc;