Chromium Code Reviews| Index: chrome/installer/setup/install.cc |
| diff --git a/chrome/installer/setup/install.cc b/chrome/installer/setup/install.cc |
| index 978646fa60e99b4e4d15ceac4e114a62bb161ee2..13e0f68fd857506893e63aa2a3f18279cdf9d84b 100644 |
| --- a/chrome/installer/setup/install.cc |
| +++ b/chrome/installer/setup/install.cc |
| @@ -70,7 +70,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)) + |
| @@ -111,7 +114,7 @@ void LogShortcutOperation(ShellUtil::ShortcutLocation location, |
| VLOG(1) << message; |
| } |
| -void ExecuteAndLogShortcutOperation( |
| +bool ExecuteAndLogShortcutOperation( |
|
gab
2015/10/20 18:25:59
grt pinged about this already I think, but adding
bcwhite
2015/10/20 19:03:12
It was used in a previous incarnation of the patch
|
| ShellUtil::ShortcutLocation location, |
| BrowserDistribution* dist, |
| const ShellUtil::ShortcutProperties& properties, |
| @@ -120,7 +123,9 @@ void ExecuteAndLogShortcutOperation( |
| if (!ShellUtil::CreateOrUpdateShortcut(location, dist, properties, |
| operation)) { |
| LogShortcutOperation(location, dist, properties, operation, true); |
| + return false; |
| } |
| + return true; |
| } |
| void AddChromeToMediaPlayerList() { |
| @@ -423,8 +428,24 @@ void CreateOrUpdateShortcuts( |
| ShellUtil::SHELL_SHORTCUT_CREATE_IF_NO_SYSTEM_LEVEL) { |
| start_menu_properties.set_pin_to_taskbar(!do_not_create_taskbar_shortcut); |
| } |
| + |
| + // Move start-menu shortcut out of the deprecated Chrome specific subfolder. |
| + // This needs to happen before the shortcut update below or the latter will |
| + // fail due to the existing shortcut not being in the same location as the |
| + // new one. |
| + 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); |
| } |