Index: msvccompiler.py =================================================================== RCS file: /cvsroot/python/python/dist/src/Lib/distutils/msvccompiler.py,v retrieving revision 1.59 diff -u -r1.59 msvccompiler.py --- msvccompiler.py 5 Dec 2003 20:12:23 -0000 1.59 +++ msvccompiler.py 25 Jan 2004 02:55:39 -0000 @@ -538,6 +538,38 @@ path = path + " dirs" if self.__version >= 7: + # MSVC 7.1 seems to prefer VCComponents.dat buried under + # CSIDL_LOCAL_APPDATA. + import ConfigParser # and fortunately this can parse it. + try: + from win32com.shell.shell import SHGetSpecialFolderPath + import pythoncom + except ImportError: + # no win32all - any alternatives? + pass + else: + CSIDL_LOCAL_APPDATA = 28 + try: + lad_dir = SHGetSpecialFolderPath(0, CSIDL_LOCAL_APPDATA) + fname = os.path.join( + lad_dir, + "Microsoft\\VisualStudio\\%0.1f" + % self.__version, + "VCComponents.dat") + except pythoncom.com_error: + fname = "" + if fname and os.path.exists(fname): + section = r"VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directories" + try: + parser = ConfigParser.ConfigParser() + parser.readfp( open(fname, "r") ) + value = parser.get(section, path) + except ConfigParser.Error: + value = "" + if value: + return string.split(self.__macros.sub(value), ";") + # No file, or not found in our file - fall through to registry + key = (r"%s\%0.1f\VC\VC_OBJECTS_PLATFORM_INFO\Win32\Directories" % (self.__root, self.__version)) else: