Chromium Code Reviews| 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. | |
| 540 DCHECK(!installer_state.system_install()); | |
| 541 const base::FilePath app_host_exe( | 539 const base::FilePath app_host_exe( |
| 542 installer_state.target_path().Append(kChromeAppHostExe)); | 540 installer_state.target_path().Append(kChromeAppHostExe)); |
| 543 InstallShortcutOperation app_launcher_shortcut_operation = | 541 InstallShortcutOperation app_launcher_shortcut_operation = |
| 544 GetAppLauncherShortcutOperation(original_state, installer_state); | 542 GetAppLauncherShortcutOperation(original_state, installer_state); |
| 545 | 543 |
| 546 // Always install per-user shortcuts for App Launcher. | 544 // Always install per-user shortcuts for App Launcher. |
| 547 CreateOrUpdateShortcuts(app_host_exe, *app_launcher_product, prefs, | 545 CreateOrUpdateShortcuts(app_host_exe, *app_launcher_product, prefs, |
| 548 CURRENT_USER, app_launcher_shortcut_operation); | 546 CURRENT_USER, app_launcher_shortcut_operation); |
|
grt (UTC plus 2)
2013/05/24 01:18:07
will this ever be hit? it's very bad for this to t
gab
2013/05/24 12:32:33
I don't think that's true. We already do this for
grt (UTC plus 2)
2013/05/24 15:41:09
The installer may run as SYSTEM, where there is no
gab
2013/05/24 15:42:17
My bad, I didn't get Greg's point correctly at fir
huangs
2013/05/24 15:54:30
We're not hitting this DCHECK, but I need to do mo
gab
2013/05/24 15:57:55
Aren't you on vacation?!
There is no rush really
grt (UTC plus 2)
2013/05/24 16:04:25
If CheckAppHostPreconditions is to be believed, th
huangs
2013/05/24 16:21:57
Okay... I'm back on Tuesday though. A new concern
huangs
2013/05/24 18:39:46
Did some testing and investigation, verified that
| |
| 549 } | 547 } |
| 550 | 548 |
| 551 const Product* chrome_product = | 549 const Product* chrome_product = |
| 552 installer_state.FindProduct(BrowserDistribution::CHROME_BROWSER); | 550 installer_state.FindProduct(BrowserDistribution::CHROME_BROWSER); |
| 553 // Creates shortcuts for Chrome. | 551 // Creates shortcuts for Chrome. |
| 554 if (chrome_product) { | 552 if (chrome_product) { |
| 555 BrowserDistribution* chrome_dist = chrome_product->distribution(); | 553 BrowserDistribution* chrome_dist = chrome_product->distribution(); |
| 556 const base::FilePath chrome_exe( | 554 const base::FilePath chrome_exe( |
| 557 installer_state.target_path().Append(kChromeExe)); | 555 installer_state.target_path().Append(kChromeExe)); |
| 558 CleanupLegacyShortcuts(installer_state, chrome_dist, chrome_exe); | 556 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()) | 687 if (app_host_path.empty()) |
| 690 return false; | 688 return false; |
| 691 | 689 |
| 692 CommandLine cmd(app_host_path); | 690 CommandLine cmd(app_host_path); |
| 693 cmd.AppendSwitchASCII(::switches::kInstallFromWebstore, app_code); | 691 cmd.AppendSwitchASCII(::switches::kInstallFromWebstore, app_code); |
| 694 VLOG(1) << "App install command: " << cmd.GetCommandLineString(); | 692 VLOG(1) << "App install command: " << cmd.GetCommandLineString(); |
| 695 return base::LaunchProcess(cmd, base::LaunchOptions(), NULL); | 693 return base::LaunchProcess(cmd, base::LaunchOptions(), NULL); |
| 696 } | 694 } |
| 697 | 695 |
| 698 } // namespace installer | 696 } // namespace installer |
| OLD | NEW |