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 518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
529 | 529 |
530 if (result == FIRST_INSTALL_SUCCESS && !prefs_path.empty()) | 530 if (result == FIRST_INSTALL_SUCCESS && !prefs_path.empty()) |
531 CopyPreferenceFileForFirstRun(installer_state, prefs_path); | 531 CopyPreferenceFileForFirstRun(installer_state, prefs_path); |
532 | 532 |
533 installer_state.UpdateStage(installer::CREATING_SHORTCUTS); | 533 installer_state.UpdateStage(installer::CREATING_SHORTCUTS); |
534 | 534 |
535 const Product* app_launcher_product = | 535 const Product* app_launcher_product = |
536 installer_state.FindProduct(BrowserDistribution::CHROME_APP_HOST); | 536 installer_state.FindProduct(BrowserDistribution::CHROME_APP_HOST); |
537 // Creates shortcuts for App Launcher. | 537 // Creates shortcuts for App Launcher. |
538 if (app_launcher_product) { | 538 if (app_launcher_product) { |
539 // TODO(huangs): Remove this check once we have system-level App Host. | 539 if (!installer_state.system_install()) { |
540 DCHECK(!installer_state.system_install()); | 540 const base::FilePath app_host_exe( |
gab
2013/05/28 14:51:39
I don't think we need to remove this DCHECK for no
huangs
2013/05/28 14:57:04
Agreed; there's no need to wipe out the same TODO
| |
541 const base::FilePath app_host_exe( | 541 installer_state.target_path().Append(kChromeAppHostExe)); |
542 installer_state.target_path().Append(kChromeAppHostExe)); | 542 InstallShortcutOperation app_launcher_shortcut_operation = |
543 InstallShortcutOperation app_launcher_shortcut_operation = | 543 GetAppLauncherShortcutOperation(original_state, installer_state); |
544 GetAppLauncherShortcutOperation(original_state, installer_state); | |
545 | 544 |
546 // Always install per-user shortcuts for App Launcher. | 545 // Always install per-user shortcuts for App Launcher. |
547 CreateOrUpdateShortcuts(app_host_exe, *app_launcher_product, prefs, | 546 CreateOrUpdateShortcuts(app_host_exe, *app_launcher_product, prefs, |
548 CURRENT_USER, app_launcher_shortcut_operation); | 547 CURRENT_USER, app_launcher_shortcut_operation); |
548 } else { | |
549 VLOG(1) << "Skipping shortcut creation for system-level legacy " | |
550 "App Launcher"; | |
551 } | |
549 } | 552 } |
550 | 553 |
551 const Product* chrome_product = | 554 const Product* chrome_product = |
552 installer_state.FindProduct(BrowserDistribution::CHROME_BROWSER); | 555 installer_state.FindProduct(BrowserDistribution::CHROME_BROWSER); |
553 // Creates shortcuts for Chrome. | 556 // Creates shortcuts for Chrome. |
554 if (chrome_product) { | 557 if (chrome_product) { |
555 BrowserDistribution* chrome_dist = chrome_product->distribution(); | 558 BrowserDistribution* chrome_dist = chrome_product->distribution(); |
556 const base::FilePath chrome_exe( | 559 const base::FilePath chrome_exe( |
557 installer_state.target_path().Append(kChromeExe)); | 560 installer_state.target_path().Append(kChromeExe)); |
558 CleanupLegacyShortcuts(installer_state, chrome_dist, chrome_exe); | 561 CleanupLegacyShortcuts(installer_state, chrome_dist, chrome_exe); |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
689 if (app_host_path.empty()) | 692 if (app_host_path.empty()) |
690 return false; | 693 return false; |
691 | 694 |
692 CommandLine cmd(app_host_path); | 695 CommandLine cmd(app_host_path); |
693 cmd.AppendSwitchASCII(::switches::kInstallFromWebstore, app_code); | 696 cmd.AppendSwitchASCII(::switches::kInstallFromWebstore, app_code); |
694 VLOG(1) << "App install command: " << cmd.GetCommandLineString(); | 697 VLOG(1) << "App install command: " << cmd.GetCommandLineString(); |
695 return base::LaunchProcess(cmd, base::LaunchOptions(), NULL); | 698 return base::LaunchProcess(cmd, base::LaunchOptions(), NULL); |
696 } | 699 } |
697 | 700 |
698 } // namespace installer | 701 } // namespace installer |
OLD | NEW |