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

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

Issue 13864015: Move app launcher and chrome apps shortcut strings into the installer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@migrate_app_id_fix
Patch Set: add #ifdef for linux only property Created 7 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
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 #include "chrome/installer/setup/install.h" 5 #include "chrome/installer/setup/install.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <shlobj.h> 8 #include <shlobj.h>
9 #include <time.h> 9 #include <time.h>
10 10
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 message.append("(maybe the shortcut doesn't exist?) "); 70 message.append("(maybe the shortcut doesn't exist?) ");
71 message.append((properties.level == ShellUtil::CURRENT_USER) ? "per-user " : 71 message.append((properties.level == ShellUtil::CURRENT_USER) ? "per-user " :
72 "all-users "); 72 "all-users ");
73 switch (location) { 73 switch (location) {
74 case ShellUtil::SHORTCUT_LOCATION_DESKTOP: 74 case ShellUtil::SHORTCUT_LOCATION_DESKTOP:
75 message.append("Desktop "); 75 message.append("Desktop ");
76 break; 76 break;
77 case ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH: 77 case ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH:
78 message.append("Quick Launch "); 78 message.append("Quick Launch ");
79 break; 79 break;
80 case ShellUtil::SHORTCUT_LOCATION_START_MENU: 80 case ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR:
81 message.append("Start menu "); 81 message.append("Start menu/" + dist->GetStartMenuShortcutSubfolder(
82 BrowserDistribution::SUBFOLDER_CHROME) + " ");
83 break;
84 case ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_APPS_DIR:
85 message.append("Start menu/" + dist->GetStartMenuShortcutSubfolder(
86 BrowserDistribution::SUBFOLDER_APPS) + " ");
82 break; 87 break;
83 default: 88 default:
84 NOTREACHED(); 89 NOTREACHED();
85 } 90 }
86 91
87 message.push_back('"'); 92 message.push_back('"');
88 if (properties.has_shortcut_name()) 93 if (properties.has_shortcut_name())
89 message.append(UTF16ToUTF8(properties.shortcut_name)); 94 message.append(UTF16ToUTF8(properties.shortcut_name));
90 else 95 else
91 message.append(UTF16ToUTF8(dist->GetDisplayName())); 96 message.append(UTF16ToUTF8(dist->GetDisplayName()));
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 // this is a system-level install, also deletes the old Default user Quick 252 // this is a system-level install, also deletes the old Default user Quick
248 // Launch shortcut. Both of these were created prior to Chrome 24; in Chrome 24, 253 // Launch shortcut. Both of these were created prior to Chrome 24; in Chrome 24,
249 // the uninstall shortcut was removed and the Default user Quick Launch shortcut 254 // the uninstall shortcut was removed and the Default user Quick Launch shortcut
250 // was replaced by per-user shortcuts created via Active Setup. 255 // was replaced by per-user shortcuts created via Active Setup.
251 void CleanupLegacyShortcuts(const InstallerState& installer_state, 256 void CleanupLegacyShortcuts(const InstallerState& installer_state,
252 BrowserDistribution* dist, 257 BrowserDistribution* dist,
253 const base::FilePath& chrome_exe) { 258 const base::FilePath& chrome_exe) {
254 ShellUtil::ShellChange shortcut_level = installer_state.system_install() ? 259 ShellUtil::ShellChange shortcut_level = installer_state.system_install() ?
255 ShellUtil::SYSTEM_LEVEL : ShellUtil::CURRENT_USER; 260 ShellUtil::SYSTEM_LEVEL : ShellUtil::CURRENT_USER;
256 base::FilePath uninstall_shortcut_path; 261 base::FilePath uninstall_shortcut_path;
257 ShellUtil::GetShortcutPath(ShellUtil::SHORTCUT_LOCATION_START_MENU, dist, 262 ShellUtil::GetShortcutPath(ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR,
258 shortcut_level, &uninstall_shortcut_path); 263 dist, shortcut_level, &uninstall_shortcut_path);
259 uninstall_shortcut_path = uninstall_shortcut_path.Append( 264 uninstall_shortcut_path = uninstall_shortcut_path.Append(
260 dist->GetUninstallLinkName() + installer::kLnkExt); 265 dist->GetUninstallLinkName() + installer::kLnkExt);
261 base::DeleteFile(uninstall_shortcut_path, false); 266 base::DeleteFile(uninstall_shortcut_path, false);
262 267
263 if (installer_state.system_install()) { 268 if (installer_state.system_install()) {
264 ShellUtil::RemoveShortcuts( 269 ShellUtil::RemoveShortcuts(
265 ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH, dist, 270 ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH, dist,
266 ShellUtil::SYSTEM_LEVEL, chrome_exe); 271 ShellUtil::SYSTEM_LEVEL, chrome_exe);
267 } 272 }
268 } 273 }
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 // IMPORTANT: Only the default (no arguments and default browserappid) browser 455 // IMPORTANT: Only the default (no arguments and default browserappid) browser
451 // shortcut in the Start menu (Start screen on Win8+) should be made dual 456 // shortcut in the Start menu (Start screen on Win8+) should be made dual
452 // mode. 457 // mode.
453 start_menu_properties.set_dual_mode(true); 458 start_menu_properties.set_dual_mode(true);
454 if (!do_not_create_taskbar_shortcut && 459 if (!do_not_create_taskbar_shortcut &&
455 (shortcut_operation == ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS || 460 (shortcut_operation == ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS ||
456 shortcut_operation == 461 shortcut_operation ==
457 ShellUtil::SHELL_SHORTCUT_CREATE_IF_NO_SYSTEM_LEVEL)) { 462 ShellUtil::SHELL_SHORTCUT_CREATE_IF_NO_SYSTEM_LEVEL)) {
458 start_menu_properties.set_pin_to_taskbar(true); 463 start_menu_properties.set_pin_to_taskbar(true);
459 } 464 }
460 ExecuteAndLogShortcutOperation(ShellUtil::SHORTCUT_LOCATION_START_MENU, 465 ExecuteAndLogShortcutOperation(
461 dist, start_menu_properties, 466 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR, dist,
462 shortcut_operation); 467 start_menu_properties, shortcut_operation);
463 } 468 }
464 469
465 void RegisterChromeOnMachine(const InstallerState& installer_state, 470 void RegisterChromeOnMachine(const InstallerState& installer_state,
466 const Product& product, 471 const Product& product,
467 bool make_chrome_default) { 472 bool make_chrome_default) {
468 DCHECK(product.is_chrome()); 473 DCHECK(product.is_chrome());
469 474
470 // Try to add Chrome to Media Player shim inclusion list. We don't do any 475 // Try to add Chrome to Media Player shim inclusion list. We don't do any
471 // error checking here because this operation will fail if user doesn't 476 // error checking here because this operation will fail if user doesn't
472 // have admin rights and we want to ignore the error. 477 // have admin rights and we want to ignore the error.
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 if (app_host_path.empty()) 699 if (app_host_path.empty())
695 return false; 700 return false;
696 701
697 CommandLine cmd(app_host_path); 702 CommandLine cmd(app_host_path);
698 cmd.AppendSwitchASCII(::switches::kInstallFromWebstore, app_code); 703 cmd.AppendSwitchASCII(::switches::kInstallFromWebstore, app_code);
699 VLOG(1) << "App install command: " << cmd.GetCommandLineString(); 704 VLOG(1) << "App install command: " << cmd.GetCommandLineString();
700 return base::LaunchProcess(cmd, base::LaunchOptions(), NULL); 705 return base::LaunchProcess(cmd, base::LaunchOptions(), NULL);
701 } 706 }
702 707
703 } // namespace installer 708 } // namespace installer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698