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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 LOG(ERROR) << "Could not add Chrome to media player inclusion list."; | 134 LOG(ERROR) << "Could not add Chrome to media player inclusion list."; |
135 } | 135 } |
136 | 136 |
137 // Copy master_preferences file provided to installer, in the same folder | 137 // Copy master_preferences file provided to installer, in the same folder |
138 // as chrome.exe so Chrome first run can find it. This function will be called | 138 // as chrome.exe so Chrome first run can find it. This function will be called |
139 // only on the first install of Chrome. | 139 // only on the first install of Chrome. |
140 void CopyPreferenceFileForFirstRun(const InstallerState& installer_state, | 140 void CopyPreferenceFileForFirstRun(const InstallerState& installer_state, |
141 const base::FilePath& prefs_source_path) { | 141 const base::FilePath& prefs_source_path) { |
142 base::FilePath prefs_dest_path(installer_state.target_path().AppendASCII( | 142 base::FilePath prefs_dest_path(installer_state.target_path().AppendASCII( |
143 installer::kDefaultMasterPrefs)); | 143 installer::kDefaultMasterPrefs)); |
144 if (!file_util::CopyFile(prefs_source_path, prefs_dest_path)) { | 144 if (!base::CopyFile(prefs_source_path, prefs_dest_path)) { |
145 VLOG(1) << "Failed to copy master preferences from:" | 145 VLOG(1) << "Failed to copy master preferences from:" |
146 << prefs_source_path.value() << " gle: " << ::GetLastError(); | 146 << prefs_source_path.value() << " gle: " << ::GetLastError(); |
147 } | 147 } |
148 } | 148 } |
149 | 149 |
150 // This function installs a new version of Chrome to the specified location. | 150 // This function installs a new version of Chrome to the specified location. |
151 // | 151 // |
152 // setup_path: Path to the executable (setup.exe) as it will be copied | 152 // setup_path: Path to the executable (setup.exe) as it will be copied |
153 // to Chrome install folder after install is complete | 153 // to Chrome install folder after install is complete |
154 // archive_path: Path to the archive (chrome.7z) as it will be copied | 154 // archive_path: Path to the archive (chrome.7z) as it will be copied |
(...skipping 534 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 |