Chromium Code Reviews| 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 | 10 |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 94 !product_state->channel().Equals(channel_info)) { | 94 !product_state->channel().Equals(channel_info)) { |
| 95 BrowserDistribution* other_dist = | 95 BrowserDistribution* other_dist = |
| 96 BrowserDistribution::GetSpecificDistribution(dist_type); | 96 BrowserDistribution::GetSpecificDistribution(dist_type); |
| 97 update_list->AddSetRegValueWorkItem(reg_root, other_dist->GetStateKey(), | 97 update_list->AddSetRegValueWorkItem(reg_root, other_dist->GetStateKey(), |
| 98 google_update::kRegApField, channel_info.value(), true); | 98 google_update::kRegApField, channel_info.value(), true); |
| 99 } else { | 99 } else { |
| 100 LOG_IF(ERROR, | 100 LOG_IF(ERROR, |
| 101 product_state != NULL && product_state->is_multi_install()) | 101 product_state != NULL && product_state->is_multi_install()) |
| 102 << "Channel value for " | 102 << "Channel value for " |
| 103 << BrowserDistribution::GetSpecificDistribution( | 103 << BrowserDistribution::GetSpecificDistribution( |
| 104 dist_type)->GetAppShortCutName() | 104 dist_type)->GetDisplayName() |
|
huangs
2013/05/21 21:35:41
I don't think we should localize our logs. Please
| |
| 105 << " is somehow already set to the desired new value of " | 105 << " is somehow already set to the desired new value of " |
| 106 << channel_info.value(); | 106 << channel_info.value(); |
| 107 } | 107 } |
| 108 } | 108 } |
| 109 } | 109 } |
| 110 | 110 |
| 111 // Makes appropriate changes to the Google Update "ap" value in the registry. | 111 // Makes appropriate changes to the Google Update "ap" value in the registry. |
| 112 // Specifically, removes the flags associated with this product ("-chrome" or | 112 // Specifically, removes the flags associated with this product ("-chrome" or |
| 113 // "-chromeframe[-readymode]") from the "ap" values for all other | 113 // "-chromeframe[-readymode]") from the "ap" values for all other |
| 114 // installed products and for the multi-installer package. | 114 // installed products and for the multi-installer package. |
| (...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 934 // a no-op for all other types of installs. | 934 // a no-op for all other types of installs. |
| 935 void UninstallActiveSetupEntries(const InstallerState& installer_state, | 935 void UninstallActiveSetupEntries(const InstallerState& installer_state, |
| 936 const Product& product) { | 936 const Product& product) { |
| 937 VLOG(1) << "Uninstalling registry entries for ActiveSetup."; | 937 VLOG(1) << "Uninstalling registry entries for ActiveSetup."; |
| 938 BrowserDistribution* distribution = product.distribution(); | 938 BrowserDistribution* distribution = product.distribution(); |
| 939 | 939 |
| 940 if (!product.is_chrome() || !installer_state.system_install()) { | 940 if (!product.is_chrome() || !installer_state.system_install()) { |
| 941 const char* install_level = | 941 const char* install_level = |
| 942 installer_state.system_install() ? "system" : "user"; | 942 installer_state.system_install() ? "system" : "user"; |
| 943 VLOG(1) << "No Active Setup processing to do for " << install_level | 943 VLOG(1) << "No Active Setup processing to do for " << install_level |
| 944 << "-level " << distribution->GetAppShortCutName(); | 944 << "-level " << distribution->GetDisplayName(); |
| 945 return; | 945 return; |
| 946 } | 946 } |
| 947 | 947 |
| 948 const string16 active_setup_path( | 948 const string16 active_setup_path( |
| 949 InstallUtil::GetActiveSetupPath(distribution)); | 949 InstallUtil::GetActiveSetupPath(distribution)); |
| 950 InstallUtil::DeleteRegistryKey(HKEY_LOCAL_MACHINE, active_setup_path); | 950 InstallUtil::DeleteRegistryKey(HKEY_LOCAL_MACHINE, active_setup_path); |
| 951 | 951 |
| 952 // Windows leaves keys behind in HKCU\\Software\\(Wow6432Node\\)?Microsoft\\ | 952 // Windows leaves keys behind in HKCU\\Software\\(Wow6432Node\\)?Microsoft\\ |
| 953 // Active Setup\\Installed Components\\{guid} | 953 // Active Setup\\Installed Components\\{guid} |
| 954 // for every user that logged in since system-level Chrome was installed. | 954 // for every user that logged in since system-level Chrome was installed. |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1073 InstallStatus status = installer::UNINSTALL_CONFIRMED; | 1073 InstallStatus status = installer::UNINSTALL_CONFIRMED; |
| 1074 BrowserDistribution* browser_dist = product.distribution(); | 1074 BrowserDistribution* browser_dist = product.distribution(); |
| 1075 const string16 chrome_exe( | 1075 const string16 chrome_exe( |
| 1076 installer_state.target_path().Append(installer::kChromeExe).value()); | 1076 installer_state.target_path().Append(installer::kChromeExe).value()); |
| 1077 | 1077 |
| 1078 const string16 suffix(ShellUtil::GetCurrentInstallationSuffix(browser_dist, | 1078 const string16 suffix(ShellUtil::GetCurrentInstallationSuffix(browser_dist, |
| 1079 chrome_exe)); | 1079 chrome_exe)); |
| 1080 | 1080 |
| 1081 bool is_chrome = product.is_chrome(); | 1081 bool is_chrome = product.is_chrome(); |
| 1082 | 1082 |
| 1083 VLOG(1) << "UninstallProduct: " << browser_dist->GetAppShortCutName(); | 1083 VLOG(1) << "UninstallProduct: " << browser_dist->GetDisplayName(); |
| 1084 | 1084 |
| 1085 if (force_uninstall) { | 1085 if (force_uninstall) { |
| 1086 // Since --force-uninstall command line option is used, we are going to | 1086 // Since --force-uninstall command line option is used, we are going to |
| 1087 // do silent uninstall. Try to close all running Chrome instances. | 1087 // do silent uninstall. Try to close all running Chrome instances. |
| 1088 // NOTE: We don't do this for Chrome Frame. | 1088 // NOTE: We don't do this for Chrome Frame. |
| 1089 if (is_chrome) | 1089 if (is_chrome) |
| 1090 CloseAllChromeProcesses(); | 1090 CloseAllChromeProcesses(); |
| 1091 } else if (is_chrome) { | 1091 } else if (is_chrome) { |
| 1092 // no --force-uninstall so lets show some UI dialog boxes. | 1092 // no --force-uninstall so lets show some UI dialog boxes. |
| 1093 status = IsChromeActiveOrUserCancelled(installer_state, product); | 1093 status = IsChromeActiveOrUserCancelled(installer_state, product); |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1430 // deletion unconditionally. If they are not empty, the session manager | 1430 // deletion unconditionally. If they are not empty, the session manager |
| 1431 // will not delete them on reboot. | 1431 // will not delete them on reboot. |
| 1432 ScheduleParentAndGrandparentForDeletion(target_path); | 1432 ScheduleParentAndGrandparentForDeletion(target_path); |
| 1433 } else if (DeleteApplicationProductAndVendorDirectories(target_path) == | 1433 } else if (DeleteApplicationProductAndVendorDirectories(target_path) == |
| 1434 installer::DELETE_FAILED) { | 1434 installer::DELETE_FAILED) { |
| 1435 *uninstall_status = installer::UNINSTALL_FAILED; | 1435 *uninstall_status = installer::UNINSTALL_FAILED; |
| 1436 } | 1436 } |
| 1437 } | 1437 } |
| 1438 | 1438 |
| 1439 } // namespace installer | 1439 } // namespace installer |
| OLD | NEW |