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 <scottmg@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
changes/67/578767/3
Bruce Dawson 8 years ago committed by Commit Bot
parent 4d92fe4300
commit 5a80eab0f4

@ -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):

Loading…
Cancel
Save