Parcourir la source

[simulator][rtconfig.py] fix the problem of path cannot be find and cause failure

Some users' computer cannot find the path of VS and will cause failure. Just skip this step.
Meco Man il y a 2 ans
Parent
commit
f290ff8754
1 fichiers modifiés avec 16 ajouts et 13 suppressions
  1. 16 13
      bsp/simulator/rtconfig.py

+ 16 - 13
bsp/simulator/rtconfig.py

@@ -27,19 +27,22 @@ elif  CROSS_TOOL == 'msvc':
     CPU       = 'win32'
     PLATFORM  = 'cl'
     EXEC_PATH = ''
-    vc_version = ''
-    vc_versions = SCons.Tool.MSCommon.vc.get_installed_vcs()
-    if not vc_versions:
-        print("No vc version!")
-        exit(1)
-    else:
-        vc_version = vc_versions[0]
-    EXEC_PATH = SCons.Tool.MSCommon.vc.find_vc_pdir(vc_version)
-    if not EXEC_PATH:
-        print('Installed VC %s failure!' % vc_version)
-        exit(1)
-    else:
-        print('Successfully installed VC %s, path:%s' % (vc_version, EXEC_PATH))
+    try:
+        vc_version = ''
+        vc_versions = SCons.Tool.MSCommon.vc.get_installed_vcs()
+        if not vc_versions:
+            print("No vc version!")
+            exit()
+        else:
+            vc_version = vc_versions[0]
+        EXEC_PATH = SCons.Tool.MSCommon.vc.find_vc_pdir(vc_version)
+        if not EXEC_PATH:
+            print('Installed VC %s failure!' % vc_version)
+            exit()
+        else:
+            print('Successfully installed VC %s, path:%s' % (vc_version, EXEC_PATH))
+    except:
+        pass
 
 else:
     print("Simulator does not support this CROSS TOOL!")