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 307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
318 | 318 |
319 if (kill) { | 319 if (kill) { |
320 VLOG(1) << installer::kChromeFrameHelperExe << " hung. Killing."; | 320 VLOG(1) << installer::kChromeFrameHelperExe << " hung. Killing."; |
321 base::CleanupProcesses(installer::kChromeFrameHelperExe, base::TimeDelta(), | 321 base::CleanupProcesses(installer::kChromeFrameHelperExe, base::TimeDelta(), |
322 content::RESULT_CODE_HUNG, NULL); | 322 content::RESULT_CODE_HUNG, NULL); |
323 } | 323 } |
324 } | 324 } |
325 | 325 |
326 // Deletes shortcuts at |install_level| from Start menu, Desktop, | 326 // Deletes shortcuts at |install_level| from Start menu, Desktop, |
327 // Quick Launch, taskbar, and secondary tiles on the Start Screen (Win8+). | 327 // Quick Launch, taskbar, and secondary tiles on the Start Screen (Win8+). |
328 // Only shortcuts pointing to |target| will be removed. | 328 // Only shortcuts pointing to |target_exe| will be removed. |
329 void DeleteShortcuts(const InstallerState& installer_state, | 329 void DeleteShortcuts(const InstallerState& installer_state, |
330 const Product& product, | 330 const Product& product, |
331 const string16& target_exe) { | 331 const FilePath& target_exe) { |
332 BrowserDistribution* dist = product.distribution(); | 332 BrowserDistribution* dist = product.distribution(); |
333 | 333 |
334 // The per-user shortcut for this user, if present on a system-level install, | 334 // The per-user shortcut for this user, if present on a system-level install, |
335 // has already been deleted in chrome_browser_main_win.cc::DoUninstallTasks(). | 335 // has already been deleted in chrome_browser_main_win.cc::DoUninstallTasks(). |
336 ShellUtil::ShellChange install_level = installer_state.system_install() ? | 336 ShellUtil::ShellChange install_level = installer_state.system_install() ? |
337 ShellUtil::SYSTEM_LEVEL : ShellUtil::CURRENT_USER; | 337 ShellUtil::SYSTEM_LEVEL : ShellUtil::CURRENT_USER; |
338 | 338 |
339 VLOG(1) << "Deleting Desktop shortcut."; | 339 VLOG(1) << "Deleting Desktop shortcut."; |
340 if (!ShellUtil::RemoveShortcut(ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist, | 340 if (!ShellUtil::RemoveShortcut(ShellUtil::SHORTCUT_LOCATION_DESKTOP, dist, |
341 target_exe, install_level, NULL)) { | 341 target_exe, install_level, NULL)) { |
(...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1056 | 1056 |
1057 InstallStatus UninstallProduct(const InstallationState& original_state, | 1057 InstallStatus UninstallProduct(const InstallationState& original_state, |
1058 const InstallerState& installer_state, | 1058 const InstallerState& installer_state, |
1059 const FilePath& setup_path, | 1059 const FilePath& setup_path, |
1060 const Product& product, | 1060 const Product& product, |
1061 bool remove_all, | 1061 bool remove_all, |
1062 bool force_uninstall, | 1062 bool force_uninstall, |
1063 const CommandLine& cmd_line) { | 1063 const CommandLine& cmd_line) { |
1064 InstallStatus status = installer::UNINSTALL_CONFIRMED; | 1064 InstallStatus status = installer::UNINSTALL_CONFIRMED; |
1065 BrowserDistribution* browser_dist = product.distribution(); | 1065 BrowserDistribution* browser_dist = product.distribution(); |
1066 const string16 chrome_exe( | 1066 const FilePath chrome_exe_path( |
gab
2013/01/02 16:12:49
We have an item on the installer fixit list (https
Alexei Svitkine (slow)
2013/01/02 16:15:25
Done.
| |
1067 installer_state.target_path().Append(installer::kChromeExe).value()); | 1067 installer_state.target_path().Append(installer::kChromeExe)); |
1068 const string16 chrome_exe(chrome_exe_path.value()); | |
1068 | 1069 |
1069 const string16 suffix(ShellUtil::GetCurrentInstallationSuffix(browser_dist, | 1070 const string16 suffix(ShellUtil::GetCurrentInstallationSuffix(browser_dist, |
1070 chrome_exe)); | 1071 chrome_exe)); |
1071 | 1072 |
1072 bool is_chrome = product.is_chrome(); | 1073 bool is_chrome = product.is_chrome(); |
1073 | 1074 |
1074 VLOG(1) << "UninstallProduct: " << browser_dist->GetAppShortCutName(); | 1075 VLOG(1) << "UninstallProduct: " << browser_dist->GetAppShortCutName(); |
1075 | 1076 |
1076 if (force_uninstall) { | 1077 if (force_uninstall) { |
1077 // Since --force-uninstall command line option is used, we are going to | 1078 // Since --force-uninstall command line option is used, we are going to |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1121 ClearRlzProductState(); | 1122 ClearRlzProductState(); |
1122 // Delete the key that delegate_execute might make. | 1123 // Delete the key that delegate_execute might make. |
1123 if (base::win::GetVersion() >= base::win::VERSION_WIN8) { | 1124 if (base::win::GetVersion() >= base::win::VERSION_WIN8) { |
1124 InstallUtil::DeleteRegistryKey(HKEY_CURRENT_USER, | 1125 InstallUtil::DeleteRegistryKey(HKEY_CURRENT_USER, |
1125 chrome::kMetroRegistryPath); | 1126 chrome::kMetroRegistryPath); |
1126 } | 1127 } |
1127 | 1128 |
1128 auto_launch_util::DisableAllAutoStartFeatures( | 1129 auto_launch_util::DisableAllAutoStartFeatures( |
1129 ASCIIToUTF16(chrome::kInitialProfile)); | 1130 ASCIIToUTF16(chrome::kInitialProfile)); |
1130 | 1131 |
1131 DeleteShortcuts(installer_state, product, chrome_exe); | 1132 DeleteShortcuts(installer_state, product, chrome_exe_path); |
1132 | 1133 |
1133 } else if (product.is_chrome_app_host()) { | 1134 } else if (product.is_chrome_app_host()) { |
1134 // TODO(huangs): Remove this check once we have system-level App Host. | 1135 // TODO(huangs): Remove this check once we have system-level App Host. |
1135 DCHECK(!installer_state.system_install()); | 1136 DCHECK(!installer_state.system_install()); |
1136 const string16 app_host_exe( | 1137 const FilePath app_host_exe_path( |
gab
2013/01/02 16:12:49
I'd prefer keeping the "app_host_exe" name here.
Alexei Svitkine (slow)
2013/01/02 16:15:25
Done.
| |
1137 installer_state.target_path().Append(installer::kChromeAppHostExe) | 1138 installer_state.target_path().Append(installer::kChromeAppHostExe)); |
1138 .value()); | 1139 DeleteShortcuts(installer_state, product, app_host_exe_path); |
1139 DeleteShortcuts(installer_state, product, app_host_exe); | |
1140 } | 1140 } |
1141 | 1141 |
1142 // Delete the registry keys (Uninstall key and Version key). | 1142 // Delete the registry keys (Uninstall key and Version key). |
1143 HKEY reg_root = installer_state.root_key(); | 1143 HKEY reg_root = installer_state.root_key(); |
1144 | 1144 |
1145 // Note that we must retrieve the distribution-specific data before deleting | 1145 // Note that we must retrieve the distribution-specific data before deleting |
1146 // product.GetVersionKey(). | 1146 // product.GetVersionKey(). |
1147 string16 distribution_data(browser_dist->GetDistributionData(reg_root)); | 1147 string16 distribution_data(browser_dist->GetDistributionData(reg_root)); |
1148 | 1148 |
1149 // Remove Control Panel uninstall link. | 1149 // Remove Control Panel uninstall link. |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1409 // deletion unconditionally. If they are not empty, the session manager | 1409 // deletion unconditionally. If they are not empty, the session manager |
1410 // will not delete them on reboot. | 1410 // will not delete them on reboot. |
1411 ScheduleParentAndGrandparentForDeletion(target_path); | 1411 ScheduleParentAndGrandparentForDeletion(target_path); |
1412 } else if (DeleteApplicationProductAndVendorDirectories(target_path) == | 1412 } else if (DeleteApplicationProductAndVendorDirectories(target_path) == |
1413 installer::DELETE_FAILED) { | 1413 installer::DELETE_FAILED) { |
1414 *uninstall_status = installer::UNINSTALL_FAILED; | 1414 *uninstall_status = installer::UNINSTALL_FAILED; |
1415 } | 1415 } |
1416 } | 1416 } |
1417 | 1417 |
1418 } // namespace installer | 1418 } // namespace installer |
OLD | NEW |