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

Unified Diff: chrome/installer/gcapi/gcapi.cc

Issue 10546149: Factor out logic to find chrome.exe from Omaha client state. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Use chrome from current dir in development. Created 8 years, 6 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 | « chrome/chrome_installer.gypi ('k') | chrome/installer/launcher_support/chrome_launcher_support.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/gcapi/gcapi.cc
diff --git a/chrome/installer/gcapi/gcapi.cc b/chrome/installer/gcapi/gcapi.cc
index 73c5b73727648e76ceed22bb2b74c5a333b38ca2..960f41d25bd56ffa6d18973dd1928fb90a796fa3 100644
--- a/chrome/installer/gcapi/gcapi.cc
+++ b/chrome/installer/gcapi/gcapi.cc
@@ -33,6 +33,7 @@
#include "base/win/scoped_handle.h"
#include "chrome/installer/gcapi/gcapi_omaha_experiment.h"
#include "chrome/installer/gcapi/gcapi_reactivation.h"
+#include "chrome/installer/launcher_support/chrome_launcher_support.h"
#include "chrome/installer/util/google_update_constants.h"
#include "chrome/installer/util/util_constants.h"
#include "google_update/google_update_idl.h"
@@ -373,30 +374,8 @@ BOOL __stdcall LaunchGoogleChrome() {
// Now grab the uninstall string from the appropriate ClientState key
// and use that as the base for a path to chrome.exe.
- FilePath chrome_exe_path;
- RegKey client_state(install_key, kChromeRegClientStateKey, KEY_QUERY_VALUE);
- if (client_state.Valid()) {
- std::wstring uninstall_string;
- if (client_state.ReadValue(installer::kUninstallStringField,
- &uninstall_string) == ERROR_SUCCESS) {
- // The uninstall path contains the path to setup.exe which is two levels
- // down from chrome.exe. Move up two levels (plus one to drop the file
- // name) and look for chrome.exe from there.
- FilePath uninstall_path(uninstall_string);
- chrome_exe_path = uninstall_path.DirName()
- .DirName()
- .DirName()
- .Append(installer::kChromeExe);
- if (!file_util::PathExists(chrome_exe_path)) {
- // By way of mild future proofing, look up one to see if there's a
- // chrome.exe in the version directory
- chrome_exe_path =
- uninstall_path.DirName().DirName().Append(installer::kChromeExe);
- }
- }
- }
-
- if (!file_util::PathExists(chrome_exe_path)) {
+ FilePath chrome_exe_path(chrome_launcher_support::GetAnyChromePath());
+ if (chrome_exe_path.empty()) {
return false;
}
« no previous file with comments | « chrome/chrome_installer.gypi ('k') | chrome/installer/launcher_support/chrome_launcher_support.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698