Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Side by Side Diff: chrome/installer/util/install_util.cc

Issue 3836005: Move pe_image and registry from base to base/win and use the namespace. It re... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/installer/util/install_util.h ('k') | chrome/installer/util/set_reg_value_work_item.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/command_line.h"
16 #include "base/file_util.h" 16 #include "base/file_util.h"
17 #include "base/logging.h" 17 #include "base/logging.h"
18 #include "base/path_service.h" 18 #include "base/path_service.h"
19 #include "base/registry.h"
20 #include "base/scoped_ptr.h" 19 #include "base/scoped_ptr.h"
21 #include "base/string_util.h" 20 #include "base/string_util.h"
22 #include "base/values.h" 21 #include "base/values.h"
22 #include "base/win/registry.h"
23 #include "base/win/windows_version.h" 23 #include "base/win/windows_version.h"
24 #include "chrome/common/json_value_serializer.h" 24 #include "chrome/common/json_value_serializer.h"
25 #include "chrome/installer/util/browser_distribution.h" 25 #include "chrome/installer/util/browser_distribution.h"
26 #include "chrome/installer/util/google_update_constants.h" 26 #include "chrome/installer/util/google_update_constants.h"
27 #include "chrome/installer/util/l10n_string_util.h" 27 #include "chrome/installer/util/l10n_string_util.h"
28 #include "chrome/installer/util/master_preferences.h" 28 #include "chrome/installer/util/master_preferences.h"
29 #include "chrome/installer/util/util_constants.h" 29 #include "chrome/installer/util/util_constants.h"
30 #include "chrome/installer/util/work_item_list.h" 30 #include "chrome/installer/util/work_item_list.h"
31 31
32 using base::win::RegKey;
33
32 bool InstallUtil::ExecuteExeAsAdmin(const std::wstring& exe, 34 bool InstallUtil::ExecuteExeAsAdmin(const std::wstring& exe,
33 const std::wstring& params, 35 const std::wstring& params,
34 DWORD* exit_code) { 36 DWORD* exit_code) {
35 SHELLEXECUTEINFO info = {0}; 37 SHELLEXECUTEINFO info = {0};
36 info.cbSize = sizeof(SHELLEXECUTEINFO); 38 info.cbSize = sizeof(SHELLEXECUTEINFO);
37 info.fMask = SEE_MASK_NOCLOSEPROCESS; 39 info.fMask = SEE_MASK_NOCLOSEPROCESS;
38 info.lpVerb = L"runas"; 40 info.lpVerb = L"runas";
39 info.lpFile = exe.c_str(); 41 info.lpFile = exe.c_str();
40 info.lpParameters = params.c_str(); 42 info.lpParameters = params.c_str();
41 info.nShow = SW_SHOW; 43 info.nShow = SW_SHOW;
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 const std::wstring& value_name) { 277 const std::wstring& value_name) {
276 RegKey key(reg_root, key_path.c_str(), KEY_ALL_ACCESS); 278 RegKey key(reg_root, key_path.c_str(), KEY_ALL_ACCESS);
277 LOG(INFO) << "Deleting registry value " << value_name; 279 LOG(INFO) << "Deleting registry value " << value_name;
278 if (key.ValueExists(value_name.c_str()) && 280 if (key.ValueExists(value_name.c_str()) &&
279 !key.DeleteValue(value_name.c_str())) { 281 !key.DeleteValue(value_name.c_str())) {
280 LOG(ERROR) << "Failed to delete registry value: " << value_name; 282 LOG(ERROR) << "Failed to delete registry value: " << value_name;
281 return false; 283 return false;
282 } 284 }
283 return true; 285 return true;
284 } 286 }
OLDNEW
« no previous file with comments | « chrome/installer/util/install_util.h ('k') | chrome/installer/util/set_reg_value_work_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698