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