diff --git a/.travis.yml b/.travis.yml index d6fcc4a88..504fead86 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,8 +23,8 @@ env: addons: apt: sources: - - mono - - mono-libtiff-compat + - sourceline: deb http://download.mono-project.com/repo/ubuntu precise main + key_url: http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xA6A19B38D3D831EF packages: - mono-devel - ca-certificates-mono diff --git a/setup.py b/setup.py index c23f6b5bd..7bc0dbfa7 100644 --- a/setup.py +++ b/setup.py @@ -281,7 +281,19 @@ def _find_msbuild_tool(self, tool="msbuild.exe", use_windows_sdk=False): path = spawn.find_executable(tool) if path: return path - + + if tool == "msbuild.exe": + vswhere = os.path.join("tools", "vswhere", "vswhere.exe") + basePathes = subprocess.check_output( + [vswhere, "-latest", + "-version", "[15.0, 16.0)", + "-requires", "Microsoft.Component.MSBuild", + "-property", "InstallationPath"]).splitlines() + if basePathes and basePathes[0] and os.path.exists(basePathes[0]): + path = os.path.join(basePathes[0], + "MSBuild", "15.0", "Bin", tool) + return path + # Search within registry to find build tools try: # PY2 import _winreg as winreg diff --git a/tools/vswhere/vswhere.exe b/tools/vswhere/vswhere.exe new file mode 100644 index 000000000..8022060b0 Binary files /dev/null and b/tools/vswhere/vswhere.exe differ