Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(705)

Side by Side Diff: pylib/gyp/MSVSVersion.py

Issue 341041: Switching vs2008 to be preferred when present. (Closed) Base URL: http://gyp.googlecode.com/svn/trunk/
Patch Set: Created 11 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/python 1 #!/usr/bin/python
2 2
3 # Copyright (c) 2009 Google Inc. All rights reserved. 3 # Copyright (c) 2009 Google Inc. All rights reserved.
4 # Use of this source code is governed by a BSD-style license that can be 4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file. 5 # found in the LICENSE file.
6 6
7 """Handle version information related to Visual Stuio.""" 7 """Handle version information related to Visual Stuio."""
8 8
9 import os 9 import os
10 import re 10 import re
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 A list of visual studio versions installed in descending order of 87 A list of visual studio versions installed in descending order of
88 usage preference. 88 usage preference.
89 Base this on the registry and a quick check if devenv.exe exists. 89 Base this on the registry and a quick check if devenv.exe exists.
90 Only versions 8-9 are considered. 90 Only versions 8-9 are considered.
91 Possibilities are: 91 Possibilities are:
92 2005 - Visual Studio 2005 (8) 92 2005 - Visual Studio 2005 (8)
93 2008 - Visual Studio 2008 (9) 93 2008 - Visual Studio 2008 (9)
94 """ 94 """
95 version_to_year = { '8.0': '2005', '9.0': '2008' } 95 version_to_year = { '8.0': '2005', '9.0': '2008' }
96 versions = [] 96 versions = []
97 for version in ['8.0', '9.0']: 97 for version in ['9.0', '8.0']:
98 # Get the install dir for this version. 98 # Get the install dir for this version.
99 key = r'HKLM\Software\Microsoft\VisualStudio\%s' % version 99 key = r'HKLM\Software\Microsoft\VisualStudio\%s' % version
100 path = _RegistryGetValue(key, 'InstallDir') 100 path = _RegistryGetValue(key, 'InstallDir')
101 if not path: 101 if not path:
102 continue 102 continue
103 # Check if there's anything actually there. 103 # Check if there's anything actually there.
104 if not os.path.exists(os.path.join(path, 'devenv.exe')): 104 if not os.path.exists(os.path.join(path, 'devenv.exe')):
105 continue 105 continue
106 # Add this one. 106 # Add this one.
107 versions.append(_CreateVersion(version_to_year[version])) 107 versions.append(_CreateVersion(version_to_year[version]))
(...skipping 13 matching lines...) Expand all
121 version = os.environ.get('GYP_MSVS_VERSION', 'auto') 121 version = os.environ.get('GYP_MSVS_VERSION', 'auto')
122 # In auto mode, pick the most preferred version present. 122 # In auto mode, pick the most preferred version present.
123 if version == 'auto': 123 if version == 'auto':
124 versions = _DetectVisualStudioVersions() 124 versions = _DetectVisualStudioVersions()
125 if not versions: 125 if not versions:
126 # Default to 2005. 126 # Default to 2005.
127 return _CreateVersion('2005') 127 return _CreateVersion('2005')
128 return versions[0] 128 return versions[0]
129 # Convert version string into a version object. 129 # Convert version string into a version object.
130 return _CreateVersion(version) 130 return _CreateVersion(version)
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698