From: garyo Date: Wed, 5 Aug 2009 13:53:02 +0000 (+0000) Subject: Check that MSVC install dir returned by registry actually exists before using it... X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=89a48d6b834bfbe09d3675d406f6993f00bbb0b5;p=scons.git Check that MSVC install dir returned by registry actually exists before using it. Also added some debug stmts to vc.py. git-svn-id: http://scons.tigris.org/svn/scons/trunk@4321 fdb21ef1-2011-0410-befe-b5e4ea1792b1 --- diff --git a/src/engine/SCons/Tool/MSCommon/vc.py b/src/engine/SCons/Tool/MSCommon/vc.py index 222c2847..815a3e60 100644 --- a/src/engine/SCons/Tool/MSCommon/vc.py +++ b/src/engine/SCons/Tool/MSCommon/vc.py @@ -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))