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

Unified Diff: chrome/installer/setup/install.cc

Issue 1289333005: Change shortcut install location to non-subdir. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: revert part of cl/1438793002 that is no longer needed Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/web_applications/web_app_win.cc ('k') | chrome/installer/setup/install_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/setup/install.cc
diff --git a/chrome/installer/setup/install.cc b/chrome/installer/setup/install.cc
index 3bd2a05066b16f7d37477be8a68b384ec84fa08b..8b83beff10b183c9f5132ab672dc68096ca3fa62 100644
--- a/chrome/installer/setup/install.cc
+++ b/chrome/installer/setup/install.cc
@@ -69,7 +69,10 @@ void LogShortcutOperation(ShellUtil::ShortcutLocation location,
case ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH:
message.append("Quick Launch ");
break;
- case ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR:
+ case ShellUtil::SHORTCUT_LOCATION_START_MENU_ROOT:
+ message.append("Start menu ");
+ break;
+ case ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED:
message.append("Start menu/" +
base::UTF16ToUTF8(dist->GetStartMenuShortcutSubfolder(
BrowserDistribution::SUBFOLDER_CHROME)) +
@@ -420,8 +423,24 @@ void CreateOrUpdateShortcuts(
ShellUtil::SHELL_SHORTCUT_CREATE_IF_NO_SYSTEM_LEVEL) {
start_menu_properties.set_pin_to_taskbar(!do_not_create_taskbar_shortcut);
}
+
+ // The attempt below to update the stortcut will fail if it does not already
+ // exist at the expected location on disk. First check if it exists in the
+ // previous location (under a subdirectory) and, if so, move it to the new
+ // location.
+ base::FilePath old_shortcut_path;
+ ShellUtil::GetShortcutPath(
+ ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED, dist,
+ shortcut_level, &old_shortcut_path);
+ if (base::PathExists(old_shortcut_path)) {
+ ShellUtil::MoveExistingShortcut(
+ ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR_DEPRECATED,
+ ShellUtil::SHORTCUT_LOCATION_START_MENU_ROOT,
+ dist, start_menu_properties);
+ }
+
ExecuteAndLogShortcutOperation(
- ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR, dist,
+ ShellUtil::SHORTCUT_LOCATION_START_MENU_ROOT, dist,
start_menu_properties, shortcut_operation);
}
« no previous file with comments | « chrome/browser/web_applications/web_app_win.cc ('k') | chrome/installer/setup/install_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698