Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(495)

Side by Side Diff: tools/win/split_link/check_installed.py

Issue 15067010: split_link tool, config, and scripts for windows build (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: linebreak() Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
4
5 import sys
M-A Ruel 2013/05/13 21:23:42 sort imports
scottmg 2013/05/13 21:30:22 Done.
6 import os
7
M-A Ruel 2013/05/13 21:23:42 2 lines
scottmg 2013/05/13 21:30:22 Done.
8 def IsAvailable():
9 _winreg = None
10 if sys.platform == 'win32':
11 import _winreg
12 elif sys.platform == 'cygwin':
13 try:
14 import cygwinreg as _winreg
15 except ImportError:
16 pass # If not available, be safe and write 0.
17
18 if not _winreg:
19 return False
20
21 try:
22 val = _winreg.QueryValue(_winreg.HKEY_CURRENT_USER,
23 'Software\\Chromium\\split_link_installed')
24 if os.path.exists(val):
25 return True
26 except WindowsError:
27 pass
28
29 return False
30
31
32 def main():
33 # Can be called from gyp to set variable.
34 if IsAvailable():
35 sys.stdout.write('1')
36 else:
37 print >>sys.stderr, "Couldn't find split_link installation."
38 print >>sys.stderr, ('Run python tools\\win\\split_link\\'
39 'install_split_link.py from an elevated Visual '
40 'Studio Command Prompt to install.')
41 sys.stdout.write('0')
42 return 1
43
44
45 if __name__ == '__main__':
46 sys.exit(main())
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698