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