From 74c55124754f63be11ac026201b82e398e9ca1bb Mon Sep 17 00:00:00 2001 From: Oliver Wolff Date: Tue, 4 Sep 2018 08:48:03 +0200 Subject: [PATCH] winrt: Use full path when running windeployqt As winrt does not have the concept of a run environment acquiring the path to windeployqt from the environment might lead to unexpected results like using windeployqt from a different Qt installation. Calling the program with its absolute path is the safer alternative and thus should be the default anyways. Task-number: QTBUG-70175 Change-Id: I6eb5416275d7ff243f396bf1fccdbcb9d04f7e15 Reviewed-by: Christian Stenger --- src/plugins/winrt/winrtpackagedeploymentstep.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/plugins/winrt/winrtpackagedeploymentstep.cpp b/src/plugins/winrt/winrtpackagedeploymentstep.cpp index 9d2710192dc..b18a1f4e4be 100644 --- a/src/plugins/winrt/winrtpackagedeploymentstep.cpp +++ b/src/plugins/winrt/winrtpackagedeploymentstep.cpp @@ -93,7 +93,14 @@ bool WinRtPackageDeploymentStep::init(QList &earlierSteps) } ProcessParameters *params = processParameters(); - params->setCommand(QLatin1String("windeployqt.exe")); + const QString windeployqtPath + = Utils::FileUtils::resolvePath(qt->binPath().toString(), "windeployqt.exe"); + if (!QFile::exists(windeployqtPath)) { + raiseError(tr("Cannot find windeployqt.exe in \"%1\".").arg( + QDir::toNativeSeparators(qt->binPath().toString()))); + return false; + } + params->setCommand(windeployqtPath); params->setArguments(args); params->setEnvironment(target()->activeBuildConfiguration()->environment());