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

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: 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
Index: chrome/installer/gcapi/gcapi.cc
diff --git a/chrome/installer/gcapi/gcapi.cc b/chrome/installer/gcapi/gcapi.cc
index 73c5b73727648e76ceed22bb2b74c5a333b38ca2..c2424c7f8eab4d7ebf21ce6a6a27fd04d95a5ec3 100644
--- a/chrome/installer/gcapi/gcapi.cc
+++ b/chrome/installer/gcapi/gcapi.cc
@@ -31,6 +31,7 @@
#include "base/win/scoped_com_initializer.h"
#include "base/win/scoped_comptr.h"
#include "base/win/scoped_handle.h"
+#include "chrome/tools/launcher_support/chrome_launcher_support.h"
Vitaly Buka (NO REVIEWS) 2012/06/13 18:01:36 invalid order
robertshield 2012/06/13 18:01:53 move this include down to line 39
erikwright (departed) 2012/06/13 19:43:43 Done.
erikwright (departed) 2012/06/13 19:43:43 Done.
#include "chrome/installer/gcapi/gcapi_omaha_experiment.h"
#include "chrome/installer/gcapi/gcapi_reactivation.h"
#include "chrome/installer/util/google_update_constants.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();
robertshield 2012/06/13 18:01:53 prefer constructor syntax
erikwright (departed) 2012/06/13 19:43:43 Done.
+ if (chrome_exe_path.empty()) {
return false;
}

Powered by Google App Engine
This is Rietveld 408576698