| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2013 The Chromium Authors. All rights reserved. | 2 # Copyright 2013 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """Extracts a Windows VS2013 toolchain from various downloadable pieces.""" | 6 """Extracts a Windows VS2013 toolchain from various downloadable pieces.""" |
| 7 | 7 |
| 8 | 8 |
| 9 import ctypes | 9 import ctypes |
| 10 import json | 10 import json |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 target_path = os.path.join(sdk_temp_dir, 'sdksetup.exe') | 189 target_path = os.path.join(sdk_temp_dir, 'sdksetup.exe') |
| 190 standalone_path = os.path.join(sdk_temp_dir, 'Standalone') | 190 standalone_path = os.path.join(sdk_temp_dir, 'Standalone') |
| 191 Download( | 191 Download( |
| 192 ('http://download.microsoft.com/download/' | 192 ('http://download.microsoft.com/download/' |
| 193 'F/1/3/F1300C9C-A120-4341-90DF-8A52509B23AC/standalonesdk/sdksetup.exe'), | 193 'F/1/3/F1300C9C-A120-4341-90DF-8A52509B23AC/standalonesdk/sdksetup.exe'), |
| 194 target_path) | 194 target_path) |
| 195 sys.stdout.write( | 195 sys.stdout.write( |
| 196 'Running sdksetup.exe to download Win8 SDK (may request elevation)...\n') | 196 'Running sdksetup.exe to download Win8 SDK (may request elevation)...\n') |
| 197 count = 0 | 197 count = 0 |
| 198 while count < 5: | 198 while count < 5: |
| 199 rc = os.system(target_path + ' /quiet ' | 199 rc = subprocess.call([target_path, |
| 200 '/features OptionId.WindowsDesktopDebuggers ' | 200 '/quiet', |
| 201 'OptionId.WindowsDesktopSoftwareDevelopmentKit ' | 201 '/features', 'OptionId.WindowsDesktopDebuggers', |
| 202 '/layout ' + standalone_path) | 202 'OptionId.WindowsDesktopSoftwareDevelopmentKit', |
| 203 '/layout', standalone_path]) |
| 203 if rc == 0: | 204 if rc == 0: |
| 204 return standalone_path | 205 return standalone_path |
| 205 count += 1 | 206 count += 1 |
| 206 sys.stdout.write('Windows 8 SDK failed to download, retrying.\n') | 207 sys.stdout.write('Windows 8 SDK failed to download, retrying.\n') |
| 207 sys.exit('After multiple retries, couldn\'t download Win8 SDK') | 208 sys.exit('After multiple retries, couldn\'t download Win8 SDK') |
| 208 | 209 |
| 209 | 210 |
| 210 def DownloadWDKIso(): | 211 def DownloadWDKIso(): |
| 211 wdk_temp_dir = TempDir() | 212 wdk_temp_dir = TempDir() |
| 212 target_path = os.path.join(wdk_temp_dir, 'GRMWDK_EN_7600_1.ISO') | 213 target_path = os.path.join(wdk_temp_dir, 'GRMWDK_EN_7600_1.ISO') |
| (...skipping 270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 483 } | 484 } |
| 484 with open(os.path.join(target_dir, '..', 'data.json'), 'w') as f: | 485 with open(os.path.join(target_dir, '..', 'data.json'), 'w') as f: |
| 485 json.dump(data, f) | 486 json.dump(data, f) |
| 486 finally: | 487 finally: |
| 487 if options.clean: | 488 if options.clean: |
| 488 DeleteAllTempDirs() | 489 DeleteAllTempDirs() |
| 489 | 490 |
| 490 | 491 |
| 491 if __name__ == '__main__': | 492 if __name__ == '__main__': |
| 492 sys.exit(main()) | 493 sys.exit(main()) |
| OLD | NEW |