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 #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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
69 message.append("(maybe the shortcut doesn't exist?) "); | 69 message.append("(maybe the shortcut doesn't exist?) "); |
70 message.append((properties.level == ShellUtil::CURRENT_USER) ? "per-user " : | 70 message.append((properties.level == ShellUtil::CURRENT_USER) ? "per-user " : |
71 "all-users "); | 71 "all-users "); |
72 switch (location) { | 72 switch (location) { |
73 case ShellUtil::SHORTCUT_LOCATION_DESKTOP: | 73 case ShellUtil::SHORTCUT_LOCATION_DESKTOP: |
74 message.append("Desktop "); | 74 message.append("Desktop "); |
75 break; | 75 break; |
76 case ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH: | 76 case ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH: |
77 message.append("Quick Launch "); | 77 message.append("Quick Launch "); |
78 break; | 78 break; |
79 case ShellUtil::SHORTCUT_LOCATION_START_MENU: | 79 case ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR: |
80 message.append("Start menu "); | 80 message.append("Start menu "); |
gab
2013/05/15 21:26:38
s/"Start menu "/"Start menu/Google Chrome "
calamity
2013/08/27 07:59:35
Done.
| |
81 break; | 81 break; |
82 default: | 82 default: |
83 NOTREACHED(); | 83 NOTREACHED(); |
84 } | 84 } |
85 | 85 |
86 message.push_back('"'); | 86 message.push_back('"'); |
87 if (properties.has_shortcut_name()) | 87 if (properties.has_shortcut_name()) |
88 message.append(UTF16ToUTF8(properties.shortcut_name)); | 88 message.append(UTF16ToUTF8(properties.shortcut_name)); |
89 else | 89 else |
90 message.append(UTF16ToUTF8(dist->GetAppShortCutName())); | 90 message.append(UTF16ToUTF8(dist->GetAppShortCutName())); |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
246 // this is a system-level install, also deletes the old Default user Quick | 246 // this is a system-level install, also deletes the old Default user Quick |
247 // Launch shortcut. Both of these were created prior to Chrome 24; in Chrome 24, | 247 // Launch shortcut. Both of these were created prior to Chrome 24; in Chrome 24, |
248 // the uninstall shortcut was removed and the Default user Quick Launch shortcut | 248 // the uninstall shortcut was removed and the Default user Quick Launch shortcut |
249 // was replaced by per-user shortcuts created via Active Setup. | 249 // was replaced by per-user shortcuts created via Active Setup. |
250 void CleanupLegacyShortcuts(const InstallerState& installer_state, | 250 void CleanupLegacyShortcuts(const InstallerState& installer_state, |
251 BrowserDistribution* dist, | 251 BrowserDistribution* dist, |
252 const base::FilePath& chrome_exe) { | 252 const base::FilePath& chrome_exe) { |
253 ShellUtil::ShellChange shortcut_level = installer_state.system_install() ? | 253 ShellUtil::ShellChange shortcut_level = installer_state.system_install() ? |
254 ShellUtil::SYSTEM_LEVEL : ShellUtil::CURRENT_USER; | 254 ShellUtil::SYSTEM_LEVEL : ShellUtil::CURRENT_USER; |
255 base::FilePath uninstall_shortcut_path; | 255 base::FilePath uninstall_shortcut_path; |
256 ShellUtil::GetShortcutPath(ShellUtil::SHORTCUT_LOCATION_START_MENU, dist, | 256 ShellUtil::GetShortcutPath(ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR, |
257 shortcut_level, &uninstall_shortcut_path); | 257 dist, shortcut_level, &uninstall_shortcut_path); |
258 uninstall_shortcut_path = uninstall_shortcut_path.Append( | 258 uninstall_shortcut_path = uninstall_shortcut_path.Append( |
259 dist->GetUninstallLinkName() + installer::kLnkExt); | 259 dist->GetUninstallLinkName() + installer::kLnkExt); |
260 file_util::Delete(uninstall_shortcut_path, false); | 260 file_util::Delete(uninstall_shortcut_path, false); |
261 | 261 |
262 if (installer_state.system_install()) { | 262 if (installer_state.system_install()) { |
263 ShellUtil::RemoveShortcuts( | 263 ShellUtil::RemoveShortcuts( |
264 ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH, dist, | 264 ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH, dist, |
265 ShellUtil::SYSTEM_LEVEL, chrome_exe); | 265 ShellUtil::SYSTEM_LEVEL, chrome_exe); |
266 } | 266 } |
267 } | 267 } |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
443 // IMPORTANT: Only the default (no arguments and default browserappid) browser | 443 // IMPORTANT: Only the default (no arguments and default browserappid) browser |
444 // shortcut in the Start menu (Start screen on Win8+) should be made dual | 444 // shortcut in the Start menu (Start screen on Win8+) should be made dual |
445 // mode. | 445 // mode. |
446 start_menu_properties.set_dual_mode(true); | 446 start_menu_properties.set_dual_mode(true); |
447 if (!do_not_create_taskbar_shortcut && | 447 if (!do_not_create_taskbar_shortcut && |
448 (shortcut_operation == ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS || | 448 (shortcut_operation == ShellUtil::SHELL_SHORTCUT_CREATE_ALWAYS || |
449 shortcut_operation == | 449 shortcut_operation == |
450 ShellUtil::SHELL_SHORTCUT_CREATE_IF_NO_SYSTEM_LEVEL)) { | 450 ShellUtil::SHELL_SHORTCUT_CREATE_IF_NO_SYSTEM_LEVEL)) { |
451 start_menu_properties.set_pin_to_taskbar(true); | 451 start_menu_properties.set_pin_to_taskbar(true); |
452 } | 452 } |
453 ExecuteAndLogShortcutOperation(ShellUtil::SHORTCUT_LOCATION_START_MENU, | 453 ExecuteAndLogShortcutOperation( |
454 dist, start_menu_properties, | 454 ShellUtil::SHORTCUT_LOCATION_START_MENU_CHROME_DIR, |
455 shortcut_operation); | 455 dist, start_menu_properties, shortcut_operation); |
456 } | 456 } |
457 | 457 |
458 void RegisterChromeOnMachine(const InstallerState& installer_state, | 458 void RegisterChromeOnMachine(const InstallerState& installer_state, |
459 const Product& product, | 459 const Product& product, |
460 bool make_chrome_default) { | 460 bool make_chrome_default) { |
461 DCHECK(product.is_chrome()); | 461 DCHECK(product.is_chrome()); |
462 | 462 |
463 // Try to add Chrome to Media Player shim inclusion list. We don't do any | 463 // Try to add Chrome to Media Player shim inclusion list. We don't do any |
464 // error checking here because this operation will fail if user doesn't | 464 // error checking here because this operation will fail if user doesn't |
465 // have admin rights and we want to ignore the error. | 465 // have admin rights and we want to ignore the error. |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
689 if (app_host_path.empty()) | 689 if (app_host_path.empty()) |
690 return false; | 690 return false; |
691 | 691 |
692 CommandLine cmd(app_host_path); | 692 CommandLine cmd(app_host_path); |
693 cmd.AppendSwitchASCII(::switches::kInstallFromWebstore, app_code); | 693 cmd.AppendSwitchASCII(::switches::kInstallFromWebstore, app_code); |
694 VLOG(1) << "App install command: " << cmd.GetCommandLineString(); | 694 VLOG(1) << "App install command: " << cmd.GetCommandLineString(); |
695 return base::LaunchProcess(cmd, base::LaunchOptions(), NULL); | 695 return base::LaunchProcess(cmd, base::LaunchOptions(), NULL); |
696 } | 696 } |
697 | 697 |
698 } // namespace installer | 698 } // namespace installer |
OLD | NEW |