1  import os 
 2  import sys 
 3  import comtypes 
 4  from .. import utils 
 5  import comtypes.client 
 6  import _winreg as win_registry 
 7  from distutils import msvccompiler 
 8   
10   
12          relative_path = os.path.dirname( sys.modules[__name__].__file__) 
13          absolute_path = os.path.abspath (relative_path) 
14          return os.path.join( absolute_path, 'msbsc70.dll' ) 
 15   
17          relative_path = os.path.dirname( sys.modules[__name__].__file__) 
18          absolute_path = os.path.abspath (relative_path) 
19          return os.path.join( absolute_path, 'msvcr70.dll' ) 
 20   
21   
23          vss_installed = self.__get_installed_vs_dirs() 
24          for f in utils.files_walker( vss_installed, ["*.dll"], ): 
25              f_path, f_name = os.path.split( f.upper() ) 
26              if f_name.startswith( 'MSVCR' ): 
27                  return f 
28          else: 
29              raise RuntimeError( 'Unable to find msvcrXX.dll. Search path is: %s' % vss_installed  ) 
 30   
32          vss_installed = self.__get_installed_vs_dirs() 
33          msdia_dlls = self.__get_msdia_dll_paths( vss_installed ) 
34          if 1 == len(msdia_dlls): 
35              return msdia_dlls[0] 
36          else: 
37               
38              pass 
 39   
41          msdia_dlls = [] 
42          for vs in vss_installed: 
43              debug_dir = os.path.join( vs, 'Common7', 'Packages', 'Debugger' ) 
44              files = filter( lambda f: f.startswith( 'msdia' ) and f.endswith( '.dll' ) 
45                              , os.listdir( debug_dir ) ) 
46              if not files: 
47                  continue 
48              msdia_dlls.extend([ os.path.join( debug_dir, f ) for f in files ]) 
49          if not msdia_dlls: 
50              raise RuntimeError( 'pygccxml unable to find out msdiaXX.dll location' ) 
51          return msdia_dlls 
 52   
54          vs_reg_path = 'Software\Microsoft\VisualStudio\SxS\VS7' 
55          values = self.read_values( win_registry.HKEY_LOCAL_MACHINE, vs_reg_path ) 
56          return [ values.values()[0] ] 
 57   
60   
 63   
64  bs = binaries_searcher_t() 
65   
66  msdia_path = bs.get_msdia_path() 
67  print 'msdia path: ', msdia_path 
68   
69  msbsc_path = bs.get_msbsc_path() 
70  print 'msbsc path: ', msbsc_path 
71   
72  msvcr_path = bs.get_msvcr_path() 
73  print 'msvcr path: ', msvcr_path 
74