| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 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 """Copies necessary add-in files into place to install the add-in. | 6 """Copies necessary add-in files into place to install the add-in. |
| 7 | 7 |
| 8 This script will copy the necessary files for the Visual Studio add-in | 8 This script will copy the necessary files for the Visual Studio add-in |
| 9 to where Visual Studio can find them. It assumes the current directory | 9 to where Visual Studio can find them. It assumes the current directory |
| 10 contains the necessary files to copy. | 10 contains the necessary files to copy. |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 raise | 309 raise |
| 310 else: | 310 else: |
| 311 print "\nInstallation complete!\n" | 311 print "\nInstallation complete!\n" |
| 312 | 312 |
| 313 return 0 | 313 return 0 |
| 314 | 314 |
| 315 if __name__ == '__main__': | 315 if __name__ == '__main__': |
| 316 rtn = 1 | 316 rtn = 1 |
| 317 try: | 317 try: |
| 318 rtn = main() | 318 rtn = main() |
| 319 except InstallError as e: | 319 except (create_ppapi_platform.Error, InstallError) as e: |
| 320 print | 320 print |
| 321 print e | 321 print e |
| 322 except shutil.Error as e: | 322 except shutil.Error as e: |
| 323 print "Error while copying file. Please ensure file is not in use." | 323 print "Error while copying file. Please ensure file is not in use." |
| 324 print e | 324 print e |
| 325 except WindowsError as e: | 325 except WindowsError as e: |
| 326 if e.winerror == 5: | 326 if e.winerror == 5: |
| 327 print e | 327 print e |
| 328 print("The install script failed to write to the files mentioned above") | 328 print("The install script failed to write to the files mentioned above") |
| 329 if ctypes.windll.shell32.IsUserAnAdmin() != 1: | 329 if ctypes.windll.shell32.IsUserAnAdmin() != 1: |
| 330 print("Please try running as administrator.") | 330 print("Please try running as administrator.") |
| 331 else: | 331 else: |
| 332 print("Please check for any running programs that might " | 332 print("Please check for any running programs that might " |
| 333 "have them locked.") | 333 "have them locked.") |
| 334 else: | 334 else: |
| 335 raise | 335 raise |
| 336 sys.exit(rtn) | 336 sys.exit(rtn) |
| OLD | NEW |