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

Side by Side Diff: chrome/installer/setup/app_launcher_installer.cc

Issue 1982653002: Add best-effort/allow rollback flags on WorkItem. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: don't remove code from app_launcher_installer.cc 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
« no previous file with comments | « chrome/chrome_installer.gypi ('k') | chrome/installer/setup/install.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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #if defined(GOOGLE_CHROME_BUILD) 5 #if defined(GOOGLE_CHROME_BUILD)
6 6
7 #include "chrome/installer/setup/app_launcher_installer.h" 7 #include "chrome/installer/setup/app_launcher_installer.h"
8 8
9 #include "base/strings/string16.h" 9 #include "base/strings/string16.h"
10 #include "base/version.h" 10 #include "base/version.h"
(...skipping 27 matching lines...) Expand all
38 base::string16 GetAppLauncherDisplayName() { 38 base::string16 GetAppLauncherDisplayName() {
39 return GetLocalizedString(IDS_PRODUCT_APP_LAUNCHER_NAME_BASE); 39 return GetLocalizedString(IDS_PRODUCT_APP_LAUNCHER_NAME_BASE);
40 } 40 }
41 41
42 void AddLegacyAppCommandRemovalItem(const InstallerState& installer_state, 42 void AddLegacyAppCommandRemovalItem(const InstallerState& installer_state,
43 const AppRegistrationData& reg_data, 43 const AppRegistrationData& reg_data,
44 const wchar_t* name, 44 const wchar_t* name,
45 WorkItemList* list) { 45 WorkItemList* list) {
46 // Ignore failures since this is a clean-up operation and shouldn't block 46 // Ignore failures since this is a clean-up operation and shouldn't block
47 // install or update. 47 // install or update.
48 list->AddDeleteRegKeyWorkItem( 48 auto* delete_reg_key_work_item = list->AddDeleteRegKeyWorkItem(
49 installer_state.root_key(), 49 installer_state.root_key(), GetRegistrationDataCommandKey(reg_data, name),
50 GetRegistrationDataCommandKey(reg_data, name), 50 KEY_WOW64_32KEY);
51 KEY_WOW64_32KEY) 51 delete_reg_key_work_item->set_best_effort(true);
52 ->set_ignore_failure(true); 52 delete_reg_key_work_item->set_rollback_enabled(false);
53 } 53 }
54 54
55 } // namespace 55 } // namespace
56 56
57 void AddAppLauncherVersionKeyWorkItems(HKEY root, 57 void AddAppLauncherVersionKeyWorkItems(HKEY root,
58 const base::Version& new_version, 58 const base::Version& new_version,
59 bool add_language_identifier, 59 bool add_language_identifier,
60 WorkItemList* list) { 60 WorkItemList* list) {
61 DCHECK(!InstallUtil::IsChromeSxSProcess()); 61 DCHECK(!InstallUtil::IsChromeSxSProcess());
62 const UpdatingAppRegistrationData app_launcher_reg_data(kAppLauncherGuid); 62 const UpdatingAppRegistrationData app_launcher_reg_data(kAppLauncherGuid);
63 AddVersionKeyWorkItems(root, 63 AddVersionKeyWorkItems(root,
64 app_launcher_reg_data.GetVersionKey(), 64 app_launcher_reg_data.GetVersionKey(),
65 GetAppLauncherDisplayName(), 65 GetAppLauncherDisplayName(),
66 new_version, 66 new_version,
67 add_language_identifier, 67 add_language_identifier,
68 list); 68 list);
69 } 69 }
70 70
71 void RemoveAppLauncherVersionKey(HKEY reg_root) { 71 void RemoveAppLauncherVersionKey(HKEY reg_root) {
72 DCHECK(!InstallUtil::IsChromeSxSProcess()); 72 DCHECK(!InstallUtil::IsChromeSxSProcess());
73 const UpdatingAppRegistrationData app_launcher_reg_data(kAppLauncherGuid); 73 const UpdatingAppRegistrationData app_launcher_reg_data(kAppLauncherGuid);
74 InstallUtil::DeleteRegistryKey( 74 InstallUtil::DeleteRegistryKey(
75 reg_root, app_launcher_reg_data.GetVersionKey(), KEY_WOW64_32KEY); 75 reg_root, app_launcher_reg_data.GetVersionKey(), KEY_WOW64_32KEY);
76 } 76 }
77 77
78 void AddRemoveLegacyAppHostExeWorkItems(const base::FilePath& target_path, 78 void AddRemoveLegacyAppHostExeWorkItems(const base::FilePath& target_path,
79 const base::FilePath& temp_path, 79 const base::FilePath& temp_path,
80 WorkItemList* list) { 80 WorkItemList* list) {
81 DCHECK(!InstallUtil::IsChromeSxSProcess()); 81 DCHECK(!InstallUtil::IsChromeSxSProcess());
82 list->AddDeleteTreeWorkItem( 82 auto* delete_tree_work_item = list->AddDeleteTreeWorkItem(
83 target_path.Append(kLegacyChromeAppHostExe), 83 target_path.Append(kLegacyChromeAppHostExe), temp_path);
84 temp_path)->set_ignore_failure(true); 84 delete_tree_work_item->set_best_effort(true);
85 delete_tree_work_item->set_rollback_enabled(false);
85 } 86 }
86 87
87 void AddRemoveLegacyAppCommandsWorkItems(const InstallerState& installer_state, 88 void AddRemoveLegacyAppCommandsWorkItems(const InstallerState& installer_state,
88 WorkItemList* list) { 89 WorkItemList* list) {
89 DCHECK(!InstallUtil::IsChromeSxSProcess()); 90 DCHECK(!InstallUtil::IsChromeSxSProcess());
90 DCHECK(list); 91 DCHECK(list);
91 for (const auto* p : installer_state.products()) { 92 for (const auto* p : installer_state.products()) {
92 if (p->is_chrome()) { 93 if (p->is_chrome()) {
93 // Remove "install-application" command from App Launcher. 94 // Remove "install-application" command from App Launcher.
94 const UpdatingAppRegistrationData app_launcher_reg_data(kAppLauncherGuid); 95 const UpdatingAppRegistrationData app_launcher_reg_data(kAppLauncherGuid);
(...skipping 15 matching lines...) Expand all
110 // Remove "quick-enable-application-host" command from Binaries. 111 // Remove "quick-enable-application-host" command from Binaries.
111 AddLegacyAppCommandRemovalItem(installer_state, binaries_reg_data, 112 AddLegacyAppCommandRemovalItem(installer_state, binaries_reg_data,
112 kLegacyCmdQuickEnableApplicationHost, list); 113 kLegacyCmdQuickEnableApplicationHost, list);
113 } 114 }
114 } 115 }
115 } 116 }
116 117
117 } // namespace installer 118 } // namespace installer
118 119
119 #endif // GOOGLE_CHROME_BUILD 120 #endif // GOOGLE_CHROME_BUILD
OLDNEW
« no previous file with comments | « chrome/chrome_installer.gypi ('k') | chrome/installer/setup/install.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698