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

Unified Diff: chrome/installer/setup/setup_main.cc

Issue 1869443003: Always delete old_chrome.exe last in the rename dance since it cannot be rolled back. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2661
Patch Set: Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/setup/setup_main.cc
diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc
index bab5bd51c0d232cecf76619f3be91cb9e196f255..34afeaee474098d4c43b4cb548bc32ceee8abf70 100644
--- a/chrome/installer/setup/setup_main.cc
+++ b/chrome/installer/setup/setup_main.cc
@@ -378,9 +378,6 @@ installer::InstallStatus RenameChromeExecutables(
temp_path.path().value(),
WorkItem::ALWAYS_MOVE);
install_list->AddDeleteTreeWorkItem(chrome_new_exe, temp_path.path());
- // old_chrome.exe is still in use in most cases, so ignore failures here.
- install_list->AddDeleteTreeWorkItem(chrome_old_exe, temp_path.path())->
- set_ignore_failure(true);
// Add work items to delete the "opv", "cpv", and "cmd" values from all
// products we're operating on (which including the multi-install binaries).
@@ -404,6 +401,12 @@ installer::InstallStatus RenameChromeExecutables(
KEY_WOW64_32KEY,
google_update::kRegRenameCmdField);
}
+ // old_chrome.exe is still in use in most cases, so ignore failures here.
+ // Make sure this is the last item in the list because it cannot be rolled
+ // back.
+ install_list->AddDeleteTreeWorkItem(chrome_old_exe, temp_path.path())->
+ set_ignore_failure(true);
+
installer::InstallStatus ret = installer::RENAME_SUCCESSFUL;
if (!install_list->Do()) {
LOG(ERROR) << "Renaming of executables failed. Rolling back any changes.";
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698