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

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

Issue 1882923003: Add best-effort/allow rollback flags on WorkItem. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@simple_list_tests
Patch Set: fix build error Created 4 years, 7 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
OLDNEW
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 // 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>
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after
278 } 278 }
279 279
280 void InstallUtil::AddInstallerResultItems( 280 void InstallUtil::AddInstallerResultItems(
281 bool system_install, 281 bool system_install,
282 const base::string16& state_key, 282 const base::string16& state_key,
283 installer::InstallStatus status, 283 installer::InstallStatus status,
284 int string_resource_id, 284 int string_resource_id,
285 const base::string16* const launch_cmd, 285 const base::string16* const launch_cmd,
286 WorkItemList* install_list) { 286 WorkItemList* install_list) {
287 DCHECK(install_list); 287 DCHECK(install_list);
288 DCHECK(install_list->best_effort());
289 DCHECK(!install_list->rollback_enabled());
290
288 const HKEY root = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; 291 const HKEY root = system_install ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;
289 DWORD installer_result = (GetInstallReturnCode(status) == 0) ? 0 : 1; 292 DWORD installer_result = (GetInstallReturnCode(status) == 0) ? 0 : 1;
290 install_list->AddCreateRegKeyWorkItem(root, state_key, KEY_WOW64_32KEY); 293 install_list->AddCreateRegKeyWorkItem(root, state_key, KEY_WOW64_32KEY);
291 install_list->AddSetRegValueWorkItem(root, 294 install_list->AddSetRegValueWorkItem(root,
292 state_key, 295 state_key,
293 KEY_WOW64_32KEY, 296 KEY_WOW64_32KEY,
294 installer::kInstallerResult, 297 installer::kInstallerResult,
295 installer_result, 298 installer_result,
296 true); 299 true);
297 install_list->AddSetRegValueWorkItem(root, 300 install_list->AddSetRegValueWorkItem(root,
(...skipping 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
678 681
679 // Open the program and see if it references the expected file. 682 // Open the program and see if it references the expected file.
680 base::File file; 683 base::File file;
681 BY_HANDLE_FILE_INFORMATION info = {}; 684 BY_HANDLE_FILE_INFORMATION info = {};
682 685
683 return (OpenForInfo(path, &file, comparison_type_) && GetInfo(file, &info) && 686 return (OpenForInfo(path, &file, comparison_type_) && GetInfo(file, &info) &&
684 info.dwVolumeSerialNumber == file_info_.dwVolumeSerialNumber && 687 info.dwVolumeSerialNumber == file_info_.dwVolumeSerialNumber &&
685 info.nFileIndexHigh == file_info_.nFileIndexHigh && 688 info.nFileIndexHigh == file_info_.nFileIndexHigh &&
686 info.nFileIndexLow == file_info_.nFileIndexLow); 689 info.nFileIndexLow == file_info_.nFileIndexLow);
687 } 690 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698