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

Unified Diff: build/vs_toolchain.py

Issue 2754263002: Retrieve Visual Studio 2017 installation location from registry (Closed)
Patch Set: Created 3 years, 9 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/vs_toolchain.py
diff --git a/build/vs_toolchain.py b/build/vs_toolchain.py
index 73783e3c67109a46614b776233df8cd027c7fbaa..77f98ca6528a26299eee8d7131717ab75a69bdcd 100755
--- a/build/vs_toolchain.py
+++ b/build/vs_toolchain.py
@@ -146,24 +146,14 @@ def DetectVisualStudioPath():
' not supported. Supported versions are: %s') % (
version_as_year, ', '.join(year_to_version.keys())))
version = year_to_version[version_as_year]
- if version_as_year == '2017':
- # The VC++ 2017 install location needs to be located using COM instead of
- # the registry. For details see:
- # https://blogs.msdn.microsoft.com/heaths/2016/09/15/changes-to-visual-studio-15-setup/
- # For now we use a hardcoded default with an environment variable override.
- path = r'C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional'
- path = os.environ.get('vs2017_install', path)
- if os.path.exists(path):
- return path
- else:
- keys = [r'HKLM\Software\Microsoft\VisualStudio\%s' % version,
- r'HKLM\Software\Wow6432Node\Microsoft\VisualStudio\%s' % version]
- for key in keys:
- path = _RegistryGetValue(key, 'InstallDir')
- if not path:
- continue
- path = os.path.normpath(os.path.join(path, '..', '..'))
- return path
+ keys = [r'HKLM\Software\Microsoft\VisualStudio\SxS\VS7',
+ r'HKLM\Software\Wow6432Node\Microsoft\VisualStudio\SxS\VS7']
+ for key in keys:
+ path = _RegistryGetValue(key, version)
+ if not path:
+ continue
+ path = os.path.normpath(path)
+ return path
raise Exception(('Visual Studio Version %s (from GYP_MSVS_VERSION)'
' not found.') % (version_as_year))
« 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