| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 5d28a8d commit 2a83fe5
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -25,6 +25,7 @@ This document follows the conventions laid out in [Keep a CHANGELOG][]. | |||
| 25 | 25 | - Changed usage of obselete function GetDelegateForFunctionPointer(IntPtr, Type) to GetDelegateForFunctionPointer<TDelegate>(IntPtr) | |
| 26 | 26 | - When calling C# from Python, enable passing argument of any type to a parameter of C# type `object` by wrapping it into `PyObject` instance. ([#881][i881]) | |
| 27 | 27 | - Added support for kwarg parameters when calling .NET methods from Python | |
| 28 | + - Changed method for finding MSBuild using vswhere | ||
| 28 | 29 | ||
| 29 | 30 | ### Fixed | |
| 30 | 31 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -457,26 +457,20 @@ def _find_msbuild_tool(self, tool="msbuild.exe", use_windows_sdk=False): | |||
| 457 | 457 | # trying to search path with help of vswhere when MSBuild 15.0 and higher installed. | |
| 458 | 458 | if tool == "msbuild.exe" and use_windows_sdk == False: | |
| 459 | 459 | try: | |
| 460 | - basePathes = subprocess.check_output( | ||
| 460 | + basePaths = subprocess.check_output( | ||
| 461 | 461 | [ | |
| 462 | 462 | "tools\\vswhere\\vswhere.exe", | |
| 463 | 463 | "-latest", | |
| 464 | 464 | "-version", | |
| 465 | - "[15.0, 16.0)", | ||
| 465 | + "[15.0,)", | ||
| 466 | 466 | "-requires", | |
| 467 | 467 | "Microsoft.Component.MSBuild", | |
| 468 | - "-property", | ||
| 469 | - "InstallationPath", | ||
| 468 | + "-find", | ||
| 469 | + "MSBuild\**\Bin\MSBuild.exe", | ||
| 470 | 470 | ] | |
| 471 | 471 | ).splitlines() | |
| 472 | - if len(basePathes): | ||
| 473 | - return os.path.join( | ||
| 474 | - basePathes[0].decode(sys.stdout.encoding or "utf-8"), | ||
| 475 | - "MSBuild", | ||
| 476 | - "15.0", | ||
| 477 | - "Bin", | ||
| 478 | - "MSBuild.exe", | ||
| 479 | - ) | ||
| 472 | + if len(basePaths): | ||
| 473 | + return basePaths[0].decode(sys.stdout.encoding or "utf-8") | ||
| 480 | 474 | except: | |
| 481 | 475 | pass # keep trying to search by old method. | |
| 482 | 476 | ||
@@ -528,26 +522,20 @@ def _find_msbuild_tool(self, tool="msbuild.exe", use_windows_sdk=False): | |||
| 528 | 522 | def _find_msbuild_tool_15(self): | |
| 529 | 523 | """Return full path to one of the Microsoft build tools""" | |
| 530 | 524 | try: | |
| 531 | - basePathes = subprocess.check_output( | ||
| 525 | + basePaths = subprocess.check_output( | ||
| 532 | 526 | [ | |
| 533 | 527 | "tools\\vswhere\\vswhere.exe", | |
| 534 | 528 | "-latest", | |
| 535 | 529 | "-version", | |
| 536 | - "[15.0, 16.0)", | ||
| 530 | + "[15.0,)", | ||
| 537 | 531 | "-requires", | |
| 538 | 532 | "Microsoft.Component.MSBuild", | |
| 539 | - "-property", | ||
| 540 | - "InstallationPath", | ||
| 533 | + "-find", | ||
| 534 | + "MSBuild\**\Bin\MSBuild.exe", | ||
| 541 | 535 | ] | |
| 542 | 536 | ).splitlines() | |
| 543 | - if len(basePathes): | ||
| 544 | - return os.path.join( | ||
| 545 | - basePathes[0].decode(sys.stdout.encoding or "utf-8"), | ||
| 546 | - "MSBuild", | ||
| 547 | - "15.0", | ||
| 548 | - "Bin", | ||
| 549 | - "MSBuild.exe", | ||
| 550 | - ) | ||
| 537 | + if len(basePaths): | ||
| 538 | + return basePaths[0].decode(sys.stdout.encoding or "utf-8") | ||
| 551 | 539 | else: | |
| 552 | 540 | raise RuntimeError("MSBuild >=15.0 could not be found.") | |
| 553 | 541 | except subprocess.CalledProcessError as e: | |
| Back | FazBrowse Home | New Git URL |
0 commit comments