OLD | NEW |
---|---|
(Empty) | |
1 #!/usr/bin/env python | |
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 | |
4 # found in the LICENSE file. | |
5 | |
6 """Copies necessary add-in files into place to install the add-in. | |
7 | |
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 | |
10 contains the necessary files to copy. | |
11 """ | |
12 | |
13 import os | |
14 import platform | |
15 import shutil | |
16 | |
17 if platform.system() != 'Windows': | |
binji
2012/07/17 00:05:58
Use the standard python file structure:
http://goo
tysand
2012/07/17 01:18:18
Done.
| |
18 raise Exception('Must install to Windows system') | |
binji
2012/07/17 00:05:58
2 space indent
tysand
2012/07/17 01:18:18
Done.
| |
19 | |
20 # Ensure environment variables are set | |
21 nacl_sdk_root = os.path.expandvars('%NACL_SDK_ROOT%') | |
binji
2012/07/17 00:05:58
just use os.getenv('NACL_SDK_ROOT', None) for this
tysand
2012/07/17 01:18:18
Done.
| |
22 chrome_path = os.path.expandvars('%CHROME_PATH%') | |
binji
2012/07/17 00:05:58
same here
tysand
2012/07/17 01:18:18
Done.
| |
23 if nacl_sdk_root == '%NACL_SDK_ROOT%': | |
24 raise Exception('Environment Variable NACL_SDK_ROOT is not set') | |
25 if chrome_path == '%CHROME_PATH%': | |
26 raise Exception('Environment Variable CHROME_PATH is not set') | |
27 | |
28 # Copy the necessary files into place | |
29 addInDir = os.path.expandvars( | |
30 '%USERPROFILE%\My Documents\Visual Studio 2010\Addins') | |
31 shutil.copy('./NativeClientVSAddIn.AddIn', addInDir) | |
32 shutil.copy('./NativeClientVSAddIn.dll', addInDir) | |
OLD | NEW |