Commit 5a80eab0 authored by Bruce Dawson's avatar Bruce Dawson Committed by Commit Bot

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/578767Reviewed-by: 's avatarScott Graham <scottmg@chromium.org>
Commit-Queue: Bruce Dawson <brucedawson@chromium.org>
parent 4d92fe43
...@@ -45,10 +45,11 @@ def GetVSPath(): ...@@ -45,10 +45,11 @@ def GetVSPath():
if VS_VERSION == '2015': if VS_VERSION == '2015':
return r'C:\Program Files (x86)\Microsoft Visual Studio 14.0' return r'C:\Program Files (x86)\Microsoft Visual Studio 14.0'
elif VS_VERSION == '2017': elif VS_VERSION == '2017':
# Use vswhere to find the VS 2017 installation. This handles preview # Use vswhere to find the VS 2017 installation. This will find prerelease
# versions automatically. This assumes that only one version is installed. # versions because -prerelease is specified. This assumes that only one
# version is installed.
command = (r'C:\Program Files (x86)\Microsoft Visual Studio\Installer' command = (r'C:\Program Files (x86)\Microsoft Visual Studio\Installer'
r'\vswhere.exe') r'\vswhere.exe -prerelease')
marker = 'installationPath: ' marker = 'installationPath: '
for line in subprocess.check_output(command).splitlines(): for line in subprocess.check_output(command).splitlines():
if line.startswith(marker): if line.startswith(marker):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment