From fad4bcad5e5fc039395dd3caf2759689696c3669 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 22 Aug 2022 17:27:46 +0200 Subject: [PATCH] windeployqt: Prepend Qt's bin dir to PATH instead of appending The fix for QTBUG-39177 was to append Qt's bin dir to PATH. But if we have a Qt bin dir in PATH that is different from the one windeployqt belongs to, then we end up calling qtpaths from the former Qt. Change-Id: I373a3270d1ec950479049b4cdaf0ff13dd8813c7 Reviewed-by: Oliver Wolff --- src/tools/windeployqt/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tools/windeployqt/main.cpp b/src/tools/windeployqt/main.cpp index 556a6341aa..6b788cf41f 100644 --- a/src/tools/windeployqt/main.cpp +++ b/src/tools/windeployqt/main.cpp @@ -1626,8 +1626,8 @@ int main(int argc, char **argv) const QByteArray qtBinPath = QFile::encodeName(QDir::toNativeSeparators(QCoreApplication::applicationDirPath())); QByteArray path = qgetenv("PATH"); if (!path.contains(qtBinPath)) { // QTBUG-39177, ensure Qt is in the path so that qt.conf is taken into account. - path += QDir::listSeparator().toLatin1(); - path += qtBinPath; + path.prepend(QDir::listSeparator().toLatin1()); + path.prepend(qtBinPath); qputenv("PATH", path); }