Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(214)

Side by Side Diff: chrome/installer/setup/uninstall.cc

Issue 11359013: Adding App Launcher shortcuts on install. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nit. Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/installer/setup/install.cc ('k') | chrome/installer/util/chrome_app_host_distribution.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
249 } 249 }
250 } 250 }
251 251
252 if (kill) { 252 if (kill) {
253 VLOG(1) << installer::kChromeFrameHelperExe << " hung. Killing."; 253 VLOG(1) << installer::kChromeFrameHelperExe << " hung. Killing.";
254 base::CleanupProcesses(installer::kChromeFrameHelperExe, base::TimeDelta(), 254 base::CleanupProcesses(installer::kChromeFrameHelperExe, base::TimeDelta(),
255 content::RESULT_CODE_HUNG, NULL); 255 content::RESULT_CODE_HUNG, NULL);
256 } 256 }
257 } 257 }
258 258
259 // This method deletes the product's shortcut folder from the 259 // Deletes shortcuts at |install_level| from Start menu, Desktop,
260 // Windows Start menu. It checks system_uninstall to see if the shortcut is 260 // Quick Launch, taskbar, and secondary tiles on the Start Screen (Win8+).
261 // in all users start menu or current user start menu. 261 // Only shortcuts pointing to |target| will be removed.
262 // We try to remove the standard desktop shortcut but if that fails we try
263 // to remove the alternate desktop shortcut. Only one of them should be
264 // present in a given install but at this point we don't know which one.
265 // We remove all start screen secondary tiles by removing the folder Windows
266 // uses to store this installation's tiles.
267 void DeleteShortcuts(const InstallerState& installer_state, 262 void DeleteShortcuts(const InstallerState& installer_state,
268 const Product& product, 263 const Product& product,
269 const string16& target_exe) { 264 const string16& target_exe) {
270 BrowserDistribution* dist = product.distribution(); 265 BrowserDistribution* dist = product.distribution();
271 266
272 // The per-user shortcut for this user, if present on a system-level install, 267 // The per-user shortcut for this user, if present on a system-level install,
273 // has already been deleted in chrome_browser_main_win.cc::DoUninstallTasks(). 268 // has already been deleted in chrome_browser_main_win.cc::DoUninstallTasks().
274 ShellUtil::ShellChange install_level = installer_state.system_install() ? 269 ShellUtil::ShellChange install_level = installer_state.system_install() ?
275 ShellUtil::SYSTEM_LEVEL : ShellUtil::CURRENT_USER; 270 ShellUtil::SYSTEM_LEVEL : ShellUtil::CURRENT_USER;
276 271
(...skipping 769 matching lines...) Expand 10 before | Expand all | Expand 10 after
1046 new_cmd.AppendSwitch(installer::switches::kRemoveChromeRegistration); 1041 new_cmd.AppendSwitch(installer::switches::kRemoveChromeRegistration);
1047 if (!suffix.empty()) { 1042 if (!suffix.empty()) {
1048 new_cmd.AppendSwitchNative( 1043 new_cmd.AppendSwitchNative(
1049 installer::switches::kRegisterChromeBrowserSuffix, suffix); 1044 installer::switches::kRegisterChromeBrowserSuffix, suffix);
1050 } 1045 }
1051 DWORD exit_code = installer::UNKNOWN_STATUS; 1046 DWORD exit_code = installer::UNKNOWN_STATUS;
1052 InstallUtil::ExecuteExeAsAdmin(new_cmd, &exit_code); 1047 InstallUtil::ExecuteExeAsAdmin(new_cmd, &exit_code);
1053 } 1048 }
1054 } 1049 }
1055 1050
1056 // Chrome is not in use so lets uninstall Chrome by deleting various files
1057 // and registry entries. Here we will just make best effort and keep going
1058 // in case of errors.
1059 if (is_chrome) { 1051 if (is_chrome) {
1052 // Chrome is not in use so lets uninstall Chrome by deleting various files
1053 // and registry entries. Here we will just make best effort and keep going
1054 // in case of errors.
1060 ClearRlzProductState(); 1055 ClearRlzProductState();
1061 // Delete the key that delegate_execute might make. 1056 // Delete the key that delegate_execute might make.
1062 if (base::win::GetVersion() >= base::win::VERSION_WIN8) { 1057 if (base::win::GetVersion() >= base::win::VERSION_WIN8) {
1063 InstallUtil::DeleteRegistryKey(HKEY_CURRENT_USER, 1058 InstallUtil::DeleteRegistryKey(HKEY_CURRENT_USER,
1064 chrome::kMetroRegistryPath); 1059 chrome::kMetroRegistryPath);
1065 } 1060 }
1066 1061
1067 auto_launch_util::DisableAllAutoStartFeatures( 1062 auto_launch_util::DisableAllAutoStartFeatures(
1068 ASCIIToUTF16(chrome::kInitialProfile)); 1063 ASCIIToUTF16(chrome::kInitialProfile));
1069 1064
1070 // First delete shortcuts from Start->Programs, Desktop & Quick Launch.
1071 DeleteShortcuts(installer_state, product, chrome_exe); 1065 DeleteShortcuts(installer_state, product, chrome_exe);
1066
1067 } else if (product.is_chrome_app_host()) {
1068 // TODO(huangs): Remove this check once we have system-level App Host.
1069 DCHECK(!installer_state.system_install());
1070 const string16 app_host_exe(
1071 installer_state.target_path().Append(installer::kChromeAppHostExe)
1072 .value());
1073 DeleteShortcuts(installer_state, product, app_host_exe);
1072 } 1074 }
1073 1075
1074 // Delete the registry keys (Uninstall key and Version key). 1076 // Delete the registry keys (Uninstall key and Version key).
1075 HKEY reg_root = installer_state.root_key(); 1077 HKEY reg_root = installer_state.root_key();
1076 1078
1077 // Note that we must retrieve the distribution-specific data before deleting 1079 // Note that we must retrieve the distribution-specific data before deleting
1078 // product.GetVersionKey(). 1080 // product.GetVersionKey().
1079 string16 distribution_data(browser_dist->GetDistributionData(reg_root)); 1081 string16 distribution_data(browser_dist->GetDistributionData(reg_root));
1080 1082
1081 // Remove Control Panel uninstall link. 1083 // Remove Control Panel uninstall link.
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
1265 1267
1266 // Try and delete the preserved local state once the post-install 1268 // Try and delete the preserved local state once the post-install
1267 // operations are complete. 1269 // operations are complete.
1268 if (!backup_state_file.empty()) 1270 if (!backup_state_file.empty())
1269 file_util::Delete(backup_state_file, false); 1271 file_util::Delete(backup_state_file, false);
1270 1272
1271 return ret; 1273 return ret;
1272 } 1274 }
1273 1275
1274 } // namespace installer 1276 } // namespace installer
OLDNEW
« no previous file with comments | « chrome/installer/setup/install.cc ('k') | chrome/installer/util/chrome_app_host_distribution.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698