Skip to content
Snippets Groups Projects
Commit 104c1f37 authored by Daniel Teske's avatar Daniel Teske
Browse files

Only show Visual Studio compilers if VS is installed


Task-number: QTCREATORBUG-8487

Change-Id: Ibc812f14cd8e4de765cabf27d23451c06611d372
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent 6ce9a80a
No related branches found
No related tags found
No related merge requests found
......@@ -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<ToolChain *> MsvcToolChainFactory::autoDetect()
{
QList<ToolChain *> results;
......@@ -501,6 +514,8 @@ QList<ToolChain *> 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();
......
......@@ -106,6 +106,8 @@ public:
{ return MsvcToolChain::readFromMap(data); }
ToolChainConfigWidget *configurationWidget(ToolChain *);
private:
static bool checkForVisualStudioInstallation(const QString &vsName);
};
// --------------------------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment