Check that MSVC install dir returned by registry actually exists before using it...
authorgaryo <garyo@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Wed, 5 Aug 2009 13:53:02 +0000 (13:53 +0000)
committergaryo <garyo@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Wed, 5 Aug 2009 13:53:02 +0000 (13:53 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@4321 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/engine/SCons/Tool/MSCommon/vc.py

index 222c2847960a6a4bc9119d761239047d76f55eed..815a3e60166dad54387d50be3beae96a10534054 100644 (file)
@@ -110,7 +110,12 @@ class VisualC:
                 debug('find_vc_dir(): no VC registry key %s' % repr(key))
             else:
                 debug('find_vc_dir(): found VC in registry: %s' % comps)
-                return comps
+                if os.path.exists(comps):
+                    return comps
+                else:
+                    debug('find_vc_dir(): reg says dir is %s, but it does not exist. (ignoring)'\
+                              % comps)
+                    return None
         return None
 
     #
@@ -277,6 +282,7 @@ def script_env(script):
 def msvc_setup_env(env):
     debug('msvc_setup_env()')
     installed_vcs = get_installed_vcs()
+    debug('InstalledVCMap:%s'%InstalledVCMap)
     msvc_version = env.get('MSVC_VERSION')
     if not msvc_version:
         if not installed_vcs:
@@ -287,8 +293,10 @@ def msvc_setup_env(env):
         msvc = installed_vcs[0]
         msvc_version = msvc.version
         env['MSVC_VERSION'] = msvc_version
+        debug('msvc_setup_env: using default installed MSVC version %s\n' % repr(msvc_version))
     else:
         msvc = InstalledVCMap.get(msvc_version)
+        debug('msvc_setup_env: using specified MSVC version %s\n' % repr(msvc_version))
         if not msvc:
             msg = 'VC version %s not installed' % msvc_version
             debug('msv %s\n' % repr(msg))