summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhuanr@chromium.org <huanr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-28 04:34:48 +0000
committerhuanr@chromium.org <huanr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-28 04:34:48 +0000
commit3e50e07a989d21dea45745ee0a136a23637d4e68 (patch)
tree8df10e8669df87f811a7105e7108610e83b123b3
parent3ee0489049bb17df3ec74213dbcc8e74d927d7c0 (diff)
downloadchromium_src-3e50e07a989d21dea45745ee0a136a23637d4e68.zip
chromium_src-3e50e07a989d21dea45745ee0a136a23637d4e68.tar.gz
chromium_src-3e50e07a989d21dea45745ee0a136a23637d4e68.tar.bz2
Wait for renaming chrome.exe to finish during shutdown for
system level in use update. Also remove obsoleted code in this code path. BUG=55969 TEST=repro steps in BUG Review URL: http://codereview.chromium.org/3429029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60751 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/first_run/first_run_win.cc16
1 files changed, 2 insertions, 14 deletions
diff --git a/chrome/browser/first_run/first_run_win.cc b/chrome/browser/first_run/first_run_win.cc
index 38b76a3..9e078c0 100644
--- a/chrome/browser/first_run/first_run_win.cc
+++ b/chrome/browser/first_run/first_run_win.cc
@@ -84,6 +84,7 @@ bool InvokeGoogleUpdateForRename() {
google_update::kRegRenameCmdField,
id, &phandle))) {
HANDLE handle = HANDLE(phandle);
+ WaitForSingleObject(handle, INFINITE);
DWORD exit_code;
::GetExitCodeProcess(handle, &exit_code);
::CloseHandle(handle);
@@ -294,20 +295,7 @@ bool Upgrade::SwapNewChromeExeIfPresent() {
}
// Rename didn't work so try to rename by calling Google Update
- if (InvokeGoogleUpdateForRename())
- return true;
-
- // Rename still didn't work so just try to rename exe ourselves (for
- // backward compatibility, can be deleted once the new process works).
- std::wstring backup_exe;
- if (!GetBackupChromeFile(&backup_exe))
- return false;
- if (::ReplaceFileW(curr_chrome_exe.c_str(), new_chrome_exe.value().c_str(),
- backup_exe.c_str(), REPLACEFILE_IGNORE_MERGE_ERRORS,
- NULL, NULL)) {
- return true;
- }
- return false;
+ return InvokeGoogleUpdateForRename();
}
// static