Index: chrome/browser/first_run/upgrade_util_win.cc |
diff --git a/chrome/browser/first_run/upgrade_util_win.cc b/chrome/browser/first_run/upgrade_util_win.cc |
index 91b35e9e5b8be4be8b63ad240d5ed92b8cb89640..035ab2e5b80a0142b3d6dc506300414fed6665d0 100644 |
--- a/chrome/browser/first_run/upgrade_util_win.cc |
+++ b/chrome/browser/first_run/upgrade_util_win.cc |
@@ -108,22 +108,24 @@ bool IsUpdatePendingRestart() { |
} |
bool SwapNewChromeExeIfPresent() { |
- base::FilePath new_chrome_exe; |
- if (!GetNewerChromeFile(&new_chrome_exe)) |
- return false; |
- if (!base::PathExists(new_chrome_exe)) |
+ if (!IsUpdatePendingRestart()) |
return false; |
base::FilePath cur_chrome_exe; |
if (!PathService::Get(base::FILE_EXE, &cur_chrome_exe)) |
return false; |
+ bool user_install = InstallUtil::IsPerUserInstall(cur_chrome_exe); |
+ |
+ // Ask Google Update to elevate and rename if the current process is in a |
+ // per-machine install. Failing that, fall back to the direct approach. |
+ if (!user_install && InvokeGoogleUpdateForRename()) |
+ return true; |
// Open up the registry key containing current version and rename information. |
- bool user_install = InstallUtil::IsPerUserInstall(cur_chrome_exe); |
HKEY reg_root = user_install ? HKEY_CURRENT_USER : HKEY_LOCAL_MACHINE; |
BrowserDistribution *dist = BrowserDistribution::GetDistribution(); |
base::win::RegKey key; |
if (key.Open(reg_root, dist->GetVersionKey().c_str(), |
- KEY_QUERY_VALUE) == ERROR_SUCCESS) { |
+ KEY_QUERY_VALUE | KEY_WOW64_32KEY) == ERROR_SUCCESS) { |
// First try to rename exe by launching rename command ourselves. |
std::wstring rename_cmd; |
if (key.ReadValue(google_update::kRegRenameCmdField, |
@@ -141,8 +143,7 @@ bool SwapNewChromeExeIfPresent() { |
} |
} |
- // Rename didn't work so try to rename by calling Google Update |
- return InvokeGoogleUpdateForRename(); |
+ return false; |
} |
bool IsRunningOldChrome() { |