summaryrefslogtreecommitdiffstats
path: root/tools/win/supalink/check_installed.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/win/supalink/check_installed.py')
-rwxr-xr-xtools/win/supalink/check_installed.py15
1 files changed, 11 insertions, 4 deletions
diff --git a/tools/win/supalink/check_installed.py b/tools/win/supalink/check_installed.py
index 00b2b59..1d089f4 100755
--- a/tools/win/supalink/check_installed.py
+++ b/tools/win/supalink/check_installed.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-# Copyright (c) 2011 The Chromium Authors. All rights reserved.
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -7,12 +7,19 @@ import sys
import os
def main():
- if sys.platform != 'win32':
+ _winreg = None
+ if sys.platform == 'win32':
+ import _winreg
+ elif sys.platform == 'cygwin':
+ try:
+ import cygwinreg as _winreg
+ except ImportError:
+ pass # If not available, be safe and write 0.
+
+ if not _winreg:
sys.stdout.write('0')
return 0
- import _winreg
-
try:
val = _winreg.QueryValue(_winreg.HKEY_CURRENT_USER,
'Software\\Chromium\\supalink_installed')