| 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 <windows.h> | 9 #include <windows.h> |
| 10 #include <stddef.h> | 10 #include <stddef.h> |
| (...skipping 973 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 984 // Notify the shell that associations have changed since Chrome was likely | 984 // Notify the shell that associations have changed since Chrome was likely |
| 985 // unregistered. | 985 // unregistered. |
| 986 SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL); | 986 SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL); |
| 987 } | 987 } |
| 988 | 988 |
| 989 // Get the state of the installed product (if any) | 989 // Get the state of the installed product (if any) |
| 990 const ProductState* product_state = | 990 const ProductState* product_state = |
| 991 original_state.GetProductState(installer_state.system_install(), | 991 original_state.GetProductState(installer_state.system_install(), |
| 992 browser_dist->GetType()); | 992 browser_dist->GetType()); |
| 993 | 993 |
| 994 // Remove the event log provider registration as we are going to delete |
| 995 // the file which serves the resources anyways. |
| 996 DeRegisterEventLogProvider(); |
| 997 |
| 994 // Delete shared registry keys as well (these require admin rights) if | 998 // Delete shared registry keys as well (these require admin rights) if |
| 995 // remove_all option is specified. | 999 // remove_all option is specified. |
| 996 if (remove_all) { | 1000 if (remove_all) { |
| 997 if (!InstallUtil::IsChromeSxSProcess()) { | 1001 if (!InstallUtil::IsChromeSxSProcess()) { |
| 998 // Delete media player registry key that exists only in HKLM. We don't | 1002 // Delete media player registry key that exists only in HKLM. We don't |
| 999 // delete this key in SxS uninstall as we never set the key for it. | 1003 // delete this key in SxS uninstall as we never set the key for it. |
| 1000 base::string16 reg_path(installer::kMediaPlayerRegPath); | 1004 base::string16 reg_path(installer::kMediaPlayerRegPath); |
| 1001 reg_path.push_back(base::FilePath::kSeparators[0]); | 1005 reg_path.push_back(base::FilePath::kSeparators[0]); |
| 1002 reg_path.append(installer::kChromeExe); | 1006 reg_path.append(installer::kChromeExe); |
| 1003 InstallUtil::DeleteRegistryKey(HKEY_LOCAL_MACHINE, reg_path, | 1007 InstallUtil::DeleteRegistryKey(HKEY_LOCAL_MACHINE, reg_path, |
| 1004 WorkItem::kWow64Default); | 1008 WorkItem::kWow64Default); |
| 1005 | |
| 1006 // Remove the event log provider registration as we are going to delete | |
| 1007 // the file which serves the resources anyways. | |
| 1008 DeRegisterEventLogProvider(); | |
| 1009 } | 1009 } |
| 1010 } | 1010 } |
| 1011 | 1011 |
| 1012 // Finally delete all the files from Chrome folder after moving setup.exe | 1012 // Finally delete all the files from Chrome folder after moving setup.exe |
| 1013 // and the user's Local State to a temp location. | 1013 // and the user's Local State to a temp location. |
| 1014 bool delete_profile = ShouldDeleteProfile(cmd_line, status); | 1014 bool delete_profile = ShouldDeleteProfile(cmd_line, status); |
| 1015 ret = installer::UNINSTALL_SUCCESSFUL; | 1015 ret = installer::UNINSTALL_SUCCESSFUL; |
| 1016 | 1016 |
| 1017 base::FilePath user_data_dir(GetUserDataDir(product)); | 1017 base::FilePath user_data_dir(GetUserDataDir(product)); |
| 1018 base::FilePath backup_state_file; | 1018 base::FilePath backup_state_file; |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1108 // If we need a reboot to continue, schedule the parent directories for | 1108 // If we need a reboot to continue, schedule the parent directories for |
| 1109 // deletion unconditionally. If they are not empty, the session manager | 1109 // deletion unconditionally. If they are not empty, the session manager |
| 1110 // will not delete them on reboot. | 1110 // will not delete them on reboot. |
| 1111 ScheduleParentAndGrandparentForDeletion(target_path); | 1111 ScheduleParentAndGrandparentForDeletion(target_path); |
| 1112 } else if (DeleteChromeDirectoriesIfEmpty(target_path) == DELETE_FAILED) { | 1112 } else if (DeleteChromeDirectoriesIfEmpty(target_path) == DELETE_FAILED) { |
| 1113 *uninstall_status = UNINSTALL_FAILED; | 1113 *uninstall_status = UNINSTALL_FAILED; |
| 1114 } | 1114 } |
| 1115 } | 1115 } |
| 1116 | 1116 |
| 1117 } // namespace installer | 1117 } // namespace installer |
| OLD | NEW |