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 <oliver.wolff@qt.io>
bb10
Joerg Bornemann 2022-08-22 17:27:46 +02:00
parent 38ca72ab5e
commit fad4bcad5e
1 changed files with 2 additions and 2 deletions

View File

@ -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);
}