| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // See the corresponding header file for description of the functions in this | 5 // See the corresponding header file for description of the functions in this |
| 6 // file. | 6 // file. |
| 7 | 7 |
| 8 #include "chrome/installer/util/install_util.h" | 8 #include "chrome/installer/util/install_util.h" |
| 9 | 9 |
| 10 #include <shellapi.h> | 10 #include <shellapi.h> |
| 11 #include <shlobj.h> | 11 #include <shlobj.h> |
| 12 | 12 |
| 13 #include <algorithm> | 13 #include <algorithm> |
| 14 | 14 |
| 15 #include "base/command_line.h" |
| 15 #include "base/file_util.h" | 16 #include "base/file_util.h" |
| 16 #include "base/logging.h" | 17 #include "base/logging.h" |
| 17 #include "base/path_service.h" | 18 #include "base/path_service.h" |
| 18 #include "base/scoped_ptr.h" | 19 #include "base/scoped_ptr.h" |
| 19 #include "base/string_util.h" | 20 #include "base/string_util.h" |
| 20 #include "base/values.h" | 21 #include "base/values.h" |
| 22 #include "base/version.h" |
| 21 #include "base/win/registry.h" | 23 #include "base/win/registry.h" |
| 22 #include "base/win/windows_version.h" | 24 #include "base/win/windows_version.h" |
| 23 #include "chrome/common/json_value_serializer.h" | 25 #include "chrome/common/json_value_serializer.h" |
| 24 #include "chrome/installer/util/browser_distribution.h" | 26 #include "chrome/installer/util/browser_distribution.h" |
| 25 #include "chrome/installer/util/google_update_constants.h" | 27 #include "chrome/installer/util/google_update_constants.h" |
| 26 #include "chrome/installer/util/l10n_string_util.h" | 28 #include "chrome/installer/util/l10n_string_util.h" |
| 27 #include "chrome/installer/util/master_preferences_constants.h" | |
| 28 #include "chrome/installer/util/util_constants.h" | 29 #include "chrome/installer/util/util_constants.h" |
| 29 #include "chrome/installer/util/work_item_list.h" | 30 #include "chrome/installer/util/work_item_list.h" |
| 30 | 31 |
| 31 using base::win::RegKey; | 32 using base::win::RegKey; |
| 32 using installer::MasterPreferences; | |
| 33 | 33 |
| 34 bool InstallUtil::ExecuteExeAsAdmin(const CommandLine& cmd, DWORD* exit_code) { | 34 bool InstallUtil::ExecuteExeAsAdmin(const CommandLine& cmd, DWORD* exit_code) { |
| 35 FilePath::StringType program(cmd.GetProgram().value()); | 35 FilePath::StringType program(cmd.GetProgram().value()); |
| 36 DCHECK(!program.empty()); | 36 DCHECK(!program.empty()); |
| 37 DCHECK_NE(program[0], L'\"'); | 37 DCHECK_NE(program[0], L'\"'); |
| 38 | 38 |
| 39 CommandLine::StringType params(cmd.command_line_string()); | 39 CommandLine::StringType params(cmd.command_line_string()); |
| 40 if (params[0] == '"') { | 40 if (params[0] == '"') { |
| 41 DCHECK_EQ('"', params[program.length() + 1]); | 41 DCHECK_EQ('"', params[program.length() + 1]); |
| 42 DCHECK_EQ(program, params.substr(1, program.length())); | 42 DCHECK_EQ(program, params.substr(1, program.length())); |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 switch (status) { | 233 switch (status) { |
| 234 case installer::FIRST_INSTALL_SUCCESS: | 234 case installer::FIRST_INSTALL_SUCCESS: |
| 235 case installer::INSTALL_REPAIRED: | 235 case installer::INSTALL_REPAIRED: |
| 236 case installer::NEW_VERSION_UPDATED: | 236 case installer::NEW_VERSION_UPDATED: |
| 237 case installer::IN_USE_UPDATED: | 237 case installer::IN_USE_UPDATED: |
| 238 return 0; | 238 return 0; |
| 239 default: | 239 default: |
| 240 return status; | 240 return status; |
| 241 } | 241 } |
| 242 } | 242 } |
| OLD | NEW |