diff --git a/src/plugins/projectexplorer/msvctoolchain.cpp b/src/plugins/projectexplorer/msvctoolchain.cpp index a47d1039e05..00aa65d994f 100644 --- a/src/plugins/projectexplorer/msvctoolchain.cpp +++ b/src/plugins/projectexplorer/msvctoolchain.cpp @@ -440,6 +440,19 @@ QString MsvcToolChainFactory::id() const return QLatin1String(Constants::MSVC_TOOLCHAIN_ID); } +bool MsvcToolChainFactory::checkForVisualStudioInstallation(const QString &vsName) +{ + const QSettings vsRegistry( +#ifdef Q_OS_WIN64 + QLatin1String("HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\VisualStudio\\SxS\\VS7"), +#else + QLatin1String("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VS7"), +#endif + QSettings::NativeFormat); + + return vsRegistry.contains(vsName); +} + QList MsvcToolChainFactory::autoDetect() { QList results; @@ -501,6 +514,8 @@ QList MsvcToolChainFactory::autoDetect() const int dotPos = vsName.indexOf(QLatin1Char('.')); if (dotPos == -1) continue; + if (!checkForVisualStudioInstallation(vsName)) + continue; const QString path = vsRegistry.value(vsName).toString(); const int version = vsName.left(dotPos).toInt(); diff --git a/src/plugins/projectexplorer/msvctoolchain.h b/src/plugins/projectexplorer/msvctoolchain.h index 8afbf6ebb72..21a0582aaa1 100644 --- a/src/plugins/projectexplorer/msvctoolchain.h +++ b/src/plugins/projectexplorer/msvctoolchain.h @@ -106,6 +106,8 @@ public: { return MsvcToolChain::readFromMap(data); } ToolChainConfigWidget *configurationWidget(ToolChain *); +private: + static bool checkForVisualStudioInstallation(const QString &vsName); }; // --------------------------------------------------------------------------