Commit 3bbeaa6a authored by dtu's avatar dtu Committed by Commit bot

[telemetry] Fix MSR power monitor on Windows bots.

I VNCed into a bot and learned that the Buildbot scripts munge the environment
variables, so that PROGRAMFILES(X86) doesn't exist. Using platform.machine()
is a more robust, cross-platform way of checking if the OS is 64-bit.

The Windows XP bots still worked, because their OSes are all 32-bit.

BUG=336559
TEST=None.

Review URL: https://codereview.chromium.org/603763002

Cr-Commit-Position: refs/heads/master@{#296564}
parent 8fe707fc
...@@ -51,7 +51,7 @@ def _InstallWinRing0(): ...@@ -51,7 +51,7 @@ def _InstallWinRing0():
dll_file_name = 'WinRing0x64.dll' if python_is_64_bit else 'WinRing0.dll' dll_file_name = 'WinRing0x64.dll' if python_is_64_bit else 'WinRing0.dll'
dll_path = os.path.join(executable_dir, dll_file_name) dll_path = os.path.join(executable_dir, dll_file_name)
os_is_64_bit = 'PROGRAMFILES(X86)' in os.environ os_is_64_bit = platform.machine().endswith('64')
driver_file_name = 'WinRing0x64.sys' if os_is_64_bit else 'WinRing0.sys' driver_file_name = 'WinRing0x64.sys' if os_is_64_bit else 'WinRing0.sys'
driver_path = os.path.join(executable_dir, driver_file_name) driver_path = os.path.join(executable_dir, driver_file_name)
......
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