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

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

Issue 10818021: Revert 147650 - Implement installation of the Chrome App Host. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1215/src/
Patch Set: Created 8 years, 5 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/mini_installer/mini_installer.cc
===================================================================
--- chrome/installer/mini_installer/mini_installer.cc (revision 148045)
+++ chrome/installer/mini_installer/mini_installer.cc (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -159,7 +159,6 @@
const REGSAM key_access = KEY_QUERY_VALUE | KEY_SET_VALUE;
const HKEY root_key =
configuration.is_system_level() ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;
- // This is ignored if multi-install is true.
const wchar_t* app_guid =
configuration.has_chrome_frame() ?
google_update::kChromeFrameAppGuid :
@@ -223,48 +222,40 @@
// Gets the setup.exe path from Registry by looking the value of Uninstall
// string. |size| is measured in wchar_t units.
-bool GetSetupExePathForGuidFromRegistry(bool system_level,
- const wchar_t* app_guid,
- wchar_t* path,
- size_t size) {
- const HKEY root_key = system_level ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;
- RegKey key;
- return OpenClientStateKey(root_key, app_guid, KEY_QUERY_VALUE, &key) &&
- (key.ReadValue(kUninstallRegistryValueName, path, size) == ERROR_SUCCESS);
-}
-
-// Gets the setup.exe path from Registry by looking the value of Uninstall
-// string. |size| is measured in wchar_t units.
bool GetSetupExePathFromRegistry(const Configuration& configuration,
wchar_t* path,
size_t size) {
- bool system_level = configuration.is_system_level();
+ const HKEY root_key =
+ configuration.is_system_level() ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER;
+ RegKey key;
+ bool succeeded = false;
// If this is a multi install, first try looking in the binaries for the path.
- if (configuration.is_multi_install() && GetSetupExePathForGuidFromRegistry(
- system_level, google_update::kMultiInstallAppGuid, path, size)) {
- return true;
+ if (configuration.is_multi_install() &&
+ OpenClientStateKey(root_key, google_update::kMultiInstallAppGuid,
+ KEY_QUERY_VALUE, &key)) {
+ succeeded = (key.ReadValue(kUninstallRegistryValueName, path,
+ size) == ERROR_SUCCESS);
}
- // Failing that, look in Chrome Frame's client state key if --chrome-frame was
+ // Failing that, look in Chrome Frame's client state key --chrome-frame was
// specified.
- if (configuration.has_chrome_frame() && GetSetupExePathForGuidFromRegistry(
- system_level, google_update::kChromeFrameAppGuid, path, size)) {
- return true;
+ if (!succeeded && configuration.has_chrome_frame() &&
+ OpenClientStateKey(root_key, google_update::kChromeFrameAppGuid,
+ KEY_QUERY_VALUE, &key)) {
+ succeeded = (key.ReadValue(kUninstallRegistryValueName, path,
+ size) == ERROR_SUCCESS);
}
- // Make a last-ditch effort to look in the Chrome and App Host client state
- // keys.
- if (GetSetupExePathForGuidFromRegistry(
- system_level, configuration.chrome_app_guid(), path, size)) {
- return true;
+ // Make a last-ditch effort to look in Chrome's client state key.
+ if (!succeeded &&
+ OpenClientStateKey(root_key, configuration.chrome_app_guid(),
+ KEY_QUERY_VALUE, &key)) {
+ succeeded = (key.ReadValue(kUninstallRegistryValueName, path,
+ size) == ERROR_SUCCESS);
}
- if (configuration.has_app_host() && GetSetupExePathForGuidFromRegistry(
- system_level, google_update::kChromeAppHostAppGuid, path, size)) {
- return true;
- }
- return false;
+ return succeeded;
}
// Calls CreateProcess with good default parameters and waits for the process
« no previous file with comments | « chrome/installer/mini_installer/configuration.cc ('k') | chrome/installer/setup/chrome_frame_quick_enable.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698