From c7a44cfb5b243028bfe187715297c6deb2c09ffa Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 10 Oct 2017 15:40:52 +0200 Subject: windeployqt: Do not use debug redistributable files from "onecore" on Windows 7 They require Windows 10. Amends 061e1a8bbe5fb05b8f85811d55e805f54327d1d6. Task-number: QTBUG-63676 Change-Id: I32d94bf3d52616fc0d5c861a6a7444d8b8e61cdf Reviewed-by: Oliver Wolff --- src/windeployqt/main.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/windeployqt/main.cpp b/src/windeployqt/main.cpp index 69ab76441..5f6340d3b 100644 --- a/src/windeployqt/main.cpp +++ b/src/windeployqt/main.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -1047,13 +1048,16 @@ static QString vcRedistDir() // Look in reverse order for folder containing the debug redist folder const QFileInfoList subDirs = QDir(vc2017RedistDirName).entryInfoList(QDir::Dirs | QDir::NoDotAndDotDot, QDir::Name | QDir::Reversed); + const bool isWindows10 = QOperatingSystemVersion::current() >= QOperatingSystemVersion::Windows10; for (const QFileInfo &f : subDirs) { QString path = f.absoluteFilePath(); if (QFileInfo(path + slash + vcDebugRedistDir()).isDir()) return path; - path += QStringLiteral("/onecore"); - if (QFileInfo(path + slash + vcDebugRedistDir()).isDir()) - return path; + if (isWindows10) { + path += QStringLiteral("/onecore"); + if (QFileInfo(path + slash + vcDebugRedistDir()).isDir()) + return path; + } } std::wcerr << "Warning: Cannot find Visual Studio redist directory under " << QDir::toNativeSeparators(vc2017RedistDirName).toStdWString() << ".\n"; -- cgit v1.2.1