forked from qt-creator/qt-creator
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user