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 |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "base/file_util.h" | 14 #include "base/file_util.h" |
15 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
16 #include "base/logging.h" | 16 #include "base/logging.h" |
17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
18 #include "base/numerics/safe_conversions.h" | 18 #include "base/numerics/safe_conversions.h" |
19 #include "base/path_service.h" | 19 #include "base/path_service.h" |
20 #include "base/process/launch.h" | |
21 #include "base/strings/string_util.h" | 20 #include "base/strings/string_util.h" |
22 #include "base/strings/stringprintf.h" | 21 #include "base/strings/stringprintf.h" |
23 #include "base/strings/utf_string_conversions.h" | 22 #include "base/strings/utf_string_conversions.h" |
24 #include "base/win/shortcut.h" | 23 #include "base/win/shortcut.h" |
25 #include "base/win/windows_version.h" | 24 #include "base/win/windows_version.h" |
26 #include "chrome/common/chrome_constants.h" | 25 #include "chrome/common/chrome_constants.h" |
27 #include "chrome/common/chrome_switches.h" | 26 #include "chrome/common/chrome_switches.h" |
28 #include "chrome/installer/launcher_support/chrome_launcher_support.h" | |
29 #include "chrome/installer/setup/install_worker.h" | 27 #include "chrome/installer/setup/install_worker.h" |
30 #include "chrome/installer/setup/setup_constants.h" | 28 #include "chrome/installer/setup/setup_constants.h" |
31 #include "chrome/installer/util/auto_launch_util.h" | 29 #include "chrome/installer/util/auto_launch_util.h" |
32 #include "chrome/installer/util/browser_distribution.h" | 30 #include "chrome/installer/util/browser_distribution.h" |
33 #include "chrome/installer/util/create_reg_key_work_item.h" | 31 #include "chrome/installer/util/create_reg_key_work_item.h" |
34 #include "chrome/installer/util/delete_after_reboot_helper.h" | 32 #include "chrome/installer/util/delete_after_reboot_helper.h" |
35 #include "chrome/installer/util/google_update_constants.h" | 33 #include "chrome/installer/util/google_update_constants.h" |
36 #include "chrome/installer/util/helper.h" | 34 #include "chrome/installer/util/helper.h" |
37 #include "chrome/installer/util/install_util.h" | 35 #include "chrome/installer/util/install_util.h" |
38 #include "chrome/installer/util/master_preferences.h" | 36 #include "chrome/installer/util/master_preferences.h" |
(...skipping 645 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 INSTALL_SHORTCUT_REPLACE_EXISTING : | 682 INSTALL_SHORTCUT_REPLACE_EXISTING : |
685 INSTALL_SHORTCUT_CREATE_EACH_IF_NO_SYSTEM_LEVEL); | 683 INSTALL_SHORTCUT_CREATE_EACH_IF_NO_SYSTEM_LEVEL); |
686 | 684 |
687 // Read master_preferences copied beside chrome.exe at install. | 685 // Read master_preferences copied beside chrome.exe at install. |
688 MasterPreferences prefs(installation_root.AppendASCII(kDefaultMasterPrefs)); | 686 MasterPreferences prefs(installation_root.AppendASCII(kDefaultMasterPrefs)); |
689 base::FilePath chrome_exe(installation_root.Append(kChromeExe)); | 687 base::FilePath chrome_exe(installation_root.Append(kChromeExe)); |
690 CreateOrUpdateShortcuts( | 688 CreateOrUpdateShortcuts( |
691 chrome_exe, chrome, prefs, CURRENT_USER, install_operation); | 689 chrome_exe, chrome, prefs, CURRENT_USER, install_operation); |
692 } | 690 } |
693 | 691 |
694 bool InstallFromWebstore(const std::string& app_code) { | |
695 base::FilePath app_host_path(chrome_launcher_support::GetAnyAppHostPath()); | |
696 if (app_host_path.empty()) | |
697 return false; | |
698 | |
699 CommandLine cmd(app_host_path); | |
700 cmd.AppendSwitchASCII(::switches::kInstallFromWebstore, app_code); | |
701 VLOG(1) << "App install command: " << cmd.GetCommandLineString(); | |
702 return base::LaunchProcess(cmd, base::LaunchOptions(), NULL); | |
703 } | |
704 | |
705 } // namespace installer | 692 } // namespace installer |
OLD | NEW |