Browse Source

Merge pull request #1258 from AtomicGameEngine/JME-ATOMIC-VS2017Detection

[C#] Fix potential issue with VS2017 detection when VS2015 was previously installed
JoshEngebretson 9 years ago
parent
commit
7474d026eb

+ 8 - 0
Source/ToolCore/NETTools/NETBuildSystem.cpp

@@ -312,6 +312,14 @@ namespace ToolCore
             // VS2015
             String vs2015ToolsPath = Poco::Environment::get("VS140COMNTOOLS", "").c_str();
 
+            // validate still installed
+
+            String installCheck = vs2015ToolsPath;
+            installCheck.Replace("Tools\\", "IDE\\devenv.exe");
+
+            if (!fileSystem->FileExists(installCheck))
+                vs2015ToolsPath.Clear();
+
             // VS2017
             String vs2017ToolsPath;
             Poco::WinRegistryKey regKey("HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Microsoft\\VisualStudio\\SxS\\VS7", true);

+ 6 - 4
Source/ToolCore/NETTools/NETProjectSystem.cpp

@@ -418,7 +418,7 @@ namespace ToolCore
 
     void NETProjectSystem::HandleAssetMoved(StringHash eventType, VariantMap& eventData)
     {
-        
+
     }
 
     void NETProjectSystem::Initialize()
@@ -445,8 +445,8 @@ namespace ToolCore
 
 #ifdef ATOMIC_PLATFORM_WINDOWS
 
-        // On Windows, we first check for VS2015, then VS2017 which 
-        // at the time of this comment is in RC, refactor once 
+        // On Windows, we first check for VS2015, then VS2017 which
+        // at the time of this comment is in RC, refactor once
         // in general release
 
         FileSystem* fileSystem = GetSubsystem<FileSystem>();
@@ -461,7 +461,9 @@ namespace ToolCore
             if (!fileSystem->FileExists(idePath_))
                 idePath_.Clear();
         }
-        else
+
+        // If we didn't find VS2015, look for VS2017
+        if (!idePath_.Length())
         {
             // check for VS2017
             Poco::WinRegistryKey regKey("HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\Microsoft\\VisualStudio\\SxS\\VS7", true);