From e56d98cea0c422827cd72c6cb4d7ee43143d5bac Mon Sep 17 00:00:00 2001 From: Orkun Tokdemir Date: Wed, 14 Aug 2024 10:20:44 +0200 Subject: [PATCH] windeployqt: deployWebProcess: Copy QtWebEngineProcess.exe to `--libdir` When the executable is deployed using the CMake deployment API, `QtWebEngineProcess.exe` should be copied into the same folder where the deployed project executable is, which is 'bin'. https://doc.qt.io/qt-6/qtwebengine-deploying.html#deploying-qt-webengine-processes In the previous implementation, the `--dir` argument is used as the target directory. This commit changes the target directory for `QtWebEngineProcess.exe` from `--dir` to `--libdir`. Pick-to: 6.7 6.8 Fixes: QTBUG-126572 Change-Id: I07abfc789d439ac66a9ff2706de52a05d80e9b51 Reviewed-by: Alexandru Croitor Reviewed-by: Oliver Wolff --- src/tools/windeployqt/main.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/tools/windeployqt/main.cpp b/src/tools/windeployqt/main.cpp index 2eabc35e245..eb4a97b2c60 100644 --- a/src/tools/windeployqt/main.cpp +++ b/src/tools/windeployqt/main.cpp @@ -1823,10 +1823,14 @@ static bool deployWebProcess(const QMap &qtpathsVariables, con const QString webProcess = webProcessBinary(binaryName, sourceOptions.platform); const QString webProcessSource = qtpathsVariables.value(QStringLiteral("QT_INSTALL_LIBEXECS")) + u'/' + webProcess; - if (!updateFile(webProcessSource, sourceOptions.directory, sourceOptions.updateFileFlags, sourceOptions.json, errorMessage)) + const QString webProcessTargetDir = sourceOptions.platform & WindowsBased + && !sourceOptions.libraryDirectory.isEmpty() ? + sourceOptions.libraryDirectory : + sourceOptions.directory; + if (!updateFile(webProcessSource, webProcessTargetDir, sourceOptions.updateFileFlags, sourceOptions.json, errorMessage)) return false; Options options(sourceOptions); - options.binaries.append(options.directory + u'/' + webProcess); + options.binaries.append(webProcessTargetDir + u'/' + webProcess); options.quickImports = false; options.translations = false; return deploy(options, qtpathsVariables, pluginInfo, errorMessage);