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. |
11 """ | 11 """ |
12 | 12 |
13 import os | 13 import os |
14 import platform | 14 import platform |
15 import shutil | 15 import shutil |
16 | 16 |
17 def main(): | 17 def main(): |
18 if platform.system() != 'Windows': | 18 if platform.system() != 'Windows': |
19 raise Exception('Must install to Windows system') | 19 raise Exception('Must install to Windows system') |
20 | 20 |
21 # Ensure environment variables are set | 21 # Ensure environment variables are set |
22 nacl_sdk_root = os.path.expandvars('%NACL_SDK_ROOT%', None) | 22 nacl_sdk_root = os.getenv('NACL_SDK_ROOT', None) |
23 chrome_path = os.path.expandvars('%CHROME_PATH%', None) | 23 chrome_path = os.getenv('CHROME_PATH', None) |
24 if nacl_sdk_root == None: | 24 if nacl_sdk_root is None: |
25 raise Exception('Environment Variable NACL_SDK_ROOT is not set') | 25 raise Exception('Environment Variable NACL_SDK_ROOT is not set') |
26 if chrome_path == None: | 26 if chrome_path is None: |
27 raise Exception('Environment Variable CHROME_PATH is not set') | 27 raise Exception('Environment Variable CHROME_PATH is not set') |
28 | 28 |
29 # Copy the necessary files into place | 29 # Copy the necessary files into place |
30 addInDir = os.path.expandvars( | 30 add_in_directory = os.path.expandvars( |
31 '%USERPROFILE%\My Documents\Visual Studio 2010\Addins') | 31 '%USERPROFILE%\My Documents\Visual Studio 2010\Addins') |
32 shutil.copy('./NativeClientVSAddIn.AddIn', addInDir) | 32 shutil.copy('./NativeClientVSAddIn.AddIn', add_in_directory) |
33 shutil.copy('./NativeClientVSAddIn.dll', addInDir) | 33 shutil.copy('./NativeClientVSAddIn.dll', add_in_directory) |
34 | 34 |
35 if __name__ == '__main__': | 35 if __name__ == '__main__': |
36 main() | 36 main() |
OLD | NEW |