Commit 1ba41357 authored by Chris Blume's avatar Chris Blume Committed by LUCI CQ

Replace hard-coded Windows SDK path

Currently, the Windows SDK path is hard-coded. This does not work if the
SDK is installed in a different path or drive.

This CL fetches the actual Windows SDK path and uses it instead.

Change-Id: I31808ba0dbe76f47253fc165ccbd8f027bf396ec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3451982Reviewed-by: 's avatarBruce Dawson <brucedawson@chromium.org>
Commit-Queue: Chris Blume <cblume@chromium.org>
Auto-Submit: Chris Blume <cblume@chromium.org>
parent 234398a1
......@@ -177,7 +177,19 @@ def BuildFileList(override_dir, include_arm):
dest = final_from[len(vs_path) + 1:]
result.append((final_from, dest))
sdk_path = r'C:\Program Files (x86)\Windows Kits\10'
command = (r'reg query "HKLM\SOFTWARE\Microsoft\Windows Kits\Installed Roots"'
r' /v KitsRoot10')
marker = " KitsRoot10 REG_SZ "
sdk_path = None
output = subprocess.check_output(command, universal_newlines=True)
for line in output.splitlines():
if line.startswith(marker):
sdk_path = line[len(marker):]
# Strip off a trailing slash if present
if sdk_path.endswith(os.path.sep):
sdk_path = sdk_path[:len(os.path.sep)]
debuggers_path = os.path.join(sdk_path, 'Debuggers')
if not os.path.exists(debuggers_path):
raise Exception('Packaging failed. Missing %s.' % (debuggers_path))
......
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