File tree 1 file changed +12
-0
lines changed 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change 5
5
6
6
import os
7
7
import sys
8
+ import subprocess
8
9
9
10
'''
10
11
Look for the first match in the format
@@ -18,6 +19,17 @@ def find_msvc():
18
19
path = os .path .join (default_dir , release , version , 'VC' )
19
20
if os .path .isdir (path ):
20
21
return path
22
+
23
+ # Fall back to vswhere.exe to determine non-standard installation paths
24
+ # Fixed location, https://github.com/Microsoft/vswhere/wiki/Installing
25
+ vswhere = os .path .join (os .getenv ('ProgramFiles(x86)' ),
26
+ 'Microsoft Visual Studio' , 'Installer' , 'vswhere.exe' )
27
+ command = (vswhere + ' -prerelease -legacy -products * -sort -utf8 '
28
+ '-property installationPath' )
29
+ paths = subprocess .check_output (command ).decode ('utf-8' ).splitlines ()
30
+ if paths :
31
+ return paths [0 ] + '\\ VC'
32
+
21
33
return None
22
34
23
35
if __name__ == '__main__' :
You can’t perform that action at this time.
0 commit comments