[Python-checkins] r78713 - python/trunk/Lib/distutils/msvc9compiler.py

tarek.ziade python-checkins at python.org
Sat Mar 6 03:17:28 CET 2010


Author: tarek.ziade
Date: Sat Mar  6 03:17:28 2010
New Revision: 78713

Log:
search in the alternative location for VCExpress

Modified:
   python/trunk/Lib/distutils/msvc9compiler.py

Modified: python/trunk/Lib/distutils/msvc9compiler.py
==============================================================================
--- python/trunk/Lib/distutils/msvc9compiler.py	(original)
+++ python/trunk/Lib/distutils/msvc9compiler.py	Sat Mar  6 03:17:28 2010
@@ -38,6 +38,7 @@
          _winreg.HKEY_CLASSES_ROOT)
 
 VS_BASE = r"Software\Microsoft\VisualStudio\%0.1f"
+VSEXPRESS_BASE = r"Software\Microsoft\VCExpress\%0.1f"
 WINSDK_BASE = r"Software\Microsoft\Microsoft SDKs\Windows"
 NET_BASE = r"Software\Microsoft\.NETFramework"
 
@@ -216,9 +217,18 @@
         productdir = Reg.get_value(r"%s\Setup\VC" % vsbase,
                                    "productdir")
     except KeyError:
-        log.debug("Unable to find productdir in registry")
         productdir = None
 
+    # trying Express edition
+    if productdir is None:
+        vsbase = VSEXPRESS_BASE % version
+        try:
+            productdir = Reg.get_value(r"%s\Setup\VC" % vsbase,
+                                       "productdir")
+        except KeyError:
+            productdir = None
+            log.debug("Unable to find productdir in registry")
+
     if not productdir or not os.path.isdir(productdir):
         toolskey = "VS%0.f0COMNTOOLS" % version
         toolsdir = os.environ.get(toolskey, None)


More information about the Python-checkins mailing list