From 5a80eab0f460a4ea63de21fefacca828c7a5d57d Mon Sep 17 00:00:00 2001 From: Bruce Dawson Date: Wed, 19 Jul 2017 18:06:46 -0700 Subject: [PATCH] Use -prerelease flag to vswhere when packaging VS With VS 2017 Update 3 Preview 4 the behavior of vswhere was changed so that it only reports on non-prerelease versions by default. This can be overridden by passing -prerelease. This broke our packaging setup. A temporary fix was used to package Preview 4 and this is the permanent. When -prerelease is passed then vswhere will report on all installed versions of VS, whether prerelease or not. The script will package the first one that it encounters. For best results you should only install one copy of VS when packaging it. Trivia: the original RTW version of VS 2017 was incorrectly tagged as isPrerelease: 1 which means that without the -prerelease flag it doesn't show up either! BUG=683729 Change-Id: I98c1acb671dccef7ede4443fbbf498796946c52b Reviewed-on: https://chromium-review.googlesource.com/578767 Reviewed-by: Scott Graham Commit-Queue: Bruce Dawson --- win_toolchain/package_from_installed.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/win_toolchain/package_from_installed.py b/win_toolchain/package_from_installed.py index 3be044e9be..fdf49af29f 100644 --- a/win_toolchain/package_from_installed.py +++ b/win_toolchain/package_from_installed.py @@ -45,10 +45,11 @@ def GetVSPath(): if VS_VERSION == '2015': return r'C:\Program Files (x86)\Microsoft Visual Studio 14.0' elif VS_VERSION == '2017': - # Use vswhere to find the VS 2017 installation. This handles preview - # versions automatically. This assumes that only one version is installed. + # Use vswhere to find the VS 2017 installation. This will find prerelease + # versions because -prerelease is specified. This assumes that only one + # version is installed. command = (r'C:\Program Files (x86)\Microsoft Visual Studio\Installer' - r'\vswhere.exe') + r'\vswhere.exe -prerelease') marker = 'installationPath: ' for line in subprocess.check_output(command).splitlines(): if line.startswith(marker):