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

Side by Side Diff: chrome/test/mini_installer/uninstall_chrome.py

Issue 23950004: Uninstall Chrome silently in the mini_installer test framework. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 7 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2013 The Chromium Authors. All rights reserved. 1 # Copyright 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 """Uninstalls Chrome. 5 """Uninstalls Chrome.
6 6
7 This script reads the uninstall command from registry, calls it, and verifies 7 This script reads the uninstall command from registry, calls it, and verifies
8 the output status code. 8 the output status code.
9 """ 9 """
10 10
(...skipping 20 matching lines...) Expand all
31 sub_key = ('SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\%s' % 31 sub_key = ('SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\%s' %
32 options.chrome_long_name) 32 options.chrome_long_name)
33 # Query the key. It will throw a WindowsError if the key doesn't exist. 33 # Query the key. It will throw a WindowsError if the key doesn't exist.
34 try: 34 try:
35 key = _winreg.OpenKey(root_key, sub_key, 0, _winreg.KEY_QUERY_VALUE) 35 key = _winreg.OpenKey(root_key, sub_key, 0, _winreg.KEY_QUERY_VALUE)
36 except WindowsError: 36 except WindowsError:
37 raise KeyError('Registry key %s\\%s is missing' % ( 37 raise KeyError('Registry key %s\\%s is missing' % (
38 'HKEY_LOCAL_MACHINE' if options.system_level else 'HKEY_CURRENT_USER', 38 'HKEY_LOCAL_MACHINE' if options.system_level else 'HKEY_CURRENT_USER',
39 sub_key)) 39 sub_key))
40 uninstall_string, _ = _winreg.QueryValueEx(key, 'UninstallString') 40 uninstall_string, _ = _winreg.QueryValueEx(key, 'UninstallString')
41 exit_status = subprocess.call(uninstall_string, shell=True) 41 exit_status = subprocess.call(uninstall_string + ' --force-uninstall',
42 shell=True)
42 # The exit status for successful uninstallation of Chrome is 19 (see 43 # The exit status for successful uninstallation of Chrome is 19 (see
43 # chrome/installer/util/util_constants.h). 44 # chrome/installer/util/util_constants.h).
44 if exit_status != 19: 45 if exit_status != 19:
45 raise Exception('Could not uninstall Chrome. The installer exited with ' 46 raise Exception('Could not uninstall Chrome. The installer exited with '
46 'status %d.' % exit_status) 47 'status %d.' % exit_status)
47 return 0 48 return 0
48 49
49 50
50 if __name__ == '__main__': 51 if __name__ == '__main__':
51 sys.exit(main()) 52 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698