OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This file defines the methods useful for uninstalling Chrome. | 5 // This file defines the methods useful for uninstalling Chrome. |
6 | 6 |
7 #include "chrome/installer/setup/uninstall.h" | 7 #include "chrome/installer/setup/uninstall.h" |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
657 } | 657 } |
658 | 658 |
659 // Note that we do not attempt to delete filetype associations since MSDN | 659 // Note that we do not attempt to delete filetype associations since MSDN |
660 // says "Windows respects the Default value only if the ProgID found there is | 660 // says "Windows respects the Default value only if the ProgID found there is |
661 // a registered ProgID. If the ProgID is unregistered, it is ignored." | 661 // a registered ProgID. If the ProgID is unregistered, it is ignored." |
662 | 662 |
663 *exit_code = installer::UNINSTALL_SUCCESSFUL; | 663 *exit_code = installer::UNINSTALL_SUCCESSFUL; |
664 return true; | 664 return true; |
665 } | 665 } |
666 | 666 |
667 void RemoveChromeLegacyRegistryKeys(BrowserDistribution* dist) { | |
668 // We used to register Chrome to handle crx files, but this turned out | |
669 // to be not worth the hassle. Remove these old registry entries if | |
670 // they exist. See: http://codereview.chromium.org/210007 | |
671 | |
672 #if defined(GOOGLE_CHROME_BUILD) | |
673 const wchar_t kChromeExtProgId[] = L"ChromeExt"; | |
674 #else | |
675 const wchar_t kChromeExtProgId[] = L"ChromiumExt"; | |
676 #endif | |
677 | |
678 HKEY roots[] = { HKEY_LOCAL_MACHINE, HKEY_CURRENT_USER }; | |
679 for (size_t i = 0; i < arraysize(roots); ++i) { | |
680 string16 suffix; | |
681 if (roots[i] == HKEY_LOCAL_MACHINE && | |
682 !ShellUtil::GetUserSpecificDefaultBrowserSuffix(dist, &suffix)) | |
683 suffix = L""; | |
684 | |
685 // Delete Software\Classes\ChromeExt, | |
686 string16 ext_prog_id(ShellUtil::kRegClasses); | |
687 ext_prog_id.push_back(FilePath::kSeparators[0]); | |
688 ext_prog_id.append(kChromeExtProgId); | |
689 ext_prog_id.append(suffix); | |
690 InstallUtil::DeleteRegistryKey(roots[i], ext_prog_id); | |
691 | |
692 // Delete Software\Classes\.crx, | |
693 string16 ext_association(ShellUtil::kRegClasses); | |
694 ext_association.append(L"\\"); | |
695 ext_association.append(chrome::kExtensionFileExtension); | |
696 InstallUtil::DeleteRegistryKey(roots[i], ext_association); | |
697 } | |
698 } | |
699 | |
700 // Builds and executes a work item list to remove DelegateExecute verb handler | 667 // Builds and executes a work item list to remove DelegateExecute verb handler |
701 // work items for |product|. This will be a noop for products whose | 668 // work items for |product|. This will be a noop for products whose |
702 // corresponding BrowserDistribution implementations do not publish | 669 // corresponding BrowserDistribution implementations do not publish |
703 // DelegateExecute data via an implementation of GetDelegateExecuteHandlerData. | 670 // DelegateExecute data via an implementation of GetDelegateExecuteHandlerData. |
704 bool ProcessDelegateExecuteWorkItems(const InstallerState& installer_state, | 671 bool ProcessDelegateExecuteWorkItems(const InstallerState& installer_state, |
705 const Product& product) { | 672 const Product& product) { |
706 scoped_ptr<WorkItemList> item_list(WorkItem::CreateNoRollbackWorkItemList()); | 673 scoped_ptr<WorkItemList> item_list(WorkItem::CreateNoRollbackWorkItemList()); |
707 AddDelegateExecuteWorkItems(installer_state, FilePath(), Version(), product, | 674 AddDelegateExecuteWorkItems(installer_state, FilePath(), Version(), product, |
708 item_list.get()); | 675 item_list.get()); |
709 return item_list->Do(); | 676 return item_list->Do(); |
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
952 | 919 |
953 // Try and delete the preserved local state once the post-install | 920 // Try and delete the preserved local state once the post-install |
954 // operations are complete. | 921 // operations are complete. |
955 if (!backup_state_file.empty()) | 922 if (!backup_state_file.empty()) |
956 file_util::Delete(backup_state_file, false); | 923 file_util::Delete(backup_state_file, false); |
957 | 924 |
958 return ret; | 925 return ret; |
959 } | 926 } |
960 | 927 |
961 } // namespace installer | 928 } // namespace installer |
OLD | NEW |