| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 7293223 commit 0df38c2
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -323,6 +323,20 @@ def _install_packages(self): | |||
| 323 | 323 | ||
| 324 | 324 | def _find_msbuild_tool(self, tool="msbuild.exe", use_windows_sdk=False): | |
| 325 | 325 | """Return full path to one of the Microsoft build tools""" | |
| 326 | + | ||
| 327 | + # trying to search path with help of vswhere when MSBuild 15.0 and higher installed. | ||
| 328 | + if use_windows_sdk==False: | ||
| 329 | + try: | ||
| 330 | + basePathes = subprocess.check_output( | ||
| 331 | + ["tools\\vswhere\\vswhere.exe", "-latest", | ||
| 332 | + "-version", "[15.0, 16.0)", | ||
| 333 | + "-requires", "Microsoft.Component.MSBuild", | ||
| 334 | + "-property", "InstallationPath"]).splitlines() | ||
| 335 | + if len(basePathes): | ||
| 336 | + return os.path.join(basePathes[0].decode(sys.stdout.encoding or "utf-8"), "MSBuild", "15.0", "Bin", "MSBuild.exe") | ||
| 337 | + except: | ||
| 338 | + pass # keep trying to search by old method. | ||
| 339 | + | ||
| 326 | 340 | # Search in PATH first | |
| 327 | 341 | path = spawn.find_executable(tool) | |
| 328 | 342 | if path: | |
| Back | FazBrowse Home | New Git URL |
0 commit comments