From 9cc149852645455ad481c1fef521622d6fd79791 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Wed, 8 Jan 2020 12:26:56 +0200 Subject: MSVC: Avoid bad execution attempt of powershell If the user opted in for telemetry, vsdevcmd.bat tries to execute powershell. The batch file clears the PATH, so powershell cannot be used. Change-Id: I80e457aebea9d8c1c8ba0415d50d809bfd0bd4da Reviewed-by: Ivan Komissarov Reviewed-by: Joerg Bornemann --- src/lib/corelib/tools/vsenvironmentdetector.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/lib/corelib/tools/vsenvironmentdetector.cpp b/src/lib/corelib/tools/vsenvironmentdetector.cpp index f8f98e7b7..2490a5cdb 100644 --- a/src/lib/corelib/tools/vsenvironmentdetector.cpp +++ b/src/lib/corelib/tools/vsenvironmentdetector.cpp @@ -233,6 +233,8 @@ void VsEnvironmentDetector::writeBatchFile(QIODevice *device, const QString &vcv << QStringLiteral("WindowsSDKVersion") << QStringLiteral("VSINSTALLDIR"); QTextStream s(device); s << "@echo off" << endl; + // Avoid execution of powershell (in vsdevcmd.bat), which is not in the cleared PATH + s << "set VSCMD_SKIP_SENDTELEMETRY=1" << endl; for (const MSVC *msvc : msvcs) { s << "echo --" << msvc->architecture << "--" << endl << "setlocal" << endl; -- cgit v1.2.3