Index: pylib/gyp/MSVSVersion.py |
diff --git a/pylib/gyp/MSVSVersion.py b/pylib/gyp/MSVSVersion.py |
index 4958ee0d3dd03d22fcfb941f4b76c4846eecc4f2..cc22e89aba0bb8abee2d4e94c2bfec86948fb28c 100644 |
--- a/pylib/gyp/MSVSVersion.py |
+++ b/pylib/gyp/MSVSVersion.py |
@@ -15,13 +15,15 @@ class VisualStudioVersion(object): |
"""Information regarding a version of Visual Studio.""" |
def __init__(self, short_name, description, |
- solution_version, project_version, flat_sln, uses_vcxproj): |
+ solution_version, project_version, flat_sln, uses_vcxproj, |
+ path): |
self.short_name = short_name |
self.description = description |
self.solution_version = solution_version |
self.project_version = project_version |
self.flat_sln = flat_sln |
self.uses_vcxproj = uses_vcxproj |
+ self.path = path |
def ShortName(self): |
return self.short_name |
@@ -49,6 +51,10 @@ class VisualStudioVersion(object): |
"""Returns the file extension for the project.""" |
return self.uses_vcxproj and '.vcxproj' or '.vcproj' |
+ def Path(self): |
+ """Returns the path to Visual Studio installation.""" |
+ return self.path |
+ |
def _RegistryQueryBase(sysdir, key, value): |
"""Use reg.exe to read a particular key. |
@@ -140,7 +146,7 @@ def _RegistryKeyExists(key): |
return True |
-def _CreateVersion(name): |
+def _CreateVersion(name, path): |
"""Sets up MSVS project generation. |
Setup is based off the GYP_MSVS_VERSION environment variable or whatever is |
@@ -153,37 +159,43 @@ def _CreateVersion(name): |
solution_version='11.00', |
project_version='4.0', |
flat_sln=False, |
- uses_vcxproj=True), |
+ uses_vcxproj=True, |
+ path=path), |
'2010e': VisualStudioVersion('2010e', |
'Visual Studio 2010', |
solution_version='11.00', |
project_version='4.0', |
flat_sln=True, |
- uses_vcxproj=True), |
+ uses_vcxproj=True, |
+ path=path), |
'2008': VisualStudioVersion('2008', |
'Visual Studio 2008', |
solution_version='10.00', |
project_version='9.00', |
flat_sln=False, |
- uses_vcxproj=False), |
+ uses_vcxproj=False, |
+ path=path), |
'2008e': VisualStudioVersion('2008e', |
'Visual Studio 2008', |
solution_version='10.00', |
project_version='9.00', |
flat_sln=True, |
- uses_vcxproj=False), |
+ uses_vcxproj=False, |
+ path=path), |
'2005': VisualStudioVersion('2005', |
'Visual Studio 2005', |
solution_version='9.00', |
project_version='8.00', |
flat_sln=False, |
- uses_vcxproj=False), |
+ uses_vcxproj=False, |
+ path=path), |
'2005e': VisualStudioVersion('2005e', |
'Visual Studio 2005', |
solution_version='9.00', |
project_version='8.00', |
flat_sln=True, |
- uses_vcxproj=False), |
+ uses_vcxproj=False, |
+ path=path), |
} |
return versions[str(name)] |
@@ -206,6 +218,8 @@ def _DetectVisualStudioVersions(): |
versions = [] |
# For now, prefer versions before VS2010 |
for version in ('9.0', '8.0', '10.0'): |
+ |
+ ''' |
# Check if VS2010 and later is installed as specified by |
# http://msdn.microsoft.com/en-us/library/bb164659.aspx |
keys = [r'HKLM\SOFTWARE\Microsoft\DevDiv\VS\Servicing\%s' % version, |
@@ -217,10 +231,11 @@ def _DetectVisualStudioVersions(): |
# Check for express |
if _RegistryKeyExists(keys[index] + '\\expbsln'): |
# Add this one |
- versions.append(_CreateVersion(version_to_year[version] + 'e')) |
+ versions.append(_CreateVersion(version_to_year[version] + 'e', "TODO!")) |
else: |
# Add this one |
- versions.append(_CreateVersion(version_to_year[version])) |
+ versions.append(_CreateVersion(version_to_year[version], "TODO!")) |
+ ''' |
# Old (pre-VS2010) method of searching for which VS version is installed |
keys = [r'HKLM\Software\Microsoft\VisualStudio\%s' % version, |
@@ -232,13 +247,17 @@ def _DetectVisualStudioVersions(): |
if not path: |
continue |
# Check for full. |
- if os.path.exists(os.path.join(path, 'devenv.exe')): |
+ full_path = os.path.join(path, 'devenv.exe') |
+ express_path = os.path.join(path, 'vcexpress.exe') |
+ if os.path.exists(full_path): |
# Add this one. |
- versions.append(_CreateVersion(version_to_year[version])) |
+ versions.append(_CreateVersion(version_to_year[version], |
+ os.path.join(path, '../..'))) |
# Check for express. |
- elif os.path.exists(os.path.join(path, 'vcexpress.exe')): |
+ elif os.path.exists(express_path): |
# Add this one. |
- versions.append(_CreateVersion(version_to_year[version] + 'e')) |
+ versions.append(_CreateVersion(version_to_year[version] + 'e', |
+ os.path.join(path, '../..'))) |
return versions |