summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorhuangs <huangs@chromium.org>2015-01-28 16:00:27 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-29 00:02:38 +0000
commit45817557f9fda44543d513a500eb0d74dd415ee0 (patch)
tree549154a964e0a5691d827f30c9a22feab8c77ac7
parent2b6fb4107dc736f4e230b4900a30e6fbed92ba0e (diff)
downloadchromium_src-45817557f9fda44543d513a500eb0d74dd415ee0.zip
chromium_src-45817557f9fda44543d513a500eb0d74dd415ee0.tar.gz
chromium_src-45817557f9fda44543d513a500eb0d74dd415ee0.tar.bz2
[Installer] Cleaning up dead code for App Launcher / App Host installs.
The "shadow" App Launcher registry keys are still managed. The code that do this are concentrated to the new files app_launcher_installer.* to facilitate future updates. This CL also significantly reduces the size of setup.exe, presumably due to removal of dependencies. TEST=Windows only. Install and update still work as before. - Right after fresh install, ensure reg key at user level exists: Google\Update\Clients\{FDA71E6F-AC4C-4a00-8B70-9958A68906BF} BUG=297647 Review URL: https://codereview.chromium.org/811283002 Cr-Commit-Position: refs/heads/master@{#313626}
-rw-r--r--chrome/app/chromium_strings.grd12
-rw-r--r--chrome/app/google_chrome_strings.grd12
-rw-r--r--chrome/chrome_installer.gypi2
-rw-r--r--chrome/chrome_installer_util.gypi6
-rw-r--r--chrome/installer/mini_installer/appid.h1
-rw-r--r--chrome/installer/mini_installer/chrome_appid.cc2
-rw-r--r--chrome/installer/mini_installer/configuration.cc7
-rw-r--r--chrome/installer/mini_installer/configuration.h4
-rw-r--r--chrome/installer/mini_installer/mini_installer.cc7
-rw-r--r--chrome/installer/setup/app_launcher_installer.cc120
-rw-r--r--chrome/installer/setup/app_launcher_installer.h58
-rw-r--r--chrome/installer/setup/install.cc33
-rw-r--r--chrome/installer/setup/install_worker.cc243
-rw-r--r--chrome/installer/setup/install_worker.h10
-rw-r--r--chrome/installer/setup/setup_main.cc115
-rw-r--r--chrome/installer/setup/setup_util.cc3
-rw-r--r--chrome/installer/setup/uninstall.cc99
-rw-r--r--chrome/installer/util/BUILD.gn6
-rw-r--r--chrome/installer/util/browser_distribution.cc15
-rw-r--r--chrome/installer/util/browser_distribution.h4
-rw-r--r--chrome/installer/util/channel_info.cc81
-rw-r--r--chrome/installer/util/channel_info.h19
-rw-r--r--chrome/installer/util/channel_info_unittest.cc11
-rw-r--r--chrome/installer/util/chrome_app_host_distribution.cc130
-rw-r--r--chrome/installer/util/chrome_app_host_distribution.h65
-rw-r--r--chrome/installer/util/chrome_app_host_operations.cc134
-rw-r--r--chrome/installer/util/chrome_app_host_operations.h63
-rw-r--r--chrome/installer/util/chrome_browser_operations.cc6
-rw-r--r--chrome/installer/util/eula_util.cc95
-rw-r--r--chrome/installer/util/eula_util.h25
-rw-r--r--chrome/installer/util/google_chrome_distribution.cc4
-rw-r--r--chrome/installer/util/google_chrome_distribution.h2
-rw-r--r--chrome/installer/util/google_chrome_distribution_dummy.cc4
-rw-r--r--chrome/installer/util/google_chrome_sxs_distribution.cc4
-rw-r--r--chrome/installer/util/google_chrome_sxs_distribution.h1
-rw-r--r--chrome/installer/util/installation_state.cc10
-rw-r--r--chrome/installer/util/installation_state.h1
-rw-r--r--chrome/installer/util/installation_validator.cc192
-rw-r--r--chrome/installer/util/installation_validator.h38
-rw-r--r--chrome/installer/util/installation_validator_unittest.cc61
-rw-r--r--chrome/installer/util/installer_state.cc159
-rw-r--r--chrome/installer/util/installer_state.h7
-rw-r--r--chrome/installer/util/master_preferences.cc18
-rw-r--r--chrome/installer/util/master_preferences.h5
-rw-r--r--chrome/installer/util/master_preferences_constants.cc3
-rw-r--r--chrome/installer/util/master_preferences_constants.h4
-rwxr-xr-xchrome/installer/util/prebuild/create_string_rc.py6
-rw-r--r--chrome/installer/util/product.cc4
-rw-r--r--chrome/installer/util/product.h4
-rw-r--r--chrome/installer/util/util_constants.cc20
-rw-r--r--chrome/installer/util/util_constants.h7
51 files changed, 338 insertions, 1604 deletions
diff --git a/chrome/app/chromium_strings.grd b/chrome/app/chromium_strings.grd
index 29edab1..b3d3d5d 100644
--- a/chrome/app/chromium_strings.grd
+++ b/chrome/app/chromium_strings.grd
@@ -227,9 +227,6 @@ be available for now. -->
<message name="IDS_PRODUCT_DESCRIPTION" desc="Browser description">
Chromium is a web browser that runs webpages and applications with lightning speed. It's fast, stable, and easy to use. Browse the web more safely with malware and phishing protection built into Chromium.
</message>
- <message name="IDS_APP_LAUNCHER_PRODUCT_DESCRIPTION" desc="App Launcher description">
- Chromium App Launcher is a standalone platform for Chromium apps.
- </message>
</if>
<if expr="chromeos">
<message name="IDS_PRODUCT_OS_NAME" desc="The Chrome OS application name">
@@ -361,9 +358,6 @@ be available for now. -->
<message name="IDS_UNINSTALL_CHROME" desc="The text of the shortcut in the Start Menu for uninstalling chrome.">
Uninstall Chromium
</message>
- <message name="IDS_UNINSTALL_APP_LAUNCHER" desc="The text of the shortcut in the Start Menu for uninstalling App Launcher.">
- Uninstall Chromium App Launcher
- </message>
</if>
<message name="IDS_FR_CUSTOMIZE_DEFAULT_BROWSER" desc="Default browser checkbox label">
Make Chromium the default browser
@@ -497,9 +491,6 @@ Chromium is unable to recover your settings.
<message name="IDS_INSTALL_HIGHER_VERSION" desc="Error displayed when higher version already exists.">
This computer already has a more recent version of Chromium. If the software is not working, please uninstall Chromium and try again.
</message>
- <message name="IDS_INSTALL_HIGHER_VERSION_APP_LAUNCHER" desc="Error displayed when higher version of the Chromium App Launcher already exists.">
- This computer already has a more recent version of the Chromium components. Please use a more recent installer.
- </message>
<message name="IDS_INSTALL_FAILED" desc="Error displayed if installation fails due to some unknown error.">
Installation failed due to unspecified error. If Chromium is currently running, please close it and try again.
</message>
@@ -547,9 +538,6 @@ Chromium is unable to recover your settings.
<message name="IDS_SHORTCUT_TOOLTIP" desc="Text for the hover-on tooltip for the Chromium shortcuts.">
Access the Internet
</message>
- <message name="IDS_APP_LAUNCHER_SHORTCUT_TOOLTIP" desc="Text for the hover-on tooltip for the App Launcher shortcut.">
- Launch Chromium apps
- </message>
<message name="IDS_UNINSTALL_DELETE_PROFILE" desc="Text to show user to ask whether to delete all the profile data also during uninstallation.">
Also delete your browsing data?
</message>
diff --git a/chrome/app/google_chrome_strings.grd b/chrome/app/google_chrome_strings.grd
index 9f8bfa0..957f355 100644
--- a/chrome/app/google_chrome_strings.grd
+++ b/chrome/app/google_chrome_strings.grd
@@ -150,9 +150,6 @@ Chrome supports. -->
<message name="IDS_PRODUCT_DESCRIPTION" desc="Browser description">
Google Chrome is a web browser that runs webpages and applications with lightning speed. It's fast, stable, and easy to use. Browse the web more safely with malware and phishing protection built into Google Chrome.
</message>
- <message name="IDS_APP_LAUNCHER_PRODUCT_DESCRIPTION" desc="App Launcher description">
- Google Chrome App Launcher is a standalone platform for Chrome apps.
- </message>
</if>
<if expr="chromeos">
<message name="IDS_PRODUCT_OS_NAME" desc="The Chrome OS application name">
@@ -284,9 +281,6 @@ Chrome supports. -->
<message name="IDS_UNINSTALL_CHROME" desc="The text of the shortcut in the Start Menu for uninstalling chrome.">
Uninstall Google Chrome
</message>
- <message name="IDS_UNINSTALL_APP_LAUNCHER" desc="The text of the shortcut in the Start Menu for uninstalling App Launcher.">
- Uninstall Google Chrome App Launcher
- </message>
</if>
<message name="IDS_FR_CUSTOMIZE_DEFAULT_BROWSER" desc="Default browser checkbox label">
Make Google Chrome the default browser
@@ -420,9 +414,6 @@ Google Chrome is unable to recover your settings.
<message name="IDS_INSTALL_HIGHER_VERSION" desc="Error displayed when higher version already exists.">
This computer already has a more recent version of Google Chrome. If the software is not working, please uninstall Google Chrome and try again.
</message>
- <message name="IDS_INSTALL_HIGHER_VERSION_APP_LAUNCHER" desc="Error displayed when higher version of the Chrome App Launcher already exists.">
- This computer already has a more recent version of the Google Chrome components. Please use a more recent installer.
- </message>
<message name="IDS_INSTALL_FAILED" desc="Error displayed if installation fails due to some unknown error.">
Installation failed due to unspecified error. If Google Chrome is currently running, please close it and try again.
</message>
@@ -471,9 +462,6 @@ Google Chrome is unable to recover your settings.
<message name="IDS_SHORTCUT_TOOLTIP" desc="Text for the hover-on tooltip for the Google Chrome shortcuts.">
Access the Internet
</message>
- <message name="IDS_APP_LAUNCHER_SHORTCUT_TOOLTIP" desc="Text for the hover-on tooltip for the App Launcher shortcut.">
- Launch Chrome apps
- </message>
<message name="IDS_UNINSTALL_DELETE_PROFILE" desc="Text to show user to ask whether to delete all the profile data also during uninstallation.">
Also delete your browsing data?
</message>
diff --git a/chrome/chrome_installer.gypi b/chrome/chrome_installer.gypi
index 47e2a71..37e0927 100644
--- a/chrome/chrome_installer.gypi
+++ b/chrome/chrome_installer.gypi
@@ -237,6 +237,8 @@
'sources': [
'<(SHARED_INTERMEDIATE_DIR)/installer_util_strings/installer_util_strings.rc',
'installer/mini_installer/chrome.release',
+ 'installer/setup/app_launcher_installer.cc',
+ 'installer/setup/app_launcher_installer.h',
'installer/setup/archive_patch_helper.cc',
'installer/setup/archive_patch_helper.h',
'installer/setup/install.cc',
diff --git a/chrome/chrome_installer_util.gypi b/chrome/chrome_installer_util.gypi
index 2c45db6..182e256 100644
--- a/chrome/chrome_installer_util.gypi
+++ b/chrome/chrome_installer_util.gypi
@@ -26,8 +26,6 @@
'installer/util/callback_work_item.h',
'installer/util/channel_info.cc',
'installer/util/channel_info.h',
- 'installer/util/chrome_app_host_distribution.cc',
- 'installer/util/chrome_app_host_distribution.h',
'installer/util/chrome_frame_distribution.cc',
'installer/util/chrome_frame_distribution.h',
'installer/util/chromium_binaries_distribution.cc',
@@ -130,8 +128,6 @@
'<(DEPTH)/third_party/lzma_sdk/lzma_sdk.gyp:lzma_sdk',
],
'sources': [
- 'installer/util/chrome_app_host_operations.cc',
- 'installer/util/chrome_app_host_operations.h',
'installer/util/chrome_binaries_operations.cc',
'installer/util/chrome_binaries_operations.h',
'installer/util/chrome_browser_operations.cc',
@@ -144,8 +140,6 @@
'installer/util/compat_checks.h',
'installer/util/delete_after_reboot_helper.cc',
'installer/util/delete_after_reboot_helper.h',
- 'installer/util/eula_util.cc',
- 'installer/util/eula_util.h',
'installer/util/google_chrome_distribution.cc',
'installer/util/google_chrome_distribution.h',
'installer/util/html_dialog.h',
diff --git a/chrome/installer/mini_installer/appid.h b/chrome/installer/mini_installer/appid.h
index 1ea93a4..327e8b5 100644
--- a/chrome/installer/mini_installer/appid.h
+++ b/chrome/installer/mini_installer/appid.h
@@ -9,7 +9,6 @@
namespace google_update {
extern const wchar_t kAppGuid[];
extern const wchar_t kSxSAppGuid[];
-extern const wchar_t kChromeAppHostAppGuid[];
extern const wchar_t kChromeFrameAppGuid[];
extern const wchar_t kMultiInstallAppGuid[];
}
diff --git a/chrome/installer/mini_installer/chrome_appid.cc b/chrome/installer/mini_installer/chrome_appid.cc
index 841da52..910ec1d 100644
--- a/chrome/installer/mini_installer/chrome_appid.cc
+++ b/chrome/installer/mini_installer/chrome_appid.cc
@@ -6,8 +6,6 @@
namespace google_update {
const wchar_t kAppGuid[] = L"{8A69D345-D564-463c-AFF1-A69D9E530F96}";
-const wchar_t kChromeAppHostAppGuid[] =
- L"{FDA71E6F-AC4C-4a00-8B70-9958A68906BF}";
const wchar_t kChromeFrameAppGuid[] = L"{8BA986DA-5100-405E-AA35-86F34A02ACBF}";
const wchar_t kMultiInstallAppGuid[] =
L"{4DC8B4CA-1BDA-483e-B5FA-D3C12E15B62D}";
diff --git a/chrome/installer/mini_installer/configuration.cc b/chrome/installer/mini_installer/configuration.cc
index 023ed6c..33551cb 100644
--- a/chrome/installer/mini_installer/configuration.cc
+++ b/chrome/installer/mini_installer/configuration.cc
@@ -34,7 +34,6 @@ void Configuration::Clear() {
argument_count_ = 0;
has_chrome_ = false;
has_chrome_frame_ = false;
- has_app_host_ = false;
is_multi_install_ = false;
is_system_level_ = false;
query_component_build_ = false;
@@ -61,9 +60,6 @@ bool Configuration::InitializeFromCommandLine(const wchar_t* command_line) {
has_chrome_ = true;
else if (0 == ::lstrcmpi(args_[i], L"--chrome-frame"))
has_chrome_frame_ = true;
- else if ((0 == ::lstrcmpi(args_[i], L"--app-host")) ||
- (0 == ::lstrcmpi(args_[i], L"--app-launcher")))
- has_app_host_ = true;
else if (0 == ::lstrcmpi(args_[i], L"--multi-install"))
is_multi_install_ = true;
else if (0 == ::lstrcmpi(args_[i], L"--system-level"))
@@ -76,8 +72,9 @@ bool Configuration::InitializeFromCommandLine(const wchar_t* command_line) {
// Single-install defaults to Chrome.
if (!is_multi_install_)
- has_chrome_ = !(has_chrome_frame_ || has_app_host_);
+ has_chrome_ = !has_chrome_frame_;
}
+
return args_ != NULL;
}
diff --git a/chrome/installer/mini_installer/configuration.h b/chrome/installer/mini_installer/configuration.h
index 9498354..7c50e146 100644
--- a/chrome/installer/mini_installer/configuration.h
+++ b/chrome/installer/mini_installer/configuration.h
@@ -46,9 +46,6 @@ class Configuration {
// Returns true if --chrome-frame is on the command line.
bool has_chrome_frame() const { return has_chrome_frame_; }
- // Returns true if --app-host is on the command line.
- bool has_app_host() const { return has_app_host_; }
-
// Returns true if --multi-install is on the command line.
bool is_multi_install() const { return is_multi_install_; }
@@ -66,7 +63,6 @@ class Configuration {
Operation operation_;
bool has_chrome_;
bool has_chrome_frame_;
- bool has_app_host_;
bool is_multi_install_;
bool is_system_level_;
bool query_component_build_;
diff --git a/chrome/installer/mini_installer/mini_installer.cc b/chrome/installer/mini_installer/mini_installer.cc
index b0126a5..600ea46 100644
--- a/chrome/installer/mini_installer/mini_installer.cc
+++ b/chrome/installer/mini_installer/mini_installer.cc
@@ -257,16 +257,11 @@ bool GetSetupExePathFromRegistry(const Configuration& configuration,
return true;
}
- // Make a last-ditch effort to look in the Chrome and App Host client state
- // keys.
+ // Make a last-ditch effort to look in the Chrome client state key.
if (GetSetupExePathForGuidFromRegistry(
system_level, configuration.chrome_app_guid(), path, size)) {
return true;
}
- if (configuration.has_app_host() && GetSetupExePathForGuidFromRegistry(
- system_level, google_update::kChromeAppHostAppGuid, path, size)) {
- return true;
- }
return false;
}
diff --git a/chrome/installer/setup/app_launcher_installer.cc b/chrome/installer/setup/app_launcher_installer.cc
new file mode 100644
index 0000000..3c30aaf
--- /dev/null
+++ b/chrome/installer/setup/app_launcher_installer.cc
@@ -0,0 +1,120 @@
+// Copyright 2015 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.
+
+#if defined(GOOGLE_CHROME_BUILD)
+
+#include "chrome/installer/setup/app_launcher_installer.h"
+
+#include "base/strings/string16.h"
+#include "base/version.h"
+#include "chrome/installer/setup/install_worker.h"
+#include "chrome/installer/setup/setup_util.h"
+#include "chrome/installer/util/google_update_constants.h"
+#include "chrome/installer/util/install_util.h"
+#include "chrome/installer/util/installer_state.h"
+#include "chrome/installer/util/l10n_string_util.h"
+#include "chrome/installer/util/product.h"
+#include "chrome/installer/util/updating_app_registration_data.h"
+#include "chrome/installer/util/work_item.h"
+#include "chrome/installer/util/work_item_list.h"
+
+#include "installer_util_strings.h" // NOLINT
+
+namespace installer {
+
+namespace {
+
+// The legacy command ids for installing an application or extension. These are
+// only here so they can be removed from the registry.
+const wchar_t kLegacyCmdInstallApp[] = L"install-application";
+const wchar_t kLegacyCmdInstallExtension[] = L"install-extension";
+const wchar_t kLegacyCmdQueryEULAAcceptance[] = L"query-eula-acceptance";
+const wchar_t kLegacyCmdQuickEnableApplicationHost[] =
+ L"quick-enable-application-host";
+
+// The legacy app_host.exe executable, which should be eradicated.
+const wchar_t kLegacyChromeAppHostExe[] = L"app_host.exe";
+
+base::string16 GetAppLauncherDisplayName() {
+ return GetLocalizedString(IDS_PRODUCT_APP_LAUNCHER_NAME_BASE);
+}
+
+void AddLegacyAppCommandRemovalItem(const InstallerState& installer_state,
+ const AppRegistrationData& reg_data,
+ const wchar_t* name,
+ WorkItemList* list) {
+ // Ignore failures since this is a clean-up operation and shouldn't block
+ // install or update.
+ list->AddDeleteRegKeyWorkItem(
+ installer_state.root_key(),
+ GetRegistrationDataCommandKey(reg_data, name),
+ KEY_WOW64_32KEY)
+ ->set_ignore_failure(true);
+}
+
+} // namespace
+
+void AddAppLauncherVersionKeyWorkItems(HKEY root,
+ const base::Version& new_version,
+ bool add_language_identifier,
+ WorkItemList* list) {
+ DCHECK(!InstallUtil::IsChromeSxSProcess());
+ const UpdatingAppRegistrationData app_launcher_reg_data(kAppLauncherGuid);
+ AddVersionKeyWorkItems(root,
+ app_launcher_reg_data.GetVersionKey(),
+ GetAppLauncherDisplayName(),
+ new_version,
+ add_language_identifier,
+ list);
+}
+
+void RemoveAppLauncherVersionKey(HKEY reg_root) {
+ DCHECK(!InstallUtil::IsChromeSxSProcess());
+ const UpdatingAppRegistrationData app_launcher_reg_data(kAppLauncherGuid);
+ InstallUtil::DeleteRegistryKey(
+ reg_root, app_launcher_reg_data.GetVersionKey(), KEY_WOW64_32KEY);
+}
+
+void AddRemoveLegacyAppHostExeWorkItems(const base::FilePath& target_path,
+ const base::FilePath& temp_path,
+ WorkItemList* list) {
+ DCHECK(!InstallUtil::IsChromeSxSProcess());
+ list->AddDeleteTreeWorkItem(
+ target_path.Append(kLegacyChromeAppHostExe),
+ temp_path)->set_ignore_failure(true);
+}
+
+void AddRemoveLegacyAppCommandsWorkItems(const InstallerState& installer_state,
+ WorkItemList* list) {
+ DCHECK(!InstallUtil::IsChromeSxSProcess());
+ DCHECK(list);
+ for (const auto* p : installer_state.products()) {
+ if (p->is_chrome()) {
+ // Remove "install-application" command from App Launcher.
+ const UpdatingAppRegistrationData app_launcher_reg_data(kAppLauncherGuid);
+ AddLegacyAppCommandRemovalItem(installer_state, app_launcher_reg_data,
+ kLegacyCmdInstallApp, list);
+
+ // Remove "install-extension" command from Chrome.
+ const AppRegistrationData& chrome_reg_data =
+ p->distribution()->GetAppRegistrationData();
+ AddLegacyAppCommandRemovalItem(installer_state, chrome_reg_data,
+ kLegacyCmdInstallExtension, list);
+ }
+ if (p->is_chrome_binaries()) {
+ const AppRegistrationData& binaries_reg_data =
+ p->distribution()->GetAppRegistrationData();
+ // Remove "query-eula-acceptance" command from Binaries.
+ AddLegacyAppCommandRemovalItem(installer_state, binaries_reg_data,
+ kLegacyCmdQueryEULAAcceptance, list);
+ // Remove "quick-enable-application-host" command from Binaries.
+ AddLegacyAppCommandRemovalItem(installer_state, binaries_reg_data,
+ kLegacyCmdQuickEnableApplicationHost, list);
+ }
+ }
+}
+
+} // namespace installer
+
+#endif // GOOGLE_CHROME_BUILD
diff --git a/chrome/installer/setup/app_launcher_installer.h b/chrome/installer/setup/app_launcher_installer.h
new file mode 100644
index 0000000..132005e
--- /dev/null
+++ b/chrome/installer/setup/app_launcher_installer.h
@@ -0,0 +1,58 @@
+// Copyright 2015 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.
+
+// The App Launcher is an adjunct product of Google Chrome, but it has a
+// distinct registry entry. The functions in this file tap into various points
+// in installer flow to update the App Launcher's registry, including the
+// removal of deprecated app commands. This concentrates ugly code to to one
+// place to facilitate future refactoring.
+
+#ifndef CHROME_INSTALLER_SETUP_APP_LAUNCHER_INSTALLER_H_
+#define CHROME_INSTALLER_SETUP_APP_LAUNCHER_INSTALLER_H_
+
+#if defined(GOOGLE_CHROME_BUILD)
+
+#include <windows.h>
+
+namespace base {
+class FilePath;
+class Version;
+} // namespace base
+
+class WorkItemList;
+
+namespace installer {
+
+class InstallerState;
+
+// Create Version key for a App Launcher (if not already present) and sets the
+// new product version as the last step. We need this for App Launcher in
+// order for shadow registry key to work.
+void AddAppLauncherVersionKeyWorkItems(
+ HKEY root,
+ const base::Version& new_version,
+ bool add_language_identifier,
+ WorkItemList* list);
+
+// Remove App Launcher's registry key, so it is in sync with Google Chrome's.
+// Note: The key is added by App Launcher in SetDidRunForNDayActiveStats().
+void RemoveAppLauncherVersionKey(HKEY reg_root);
+
+// Adds work item to unconditionally remove legacy executables.
+void AddRemoveLegacyAppHostExeWorkItems(const base::FilePath& target_path,
+ const base::FilePath& temp_path,
+ WorkItemList* list);
+
+// Adds work item to unconditionally remove legacy app commands like
+// "install-application", "install-extension", and
+// "quick-enable-application-host".
+void AddRemoveLegacyAppCommandsWorkItems(
+ const InstallerState& installer_state,
+ WorkItemList* work_item_list);
+
+} // namespace installer
+
+#endif // defined(GOOGLE_CHROME_BUILD)
+
+#endif // CHROME_INSTALLER_SETUP_APP_LAUNCHER_INSTALLER_H_
diff --git a/chrome/installer/setup/install.cc b/chrome/installer/setup/install.cc
index f4c091b..d94824d 100644
--- a/chrome/installer/setup/install.cc
+++ b/chrome/installer/setup/install.cc
@@ -258,23 +258,6 @@ void CleanupLegacyShortcuts(const installer::InstallerState& installer_state,
base::DeleteFile(uninstall_shortcut_path, false);
}
-// Returns the appropriate shortcut operations for App Launcher,
-// based on state of installation and master_preferences.
-installer::InstallShortcutOperation GetAppLauncherShortcutOperation(
- const installer::InstallationState& original_state,
- const installer::InstallerState& installer_state) {
- const installer::ProductState* original_app_host_state =
- original_state.GetProductState(installer_state.system_install(),
- BrowserDistribution::CHROME_APP_HOST);
- bool app_launcher_exists = original_app_host_state &&
- original_app_host_state->uninstall_command()
- .HasSwitch(installer::switches::kChromeAppLauncher);
- if (!app_launcher_exists)
- return installer::INSTALL_SHORTCUT_CREATE_ALL;
-
- return installer::INSTALL_SHORTCUT_REPLACE_EXISTING;
-}
-
} // end namespace
namespace installer {
@@ -529,22 +512,6 @@ InstallStatus InstallOrUpdateProduct(
installer_state.UpdateStage(installer::CREATING_SHORTCUTS);
- const installer::Product* app_launcher_product =
- installer_state.FindProduct(BrowserDistribution::CHROME_APP_HOST);
- // Creates shortcuts for App Launcher.
- if (app_launcher_product) {
- // TODO(huangs): Remove this check once we have system-level App Host.
- DCHECK(!installer_state.system_install());
- const base::FilePath app_host_exe(
- installer_state.target_path().Append(kChromeAppHostExe));
- InstallShortcutOperation app_launcher_shortcut_operation =
- GetAppLauncherShortcutOperation(original_state, installer_state);
-
- // Always install per-user shortcuts for App Launcher.
- CreateOrUpdateShortcuts(app_host_exe, *app_launcher_product, prefs,
- CURRENT_USER, app_launcher_shortcut_operation);
- }
-
const installer::Product* chrome_product =
installer_state.FindProduct(BrowserDistribution::CHROME_BROWSER);
// Creates shortcuts for Chrome.
diff --git a/chrome/installer/setup/install_worker.cc b/chrome/installer/setup/install_worker.cc
index 64af4da..d730914 100644
--- a/chrome/installer/setup/install_worker.cc
+++ b/chrome/installer/setup/install_worker.cc
@@ -28,6 +28,7 @@
#include "base/win/windows_version.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/installer/setup/app_launcher_installer.h"
#include "chrome/installer/setup/install.h"
#include "chrome/installer/setup/setup_constants.h"
#include "chrome/installer/setup/setup_util.h"
@@ -46,7 +47,6 @@
#include "chrome/installer/util/product.h"
#include "chrome/installer/util/set_reg_value_work_item.h"
#include "chrome/installer/util/shell_util.h"
-#include "chrome/installer/util/updating_app_registration_data.h"
#include "chrome/installer/util/util_constants.h"
#include "chrome/installer/util/work_item_list.h"
@@ -73,11 +73,6 @@ const wchar_t kIELowRightsPolicyOldGuid[] =
const wchar_t kElevationPolicyKeyPath[] =
L"SOFTWARE\\Microsoft\\Internet Explorer\\Low Rights\\ElevationPolicy\\";
-// The legacy command ids for installing an application or extension. These are
-// only here so they can be removed from the registry.
-const wchar_t kLegacyCmdInstallApp[] = L"install-application";
-const wchar_t kLegacyCmdInstallExtension[] = L"install-extension";
-
void GetOldIELowRightsElevationPolicyKeyPath(base::string16* key_path) {
key_path->assign(kElevationPolicyKeyPath,
arraysize(kElevationPolicyKeyPath) - 1);
@@ -155,34 +150,26 @@ void AddInstallerCopyTasks(const InstallerState& installer_state,
WorkItem::ALWAYS);
}
- // If only the App Host (not even the Chrome Binaries) is being installed,
- // this must be a user-level App Host piggybacking on system-level Chrome
- // Binaries. Only setup.exe is required, and only for uninstall.
- if (installer_state.products().size() != 1 ||
- !installer_state.FindProduct(BrowserDistribution::CHROME_APP_HOST)) {
- base::FilePath archive_dst(installer_dir.Append(archive_path.BaseName()));
- if (archive_path != archive_dst) {
- // In the past, we copied rather than moved for system level installs so
- // that the permissions of %ProgramFiles% would be picked up. Now that
- // |temp_path| is in %ProgramFiles% for system level installs (and in
- // %LOCALAPPDATA% otherwise), there is no need to do this for the archive.
- // Setup.exe, on the other hand, is created elsewhere so it must always be
- // copied.
- if (temp_path.IsParent(archive_path)) {
- install_list->AddMoveTreeWorkItem(archive_path.value(),
- archive_dst.value(),
- temp_path.value(),
- WorkItem::ALWAYS_MOVE);
- } else {
- // This may occur when setup is run out of an existing installation
- // directory. For example, when quick-enabling user-level App Launcher
- // from system-level Binaries. We can't (and don't want to) remove the
- // system-level archive.
- install_list->AddCopyTreeWorkItem(archive_path.value(),
- archive_dst.value(),
- temp_path.value(),
- WorkItem::ALWAYS);
- }
+ base::FilePath archive_dst(installer_dir.Append(archive_path.BaseName()));
+ if (archive_path != archive_dst) {
+ // In the past, we copied rather than moved for system level installs so
+ // that the permissions of %ProgramFiles% would be picked up. Now that
+ // |temp_path| is in %ProgramFiles% for system level installs (and in
+ // %LOCALAPPDATA% otherwise), there is no need to do this for the archive.
+ // Setup.exe, on the other hand, is created elsewhere so it must always be
+ // copied.
+ if (temp_path.IsParent(archive_path)) {
+ install_list->AddMoveTreeWorkItem(archive_path.value(),
+ archive_dst.value(),
+ temp_path.value(),
+ WorkItem::ALWAYS_MOVE);
+ } else {
+ // This may occur when setup is run out of an existing installation
+ // directory. We cannot remove the system-level archive.
+ install_list->AddCopyTreeWorkItem(archive_path.value(),
+ archive_dst.value(),
+ temp_path.value(),
+ WorkItem::ALWAYS);
}
}
}
@@ -232,18 +219,6 @@ void AddCommandWithParameterWorkItems(const InstallerState& installer_state,
}
}
-void AddLegacyAppCommandRemovalItem(const InstallerState& installer_state,
- const AppRegistrationData& reg_data,
- const wchar_t* name,
- WorkItemList* work_item_list) {
- // These failures are ignored because this is a clean-up operation that
- // shouldn't block an install or update on failing.
- work_item_list->AddDeleteRegKeyWorkItem(
- installer_state.root_key(),
- GetRegistrationDataCommandKey(reg_data, name),
- KEY_WOW64_32KEY)->set_ignore_failure(true);
-}
-
// A callback invoked by |work_item| that adds firewall rules for Chrome. Rules
// are left in-place on rollback unless |remove_on_rollback| is true. This is
// the case for new installs only. Updates and overinstalls leave the rule
@@ -292,95 +267,12 @@ void AddFirewallRulesWorkItems(const InstallerState& installer_state,
is_new_install));
}
-// Returns the basic CommandLine to setup.exe for a quick-enable operation on
-// the binaries. This will unconditionally include --multi-install as well as
-// --verbose-logging if the current installation was launched with
-// --verbose-logging. |setup_path| and |new_version| are optional only when
-// the operation is an uninstall.
-base::CommandLine GetGenericQuickEnableCommand(
- const InstallerState& installer_state,
- const InstallationState& machine_state,
- const base::FilePath& setup_path,
- const Version& new_version) {
- // Only valid for multi-install operations.
- DCHECK(installer_state.is_multi_install());
- // Only valid when Chrome Binaries aren't being uninstalled.
- DCHECK(installer_state.operation() != InstallerState::UNINSTALL ||
- !installer_state.FindProduct(BrowserDistribution::CHROME_BINARIES));
- // setup_path and new_version are required when not uninstalling.
- DCHECK(installer_state.operation() == InstallerState::UNINSTALL ||
- (!setup_path.empty() && new_version.IsValid()));
-
- // The path to setup.exe contains the version of the Chrome Binaries, so it
- // takes a little work to get it right.
- base::FilePath binaries_setup_path;
- if (installer_state.operation() == InstallerState::UNINSTALL) {
- // One or more products are being uninstalled, but not Chrome Binaries.
- // Use the path to the currently installed Chrome Binaries' setup.exe.
- const ProductState* product_state = machine_state.GetProductState(
- installer_state.system_install(),
- BrowserDistribution::CHROME_BINARIES);
- DCHECK(product_state);
- binaries_setup_path = product_state->uninstall_command().GetProgram();
- } else {
- // Chrome Binaries are being installed, updated, or otherwise operated on.
- // Use the path to the given |setup_path| in the normal location of
- // multi-install Chrome Binaries of the given |version|.
- binaries_setup_path = installer_state.GetInstallerDirectory(new_version)
- .Append(setup_path.BaseName());
- }
- DCHECK(!binaries_setup_path.empty());
-
- base::CommandLine cmd_line(binaries_setup_path);
- cmd_line.AppendSwitch(switches::kMultiInstall);
- if (installer_state.verbose_logging())
- cmd_line.AppendSwitch(switches::kVerboseLogging);
- return cmd_line;
-}
-
-// Adds work items to add the "quick-enable-application-host" command to the
-// multi-installer binaries' version key on the basis of the current operation
-// (represented in |installer_state|) and the pre-existing machine configuration
-// (represented in |machine_state|).
-void AddQuickEnableApplicationLauncherWorkItems(
- const InstallerState& installer_state,
- const InstallationState& machine_state,
- const base::FilePath& setup_path,
- const Version& new_version,
- WorkItemList* work_item_list) {
- DCHECK(work_item_list);
-
- bool will_have_chrome_binaries =
- WillProductBePresentAfterSetup(installer_state, machine_state,
- BrowserDistribution::CHROME_BINARIES);
-
- // For system-level binaries there is no way to keep the command state in sync
- // with the installation/uninstallation of the Application Launcher (which is
- // always at user-level). So we do not try to remove the command, i.e., it
- // will always be installed if the Chrome Binaries are installed.
- if (will_have_chrome_binaries) {
- base::string16 cmd_key(
- GetRegCommandKey(BrowserDistribution::GetSpecificDistribution(
- BrowserDistribution::CHROME_BINARIES),
- kCmdQuickEnableApplicationHost));
- base::CommandLine cmd_line(GetGenericQuickEnableCommand(
- installer_state, machine_state, setup_path, new_version));
- // kMultiInstall and kVerboseLogging were processed above.
- cmd_line.AppendSwitch(switches::kChromeAppLauncher);
- cmd_line.AppendSwitch(switches::kEnsureGoogleUpdatePresent);
- AppCommand cmd(cmd_line.GetCommandLineString());
- cmd.set_sends_pings(true);
- cmd.set_is_web_accessible(true);
- cmd.set_is_run_as_user(true);
- cmd.AddWorkItems(installer_state.root_key(), cmd_key, work_item_list);
- }
-}
-
void AddProductSpecificWorkItems(const InstallationState& original_state,
const InstallerState& installer_state,
const base::FilePath& setup_path,
const Version& new_version,
bool is_new_install,
+ bool add_language_identifier,
WorkItemList* list) {
const Products& products = installer_state.products();
for (Products::const_iterator it = products.begin(); it < products.end();
@@ -391,28 +283,18 @@ void AddProductSpecificWorkItems(const InstallationState& original_state,
list);
AddFirewallRulesWorkItems(
installer_state, p.distribution(), is_new_install, list);
- AddLegacyAppCommandRemovalItem(
- installer_state,
- p.distribution()->GetAppRegistrationData(),
- kLegacyCmdInstallExtension,
- list);
-
- if (p.distribution()->AppHostIsSupported()) {
- // Unconditionally remove the "install-application" command from the app
- // hosts's key.
- UpdatingAppRegistrationData app_launcher_reg_data(
- installer::kAppLauncherGuid);
- AddLegacyAppCommandRemovalItem(installer_state, app_launcher_reg_data,
- kLegacyCmdInstallApp, list);
+
+#if defined(GOOGLE_CHROME_BUILD)
+ if (!InstallUtil::IsChromeSxSProcess()) {
+ // Add items to set up the App Launcher's version key if Google Chrome
+ // is being installed or updated.
+ AddAppLauncherVersionKeyWorkItems(installer_state.root_key(),
+ new_version, add_language_identifier, list);
}
+#endif // GOOGLE_CHROME_BUILD
}
- if (p.is_chrome_binaries()) {
- AddQueryEULAAcceptanceWorkItems(
- installer_state, setup_path, new_version, p, list);
+ if (p.is_chrome_binaries())
AddQuickEnableChromeFrameWorkItems(installer_state, list);
- AddQuickEnableApplicationLauncherWorkItems(
- installer_state, original_state, setup_path, new_version, list);
- }
}
}
@@ -1269,14 +1151,11 @@ void AddInstallWorkItems(const InstallationState& original_state,
install_list);
}
- if (installer_state.FindProduct(BrowserDistribution::CHROME_APP_HOST)) {
- install_list->AddCopyTreeWorkItem(
- src_path.Append(installer::kChromeAppHostExe).value(),
- target_path.Append(installer::kChromeAppHostExe).value(),
- temp_path.value(),
- WorkItem::ALWAYS,
- L"");
- }
+#if defined(GOOGLE_CHROME_BUILD)
+ // For Chrome, unconditionally remove the legacy app_host.exe.
+ if (!InstallUtil::IsChromeSxSProcess())
+ AddRemoveLegacyAppHostExeWorkItems(target_path, temp_path, install_list);
+#endif // GOOGLE_CHROME_BUILD
// Copy installer in install directory
AddInstallerCopyTasks(installer_state, setup_path, archive_path, temp_path,
@@ -1310,24 +1189,10 @@ void AddInstallWorkItems(const InstallationState& original_state,
install_list);
}
- // TODO(huangs): Implement actual migration code and remove the hack below.
- // If installing Chrome without the legacy stand-alone App Launcher (to be
- // handled later), add "shadow" App Launcher registry keys so Google Update
- // would recognize the "dr" value in the App Launcher ClientState key.
- // Checking .is_multi_install() excludes Chrome Canary and stand-alone Chrome.
- if (installer_state.is_multi_install() &&
- installer_state.FindProduct(BrowserDistribution::CHROME_BROWSER) &&
- !installer_state.FindProduct(BrowserDistribution::CHROME_APP_HOST)) {
- BrowserDistribution* shadow_app_launcher_dist =
- BrowserDistribution::GetSpecificDistribution(
- BrowserDistribution::CHROME_APP_HOST);
- AddVersionKeyWorkItems(root,
- shadow_app_launcher_dist->GetVersionKey(),
- shadow_app_launcher_dist->GetDisplayName(),
- new_version,
- add_language_identifier,
- install_list);
- }
+#if defined(GOOGLE_CHROME_BUILD)
+ if (!InstallUtil::IsChromeSxSProcess())
+ AddRemoveLegacyAppCommandsWorkItems(installer_state, install_list);
+#endif // GOOGLE_CHROME_BUILD
// Add any remaining work items that involve special settings for
// each product.
@@ -1336,6 +1201,7 @@ void AddInstallWorkItems(const InstallationState& original_state,
setup_path,
new_version,
current_version == NULL,
+ add_language_identifier,
install_list);
// Copy over brand, usagestats, and other values.
@@ -1612,33 +1478,6 @@ void AddOsUpgradeWorkItems(const InstallerState& installer_state,
}
}
-void AddQueryEULAAcceptanceWorkItems(const InstallerState& installer_state,
- const base::FilePath& setup_path,
- const Version& new_version,
- const Product& product,
- WorkItemList* work_item_list) {
- const HKEY root_key = installer_state.root_key();
- base::string16 cmd_key(
- GetRegCommandKey(product.distribution(), kCmdQueryEULAAcceptance));
- if (installer_state.operation() == InstallerState::UNINSTALL) {
- work_item_list->AddDeleteRegKeyWorkItem(root_key, cmd_key, KEY_WOW64_32KEY)
- ->set_log_message("Removing query EULA acceptance command");
- } else {
- base::CommandLine cmd_line(
- installer_state.GetInstallerDirectory(new_version)
- .Append(setup_path.BaseName()));
- cmd_line.AppendSwitch(switches::kQueryEULAAcceptance);
- if (installer_state.system_install())
- cmd_line.AppendSwitch(installer::switches::kSystemLevel);
- if (installer_state.verbose_logging())
- cmd_line.AppendSwitch(installer::switches::kVerboseLogging);
- AppCommand cmd(cmd_line.GetCommandLineString());
- cmd.set_is_web_accessible(true);
- cmd.set_is_run_as_user(true);
- cmd.AddWorkItems(installer_state.root_key(), cmd_key, work_item_list);
- }
-}
-
void AddQuickEnableChromeFrameWorkItems(const InstallerState& installer_state,
WorkItemList* work_item_list) {
DCHECK(work_item_list);
diff --git a/chrome/installer/setup/install_worker.h b/chrome/installer/setup/install_worker.h
index aadd588..d4aa130 100644
--- a/chrome/installer/setup/install_worker.h
+++ b/chrome/installer/setup/install_worker.h
@@ -179,16 +179,6 @@ void AddOsUpgradeWorkItems(const InstallerState& installer_state,
const Product& product,
WorkItemList* install_list);
-// Adds work items to add or remove the "query-eula-acceptance" command to
-// |product|'s version key on the basis of the current operation (represented
-// in |installer_state|). |new_version| is the version of the product(s)
-// currently being installed -- can be empty on uninstall.
-void AddQueryEULAAcceptanceWorkItems(const InstallerState& installer_state,
- const base::FilePath& setup_path,
- const base::Version& new_version,
- const Product& product,
- WorkItemList* work_item_list);
-
// Adds work items to remove "quick-enable-cf" from the multi-installer
// binaries' version key.
void AddQuickEnableChromeFrameWorkItems(const InstallerState& installer_state,
diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc
index 9017b33..ce494ff 100644
--- a/chrome/installer/setup/setup_main.cc
+++ b/chrome/installer/setup/setup_main.cc
@@ -47,7 +47,6 @@
#include "chrome/installer/util/channel_info.h"
#include "chrome/installer/util/delete_after_reboot_helper.h"
#include "chrome/installer/util/delete_tree_work_item.h"
-#include "chrome/installer/util/eula_util.h"
#include "chrome/installer/util/google_update_constants.h"
#include "chrome/installer/util/google_update_settings.h"
#include "chrome/installer/util/google_update_util.h"
@@ -381,8 +380,6 @@ bool CheckMultiInstallConditions(const InstallationState& original_state,
if (installer_state->is_multi_install()) {
const Product* chrome =
installer_state->FindProduct(BrowserDistribution::CHROME_BROWSER);
- const Product* app_host =
- installer_state->FindProduct(BrowserDistribution::CHROME_APP_HOST);
const Product* binaries =
installer_state->FindProduct(BrowserDistribution::CHROME_BINARIES);
const ProductState* chrome_state =
@@ -402,39 +399,7 @@ bool CheckMultiInstallConditions(const InstallationState& original_state,
return false;
}
} else {
- // This will only be hit if --multi-install is given with no products, or
- // if the app host is being installed and doesn't need the binaries at
- // user-level.
- // The former case might be due to a request by an orphaned Application
- // Host to re-install the binaries. Thus we add them to the installation.
- // The latter case is fine and we let it be.
- // If this is not an app host install and the binaries are not already
- // present, the installation will fail later due to a lack of products to
- // install.
- if (app_host && !chrome && !chrome_state) {
- DCHECK(!system_level);
- // App Host may use Chrome/Chrome binaries at system-level.
- if (original_state.GetProductState(
- true, // system
- BrowserDistribution::CHROME_BROWSER) ||
- original_state.GetProductState(
- true, // system
- BrowserDistribution::CHROME_BINARIES)) {
- VLOG(1) << "Installing/updating App Launcher without binaries.";
- } else {
- // Somehow the binaries were present when the quick-enable app host
- // command was run, but now they appear to be missing.
- // Force binaries to be installed/updated.
- scoped_ptr<Product> binaries_to_add(new Product(
- BrowserDistribution::GetSpecificDistribution(
- BrowserDistribution::CHROME_BINARIES)));
- binaries_to_add->SetOption(installer::kOptionMultiInstall, true);
- binaries = installer_state->AddProduct(&binaries_to_add);
- VLOG(1) <<
- "Adding binaries for pre-existing App Launcher installation.";
- }
- }
-
+ // This will only be hit if --multi-install is given with no products.
return true;
}
@@ -472,34 +437,6 @@ bool CheckMultiInstallConditions(const InstallationState& original_state,
return true;
}
-// Checks app host pre-install conditions, specifically that this is a
-// user-level multi-install. When the pre-install conditions are not
-// satisfied, the result is written to the registry (via WriteInstallerResult),
-// |status| is set appropriately, and false is returned.
-bool CheckAppHostPreconditions(const InstallationState& original_state,
- InstallerState* installer_state,
- installer::InstallStatus* status) {
- if (installer_state->FindProduct(BrowserDistribution::CHROME_APP_HOST)) {
- if (!installer_state->is_multi_install()) {
- LOG(DFATAL) << "App Launcher requires multi install";
- *status = installer::APP_HOST_REQUIRES_MULTI_INSTALL;
- // No message string since there is nothing a user can do.
- installer_state->WriteInstallerResult(*status, 0, NULL);
- return false;
- }
-
- if (installer_state->system_install()) {
- LOG(DFATAL) << "App Launcher may only be installed at user-level.";
- *status = installer::APP_HOST_REQUIRES_USER_LEVEL;
- // No message string since there is nothing a user can do.
- installer_state->WriteInstallerResult(*status, 0, NULL);
- return false;
- }
- }
-
- return true;
-}
-
// Checks for compatibility between the current state of the system and the
// desired operation. Also applies policy that mutates the desired operation;
// specifically, the |installer_state| object.
@@ -512,11 +449,6 @@ bool CheckAppHostPreconditions(const InstallationState& original_state,
bool CheckPreInstallConditions(const InstallationState& original_state,
InstallerState* installer_state,
installer::InstallStatus* status) {
- if (!CheckAppHostPreconditions(original_state, installer_state, status)) {
- DCHECK_NE(*status, installer::UNKNOWN_STATUS);
- return false;
- }
-
// See what products are already installed in multi mode. When we do multi
// installs, we must upgrade all installations since they share the binaries.
AddExistingMultiInstalls(original_state, installer_state);
@@ -597,18 +529,6 @@ bool CheckPreInstallConditions(const InstallationState& original_state,
return false;
}
}
-
- } else { // System-level install.
- // --ensure-google-update-present is supported for user-level only.
- // The flag is generic, but its primary use case involves App Host.
- if (installer_state->ensure_google_update_present()) {
- LOG(DFATAL) << "--" << installer::switches::kEnsureGoogleUpdatePresent
- << " is supported for user-level only.";
- *status = installer::APP_HOST_REQUIRES_USER_LEVEL;
- // No message string since there is nothing a user can do.
- installer_state->WriteInstallerResult(*status, 0, NULL);
- return false;
- }
}
return true;
@@ -1141,8 +1061,6 @@ bool HandleNonInstallCmdLineOptions(const InstallationState& original_state,
LOG(DFATAL) << "Chrome product not found.";
}
*exit_code = InstallUtil::GetInstallReturnCode(status);
- } else if (cmd_line.HasSwitch(installer::switches::kQueryEULAAcceptance)) {
- *exit_code = installer::IsEULAAccepted(installer_state->system_install());
} else if (cmd_line.HasSwitch(installer::switches::kInactiveUserToast)) {
// Launch the inactive user toast experiment.
int flavor = -1;
@@ -1520,22 +1438,11 @@ InstallStatus InstallProductsHelper(const InstallationState& original_state,
}
if (higher_products != 0) {
- COMPILE_ASSERT(BrowserDistribution::NUM_TYPES == 4,
+ COMPILE_ASSERT(BrowserDistribution::NUM_TYPES == 3,
add_support_for_new_products_here_);
- const uint32 kBrowserBit = 1 << BrowserDistribution::CHROME_BROWSER;
- int message_id = 0;
-
+ int message_id = IDS_INSTALL_HIGHER_VERSION_BASE;
proceed_with_installation = false;
install_status = HIGHER_VERSION_EXISTS;
- switch (higher_products) {
- case kBrowserBit:
- message_id = IDS_INSTALL_HIGHER_VERSION_BASE;
- break;
- default:
- message_id = IDS_INSTALL_HIGHER_VERSION_APP_LAUNCHER_BASE;
- break;
- }
-
installer_state.WriteInstallerResult(install_status, message_id, NULL);
}
@@ -1545,22 +1452,6 @@ InstallStatus InstallProductsHelper(const InstallationState& original_state,
*installer_version, &install_status);
if (proceed_with_installation) {
- // If Google Update is absent at user-level, install it using the
- // Google Update installer from an existing system-level installation.
- // This is for quick-enable App Host install from a system-level
- // Chrome Binaries installation.
- if (!system_install && installer_state.ensure_google_update_present()) {
- if (!google_update::EnsureUserLevelGoogleUpdatePresent()) {
- LOG(ERROR) << "Failed to install Google Update";
- proceed_with_installation = false;
- install_status = INSTALL_OF_GOOGLE_UPDATE_FAILED;
- installer_state.WriteInstallerResult(install_status, 0, NULL);
- }
- }
-
- }
-
- if (proceed_with_installation) {
base::FilePath prefs_source_path(cmd_line.GetSwitchValueNative(
switches::kInstallerData));
install_status = InstallOrUpdateProduct(
diff --git a/chrome/installer/setup/setup_util.cc b/chrome/installer/setup/setup_util.cc
index ba25f7e..99ea3f5 100644
--- a/chrome/installer/setup/setup_util.cc
+++ b/chrome/installer/setup/setup_util.cc
@@ -444,6 +444,9 @@ bool ContainsUnsupportedSwitch(const base::CommandLine& cmd_line) {
// Installation of Chrome Frame.
"chrome-frame",
"migrate-chrome-frame",
+ // Stand-alone App Launcher.
+ "app-host",
+ "app-launcher",
};
for (size_t i = 0; i < arraysize(kLegacySwitches); ++i) {
if (cmd_line.HasSwitch(kLegacySwitches[i]))
diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc
index 3df4ea8..4ba72dc 100644
--- a/chrome/installer/setup/uninstall.cc
+++ b/chrome/installer/setup/uninstall.cc
@@ -26,6 +26,7 @@
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_result_codes.h"
+#include "chrome/installer/setup/app_launcher_installer.h"
#include "chrome/installer/setup/install.h"
#include "chrome/installer/setup/install_worker.h"
#include "chrome/installer/setup/setup_constants.h"
@@ -185,20 +186,14 @@ void ClearRlzProductState() {
}
}
-// Decides whether setup.exe and the installer archive should be removed based
-// on the original and installer states:
-// * non-multi product being uninstalled: remove both
-// * any multi product left besides App Host: keep both
-// * only App Host left: keep setup.exe
-void CheckShouldRemoveSetupAndArchive(const InstallationState& original_state,
- const InstallerState& installer_state,
- bool* remove_setup,
- bool* remove_archive) {
- *remove_setup = true;
- *remove_archive = true;
-
- // If any multi-install product is left (other than App Host) we must leave
- // the installer and archive. For the App Host, we only leave the installer.
+// Returns whether setup.exe should be removed based on the original and
+// installer states:
+// * non-multi product being uninstalled: remove setup.exe
+// * any multi product left: keep setup.exe
+bool CheckShouldRemoveSetup(const InstallationState& original_state,
+ const InstallerState& installer_state) {
+ // If any multi-install product is left we must leave the installer and
+ // archive.
if (!installer_state.is_multi_install()) {
VLOG(1) << "Removing all installer files for a non-multi installation.";
} else {
@@ -214,23 +209,14 @@ void CheckShouldRemoveSetupAndArchive(const InstallationState& original_state,
!installer_state.FindProduct(dist_type)) {
// setup.exe will not be removed as there is a remaining multi-install
// product.
- *remove_setup = false;
- // As a special case, we can still remove the actual archive if the
- // only remaining product is the App Host.
- if (dist_type != BrowserDistribution::CHROME_APP_HOST) {
- VLOG(1) << "Keeping all installer files due to a remaining "
- << "multi-install product.";
- *remove_archive = false;
- return;
- }
- VLOG(1) << "Keeping setup.exe due to a remaining "
- << "app-host installation.";
+ VLOG(1) << "Keeping all installer files due to a remaining "
+ << "multi-install product.";
+ return false;
}
}
- VLOG(1) << "Removing the installer archive.";
- if (remove_setup)
- VLOG(1) << "Removing setup.exe.";
+ VLOG(1) << "Removing all installer files.";
}
+ return true;
}
// Removes all files from the installer directory, leaving setup.exe iff
@@ -513,28 +499,6 @@ bool MoveSetupOutOfInstallFolder(const InstallerState& installer_state,
return true;
}
-DeleteResult DeleteAppHostFilesAndFolders(const InstallerState& installer_state,
- const Version& installed_version) {
- const base::FilePath& target_path = installer_state.target_path();
- if (target_path.empty()) {
- LOG(ERROR) << "DeleteAppHostFilesAndFolders: no installation destination "
- << "path.";
- return DELETE_FAILED; // Nothing else we can do to uninstall, so we return.
- }
-
- DeleteInstallTempDir(target_path);
-
- DeleteResult result = DELETE_SUCCEEDED;
-
- base::FilePath app_host_exe(target_path.Append(installer::kChromeAppHostExe));
- if (!base::DeleteFile(app_host_exe, false)) {
- result = DELETE_FAILED;
- LOG(ERROR) << "Failed to delete path: " << app_host_exe.value();
- }
-
- return result;
-}
-
DeleteResult DeleteChromeFilesAndFolders(const InstallerState& installer_state,
const base::FilePath& setup_exe) {
const base::FilePath& target_path = installer_state.target_path();
@@ -561,8 +525,6 @@ DeleteResult DeleteChromeFilesAndFolders(const InstallerState& installer_state,
base::FileEnumerator::FILES | base::FileEnumerator::DIRECTORIES);
for (base::FilePath to_delete = file_enumerator.Next(); !to_delete.empty();
to_delete = file_enumerator.Next()) {
- if (to_delete.BaseName().value() == installer::kChromeAppHostExe)
- continue;
if (!installer_directory.empty() &&
(to_delete == installer_directory ||
installer_directory.IsParent(to_delete) ||
@@ -1219,6 +1181,11 @@ InstallStatus UninstallProduct(const InstallationState& original_state,
DeleteChromeRegistrationKeys(installer_state, browser_dist,
HKEY_CURRENT_USER, suffix, &ret);
+#if defined(GOOGLE_CHROME_BUILD)
+ if (!InstallUtil::IsChromeSxSProcess())
+ RemoveAppLauncherVersionKey(reg_root);
+#endif // GOOGLE_CHROME_BUILD
+
// If the user's Chrome is registered with a suffix: it is possible that old
// unsuffixed registrations were left in HKCU (e.g. if this install was
// previously installed with no suffix in HKCU (old suffix rules if the user
@@ -1277,22 +1244,6 @@ InstallStatus UninstallProduct(const InstallationState& original_state,
// Notify the shell that associations have changed since Chrome was likely
// unregistered.
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL);
-
- // TODO(huangs): Implement actual migration code and remove the hack below.
- // Remove the "shadow" App Launcher registry keys.
- // TODO(hunags): Management of this key should not be conditional on
- // multi-install since the app list feature is available regardless of how
- // chrome is installed.
- if (installer_state.is_multi_install()) {
- // Delete the "shadow" keys.
- BrowserDistribution* shadow_app_launcher_dist =
- BrowserDistribution::GetSpecificDistribution(
- BrowserDistribution::CHROME_APP_HOST);
- InstallUtil::DeleteRegistryKey(
- reg_root,
- shadow_app_launcher_dist->GetVersionKey(),
- KEY_WOW64_32KEY);
- }
}
if (installer_state.is_multi_install())
@@ -1369,10 +1320,7 @@ InstallStatus UninstallProduct(const InstallationState& original_state,
delete_profile = false;
}
- if (product.is_chrome_app_host()) {
- DeleteAppHostFilesAndFolders(installer_state, product_state->version());
- } else if (!installer_state.is_multi_install() ||
- product.is_chrome_binaries()) {
+ if (!installer_state.is_multi_install() || product.is_chrome_binaries()) {
DeleteResult delete_result = DeleteChromeFilesAndFolders(
installer_state, base::MakeAbsoluteFilePath(setup_exe));
if (delete_result == DELETE_FAILED) {
@@ -1420,12 +1368,7 @@ void CleanUpInstallationDirectoryAfterUninstall(
}
base::FilePath install_directory(setup_exe.DirName());
- bool remove_setup = true;
- bool remove_archive = true;
- CheckShouldRemoveSetupAndArchive(original_state, installer_state,
- &remove_setup, &remove_archive);
- if (!remove_archive)
- return;
+ bool remove_setup = CheckShouldRemoveSetup(original_state, installer_state);
if (remove_setup) {
// In order to be able to remove the folder in which we're running, we
diff --git a/chrome/installer/util/BUILD.gn b/chrome/installer/util/BUILD.gn
index 5695469..a73f920 100644
--- a/chrome/installer/util/BUILD.gn
+++ b/chrome/installer/util/BUILD.gn
@@ -16,8 +16,6 @@ static_library("util") {
# name ("installer_util_minimal"?) since it's not strictly the 64-bit build
# of that target.
sources = [
- "chrome_app_host_operations.cc",
- "chrome_app_host_operations.h",
"chrome_binaries_operations.cc",
"chrome_binaries_operations.h",
"chrome_browser_operations.cc",
@@ -30,8 +28,6 @@ static_library("util") {
"compat_checks.h",
"delete_after_reboot_helper.cc",
"delete_after_reboot_helper.h",
- "eula_util.cc",
- "eula_util.h",
"google_chrome_distribution.cc",
"google_chrome_distribution.h",
"html_dialog.h",
@@ -89,8 +85,6 @@ static_library("util") {
"callback_work_item.h",
"channel_info.cc",
"channel_info.h",
- "chrome_app_host_distribution.cc",
- "chrome_app_host_distribution.h",
"chrome_frame_distribution.cc",
"chrome_frame_distribution.h",
"chromium_binaries_distribution.cc",
diff --git a/chrome/installer/util/browser_distribution.cc b/chrome/installer/util/browser_distribution.cc
index 77b119f..dd7918d 100644
--- a/chrome/installer/util/browser_distribution.cc
+++ b/chrome/installer/util/browser_distribution.cc
@@ -18,7 +18,6 @@
#include "chrome/common/chrome_icon_resources_win.h"
#include "chrome/common/env_vars.h"
#include "chrome/installer/util/app_registration_data.h"
-#include "chrome/installer/util/chrome_app_host_distribution.h"
#include "chrome/installer/util/chrome_frame_distribution.h"
#include "chrome/installer/util/chromium_binaries_distribution.h"
#include "chrome/installer/util/google_chrome_binaries_distribution.h"
@@ -45,15 +44,12 @@ const wchar_t kCommandExecuteImplUuid[] =
BrowserDistribution* g_browser_distribution = NULL;
BrowserDistribution* g_chrome_frame_distribution = NULL;
BrowserDistribution* g_binaries_distribution = NULL;
-BrowserDistribution* g_chrome_app_host_distribution = NULL;
BrowserDistribution::Type GetCurrentDistributionType() {
- // TODO(erikwright): If the app host is installed, but not Chrome, perhaps
- // this should return CHROME_APP_HOST.
return BrowserDistribution::CHROME_BROWSER;
}
-} // end namespace
+} // namespace
BrowserDistribution::BrowserDistribution()
: type_(CHROME_BROWSER),
@@ -112,11 +108,6 @@ BrowserDistribution* BrowserDistribution::GetSpecificDistribution(
&g_chrome_frame_distribution);
break;
- case CHROME_APP_HOST:
- dist = GetOrCreateBrowserDistribution<ChromeAppHostDistribution>(
- &g_chrome_app_host_distribution);
- break;
-
default:
DCHECK_EQ(CHROME_BINARIES, type);
#if defined(GOOGLE_CHROME_BUILD)
@@ -282,10 +273,6 @@ bool BrowserDistribution::GetCommandExecuteImplClsid(
return true;
}
-bool BrowserDistribution::AppHostIsSupported() {
- return false;
-}
-
void BrowserDistribution::UpdateInstallStatus(bool system_install,
installer::ArchiveType archive_type,
installer::InstallStatus install_status) {
diff --git a/chrome/installer/util/browser_distribution.h b/chrome/installer/util/browser_distribution.h
index 7f41d15..46fc4b9 100644
--- a/chrome/installer/util/browser_distribution.h
+++ b/chrome/installer/util/browser_distribution.h
@@ -28,7 +28,6 @@ class BrowserDistribution {
CHROME_BROWSER,
CHROME_FRAME,
CHROME_BINARIES,
- CHROME_APP_HOST,
NUM_TYPES
};
@@ -150,9 +149,6 @@ class BrowserDistribution {
// non-NULL.
virtual bool GetCommandExecuteImplClsid(base::string16* handler_class_uuid);
- // Returns true if this distribution uses app_host.exe to run platform apps.
- virtual bool AppHostIsSupported();
-
virtual void UpdateInstallStatus(bool system_install,
installer::ArchiveType archive_type,
installer::InstallStatus install_status);
diff --git a/chrome/installer/util/channel_info.cc b/chrome/installer/util/channel_info.cc
index cdf264b..5180fcf 100644
--- a/chrome/installer/util/channel_info.cc
+++ b/chrome/installer/util/channel_info.cc
@@ -15,9 +15,8 @@ namespace {
const wchar_t kModChrome[] = L"-chrome";
const wchar_t kModChromeFrame[] = L"-chromeframe";
-// TODO(huangs): Remove by M27.
const wchar_t kModAppHostDeprecated[] = L"-apphost";
-const wchar_t kModAppLauncher[] = L"-applauncher";
+const wchar_t kModAppLauncherDeprecated[] = L"-applauncher";
const wchar_t kModMultiInstall[] = L"-multi";
const wchar_t kModReadyMode[] = L"-readymode";
const wchar_t kModStage[] = L"-stage:";
@@ -36,8 +35,8 @@ const wchar_t* const kModifiers[] = {
kModMultiInstall,
kModChrome,
kModChromeFrame,
- kModAppHostDeprecated, // TODO(huangs): Remove by M27.
- kModAppLauncher,
+ kModAppHostDeprecated,
+ kModAppLauncherDeprecated,
kModReadyMode,
kSfxMultiFail,
kSfxMigrating,
@@ -49,8 +48,8 @@ enum ModifierIndex {
MOD_MULTI_INSTALL,
MOD_CHROME,
MOD_CHROME_FRAME,
- MOD_APP_HOST_DEPRECATED, // TODO(huangs): Remove by M27.
- MOD_APP_LAUNCHER,
+ MOD_APP_HOST_DEPRECATED,
+ MOD_APP_LAUNCHER_DEPRECATED,
MOD_READY_MODE,
SFX_MULTI_FAIL,
SFX_MIGRATING,
@@ -65,47 +64,47 @@ COMPILE_ASSERT(NUM_MODIFIERS == arraysize(kModifiers),
// location at which the modifier was found. The number of characters in the
// modifier is returned in |length|, if non-NULL.
bool FindModifier(ModifierIndex index,
- const std::wstring& ap_value,
- std::wstring::size_type* position,
- std::wstring::size_type* length) {
+ const base::string16& ap_value,
+ base::string16::size_type* position,
+ base::string16::size_type* length) {
DCHECK(position != NULL);
- std::wstring::size_type mod_position = std::wstring::npos;
- std::wstring::size_type mod_length =
- std::wstring::traits_type::length(kModifiers[index]);
+ base::string16::size_type mod_position = base::string16::npos;
+ base::string16::size_type mod_length =
+ base::string16::traits_type::length(kModifiers[index]);
const bool mod_takes_arg = (kModifiers[index][mod_length - 1] == L':');
- std::wstring::size_type pos = 0;
+ base::string16::size_type pos = 0;
do {
mod_position = ap_value.find(kModifiers[index], pos, mod_length);
- if (mod_position == std::wstring::npos)
+ if (mod_position == base::string16::npos)
return false; // Modifier not found.
pos = mod_position + mod_length;
// Modifiers that take an argument gobble up to the next separator or to the
// end.
if (mod_takes_arg) {
pos = ap_value.find(L'-', pos);
- if (pos == std::wstring::npos)
+ if (pos == base::string16::npos)
pos = ap_value.size();
break;
}
// Regular modifiers must be followed by '-' or the end of the string.
} while (pos != ap_value.size() && ap_value[pos] != L'-');
- DCHECK_NE(mod_position, std::wstring::npos);
+ DCHECK_NE(mod_position, base::string16::npos);
*position = mod_position;
if (length != NULL)
*length = pos - mod_position;
return true;
}
-bool HasModifier(ModifierIndex index, const std::wstring& ap_value) {
+bool HasModifier(ModifierIndex index, const base::string16& ap_value) {
DCHECK(index >= 0 && index < NUM_MODIFIERS);
- std::wstring::size_type position;
+ base::string16::size_type position;
return FindModifier(index, ap_value, &position, NULL);
}
-std::wstring::size_type FindInsertionPoint(ModifierIndex index,
- const std::wstring& ap_value) {
+base::string16::size_type FindInsertionPoint(ModifierIndex index,
+ const base::string16& ap_value) {
// Return the location of the next modifier.
- std::wstring::size_type result;
+ base::string16::size_type result;
for (int scan = index + 1; scan < NUM_MODIFIERS; ++scan) {
if (FindModifier(static_cast<ModifierIndex>(scan), ap_value, &result, NULL))
@@ -116,11 +115,11 @@ std::wstring::size_type FindInsertionPoint(ModifierIndex index,
}
// Returns true if |ap_value| is modified.
-bool SetModifier(ModifierIndex index, bool set, std::wstring* ap_value) {
+bool SetModifier(ModifierIndex index, bool set, base::string16* ap_value) {
DCHECK(index >= 0 && index < NUM_MODIFIERS);
DCHECK(ap_value);
- std::wstring::size_type position;
- std::wstring::size_type length;
+ base::string16::size_type position;
+ base::string16::size_type length;
bool have_modifier = FindModifier(index, *ap_value, &position, &length);
if (set) {
if (!have_modifier) {
@@ -143,7 +142,7 @@ namespace installer {
bool ChannelInfo::Initialize(const RegKey& key) {
LONG result = key.ReadValue(google_update::kRegApField, &value_);
return result == ERROR_SUCCESS || result == ERROR_FILE_NOT_FOUND ||
- result == ERROR_INVALID_HANDLE;
+ result == ERROR_INVALID_HANDLE;
}
bool ChannelInfo::Write(RegKey* key) const {
@@ -159,7 +158,7 @@ bool ChannelInfo::Write(RegKey* key) const {
return true;
}
-bool ChannelInfo::GetChannelName(std::wstring* channel_name) const {
+bool ChannelInfo::GetChannelName(base::string16* channel_name) const {
DCHECK(channel_name);
if (value_.empty()) {
channel_name->erase();
@@ -168,7 +167,7 @@ bool ChannelInfo::GetChannelName(std::wstring* channel_name) const {
for (const wchar_t* const* scan = &kChannels[0],
*const* end = &kChannels[arraysize(kChannels)]; scan != end;
++scan) {
- if (value_.find(*scan) != std::wstring::npos) {
+ if (value_.find(*scan) != base::string16::npos) {
// Report channels with "stable" in them as stable (empty string).
if (*scan == installer::kChromeChannelStableExplicit)
channel_name->erase();
@@ -179,7 +178,7 @@ bool ChannelInfo::GetChannelName(std::wstring* channel_name) const {
}
// There may be modifiers present. Strip them off and see if we're left
// with the empty string (stable channel).
- std::wstring tmp_value = value_;
+ base::string16 tmp_value = value_;
for (int i = 0; i != NUM_MODIFIERS; ++i) {
SetModifier(static_cast<ModifierIndex>(i), false, &tmp_value);
}
@@ -209,13 +208,15 @@ bool ChannelInfo::SetChromeFrame(bool value) {
}
bool ChannelInfo::IsAppLauncher() const {
- return HasModifier(MOD_APP_LAUNCHER, value_);
+ return HasModifier(MOD_APP_LAUNCHER_DEPRECATED, value_);
}
bool ChannelInfo::SetAppLauncher(bool value) {
- // Unconditionally remove -apphost since it has been deprecated.
+ // Unconditionally remove -apphost since it has been long deprecated.
bool changed_app_host = SetModifier(MOD_APP_HOST_DEPRECATED, false, &value_);
- bool changed_app_launcher = SetModifier(MOD_APP_LAUNCHER, value, &value_);
+ // Set value for -applauncher, relying on caller for policy.
+ bool changed_app_launcher =
+ SetModifier(MOD_APP_LAUNCHER_DEPRECATED, value, &value_);
return changed_app_host || changed_app_launcher;
}
@@ -236,11 +237,11 @@ bool ChannelInfo::SetReadyMode(bool value) {
}
bool ChannelInfo::SetStage(const wchar_t* stage) {
- std::wstring::size_type position;
- std::wstring::size_type length;
+ base::string16::size_type position;
+ base::string16::size_type length;
bool have_modifier = FindModifier(MOD_STAGE, value_, &position, &length);
if (stage != NULL && *stage != L'\0') {
- std::wstring stage_str(kModStage);
+ base::string16 stage_str(kModStage);
stage_str.append(stage);
if (!have_modifier) {
value_.insert(FindInsertionPoint(MOD_STAGE, value_), stage_str);
@@ -259,18 +260,18 @@ bool ChannelInfo::SetStage(const wchar_t* stage) {
return false;
}
-std::wstring ChannelInfo::GetStage() const {
- std::wstring::size_type position;
- std::wstring::size_type length;
+base::string16 ChannelInfo::GetStage() const {
+ base::string16::size_type position;
+ base::string16::size_type length;
if (FindModifier(MOD_STAGE, value_, &position, &length)) {
// Return the portion after the prefix.
- std::wstring::size_type pfx_length =
- std::wstring::traits_type::length(kModStage);
+ base::string16::size_type pfx_length =
+ base::string16::traits_type::length(kModStage);
DCHECK_LE(pfx_length, length);
return value_.substr(position + pfx_length, length - pfx_length);
}
- return std::wstring();
+ return base::string16();
}
bool ChannelInfo::HasFullSuffix() const {
diff --git a/chrome/installer/util/channel_info.h b/chrome/installer/util/channel_info.h
index f148113..60722b5 100644
--- a/chrome/installer/util/channel_info.h
+++ b/chrome/installer/util/channel_info.h
@@ -5,7 +5,7 @@
#ifndef CHROME_INSTALLER_UTIL_CHANNEL_INFO_H_
#define CHROME_INSTALLER_UTIL_CHANNEL_INFO_H_
-#include <string>
+#include "base/strings/string16.h"
namespace base {
namespace win {
@@ -31,8 +31,8 @@ class ChannelInfo {
// Returns false if the value could not be written to the registry.
bool Write(base::win::RegKey* key) const;
- const std::wstring& value() const { return value_; }
- void set_value(const std::wstring& value) { value_ = value; }
+ const base::string16& value() const { return value_; }
+ void set_value(const base::string16& value) { value_ = value; }
bool Equals(const ChannelInfo& other) const {
return value_ == other.value_;
}
@@ -41,7 +41,7 @@ class ChannelInfo {
// results are the empty string (stable channel), "beta", and "dev". Returns
// false (without modifying |channel_name|) if the channel could not be
// determined.
- bool GetChannelName(std::wstring* channel_name) const;
+ bool GetChannelName(base::string16* channel_name) const;
// Returns true if the -chrome modifier is present in the value.
bool IsChrome() const;
@@ -57,11 +57,12 @@ class ChannelInfo {
// modified.
bool SetChromeFrame(bool value);
- // Returns true if the -applauncher modifier is present in the value.
+ // (Deprecated) Returns true if the -applauncher modifier is present in the
+ // value.
bool IsAppLauncher() const;
- // Adds or removes the -applauncher modifier, returning true if the value is
- // modified.
+ // (Deprecated) Adds or removes the -applauncher modifier, returning true if
+ // the value is modified.
bool SetAppLauncher(bool value);
// Returns true if the -multi modifier is present in the value.
@@ -85,7 +86,7 @@ class ChannelInfo {
// Returns the string identifying the current stage, or an empty string if the
// -stage: modifier is not present in the value.
- std::wstring GetStage() const;
+ base::string16 GetStage() const;
// Returns true if the -full suffix is present in the value.
bool HasFullSuffix() const;
@@ -113,7 +114,7 @@ class ChannelInfo {
bool RemoveAllModifiersAndSuffixes();
private:
- std::wstring value_;
+ base::string16 value_;
}; // class ChannelInfo
} // namespace installer
diff --git a/chrome/installer/util/channel_info_unittest.cc b/chrome/installer/util/channel_info_unittest.cc
index 71d908b..dd50c38 100644
--- a/chrome/installer/util/channel_info_unittest.cc
+++ b/chrome/installer/util/channel_info_unittest.cc
@@ -2,10 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "chrome/installer/util/channel_info.h"
+
#include <utility>
#include "base/basictypes.h"
-#include "chrome/installer/util/channel_info.h"
#include "chrome/installer/util/util_constants.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -13,15 +14,15 @@ using installer::ChannelInfo;
namespace {
-const std::wstring kChannelStable(installer::kChromeChannelStable);
-const std::wstring kChannelBeta(installer::kChromeChannelBeta);
-const std::wstring kChannelDev(installer::kChromeChannelDev);
+const base::string16 kChannelStable(installer::kChromeChannelStable);
+const base::string16 kChannelBeta(installer::kChromeChannelBeta);
+const base::string16 kChannelDev(installer::kChromeChannelDev);
} // namespace
TEST(ChannelInfoTest, Channels) {
ChannelInfo ci;
- std::wstring channel;
+ base::string16 channel;
ci.set_value(L"");
EXPECT_TRUE(ci.GetChannelName(&channel));
diff --git a/chrome/installer/util/chrome_app_host_distribution.cc b/chrome/installer/util/chrome_app_host_distribution.cc
deleted file mode 100644
index 2f94f01..0000000
--- a/chrome/installer/util/chrome_app_host_distribution.cc
+++ /dev/null
@@ -1,130 +0,0 @@
-// Copyright (c) 2012 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.
-//
-// This file defines a specific implementation of BrowserDistribution class for
-// Chrome App Host. It overrides the bare minimum of methods necessary to get a
-// Chrome App Host installer that does not interact with Google Chrome or
-// Chromium installations.
-
-#include "chrome/installer/util/chrome_app_host_distribution.h"
-
-#include "base/strings/string_util.h"
-#include "chrome/common/net/test_server_locations.h"
-#include "chrome/installer/util/channel_info.h"
-#include "chrome/installer/util/google_update_constants.h"
-#include "chrome/installer/util/google_update_settings.h"
-#include "chrome/installer/util/helper.h"
-#include "chrome/installer/util/install_util.h"
-#include "chrome/installer/util/l10n_string_util.h"
-#include "chrome/installer/util/updating_app_registration_data.h"
-
-#include "installer_util_strings.h" // NOLINT
-
-ChromeAppHostDistribution::ChromeAppHostDistribution()
- : BrowserDistribution(
- CHROME_APP_HOST,
- scoped_ptr<AppRegistrationData>(
- new UpdatingAppRegistrationData(installer::kAppLauncherGuid))) {
-}
-
-base::string16 ChromeAppHostDistribution::GetBaseAppName() {
- return L"Google Chrome App Launcher";
-}
-
-base::string16 ChromeAppHostDistribution::GetBrowserProgIdPrefix() {
- NOTREACHED();
- return base::string16();
-}
-
-base::string16 ChromeAppHostDistribution::GetBrowserProgIdDesc() {
- NOTREACHED();
- return base::string16();
-}
-
-base::string16 ChromeAppHostDistribution::GetDisplayName() {
- return GetShortcutName(SHORTCUT_APP_LAUNCHER);
-}
-
-base::string16 ChromeAppHostDistribution::GetShortcutName(
- ShortcutType shortcut_type) {
- DCHECK_EQ(shortcut_type, SHORTCUT_APP_LAUNCHER);
- return installer::GetLocalizedString(IDS_PRODUCT_APP_LAUNCHER_NAME_BASE);
-}
-
-base::string16 ChromeAppHostDistribution::GetBaseAppId() {
- // Should be same as AppListController::GetAppModelId().
- return L"ChromeAppList";
-}
-
-base::string16 ChromeAppHostDistribution::GetInstallSubDir() {
- return BrowserDistribution::GetSpecificDistribution(
- BrowserDistribution::CHROME_BINARIES)->GetInstallSubDir();
-}
-
-base::string16 ChromeAppHostDistribution::GetPublisherName() {
- const base::string16& publisher_name =
- installer::GetLocalizedString(IDS_ABOUT_VERSION_COMPANY_NAME_BASE);
- return publisher_name;
-}
-
-base::string16 ChromeAppHostDistribution::GetAppDescription() {
- const base::string16& app_description =
- installer::GetLocalizedString(IDS_APP_LAUNCHER_SHORTCUT_TOOLTIP_BASE);
- return app_description;
-}
-
-base::string16 ChromeAppHostDistribution::GetLongAppDescription() {
- const base::string16& app_description =
- installer::GetLocalizedString(IDS_APP_LAUNCHER_PRODUCT_DESCRIPTION_BASE);
- return app_description;
-}
-
-std::string ChromeAppHostDistribution::GetSafeBrowsingName() {
- return "googlechromeapphost";
-}
-
-std::string ChromeAppHostDistribution::GetNetworkStatsServer() const {
- return chrome_common_net::kEchoTestServerLocation;
-}
-
-base::string16 ChromeAppHostDistribution::GetUninstallLinkName() {
- const base::string16& link_name =
- installer::GetLocalizedString(IDS_UNINSTALL_APP_LAUNCHER_BASE);
- return link_name;
-}
-
-base::string16 ChromeAppHostDistribution::GetUninstallRegPath() {
- return L"Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\"
- L"Google Chrome App Launcher";
-}
-
-BrowserDistribution::DefaultBrowserControlPolicy
- ChromeAppHostDistribution::GetDefaultBrowserControlPolicy() {
- return DEFAULT_BROWSER_UNSUPPORTED;
-}
-
-bool ChromeAppHostDistribution::CanCreateDesktopShortcuts() {
- return true;
-}
-
-base::string16 ChromeAppHostDistribution::GetIconFilename() {
- return installer::kChromeAppHostExe;
-}
-
-bool ChromeAppHostDistribution::GetCommandExecuteImplClsid(
- base::string16* handler_class_uuid) {
- return false;
-}
-
-void ChromeAppHostDistribution::UpdateInstallStatus(bool system_install,
- installer::ArchiveType archive_type,
- installer::InstallStatus install_status) {
-#if defined(GOOGLE_CHROME_BUILD)
- GoogleUpdateSettings::UpdateInstallStatus(
- system_install,
- archive_type,
- InstallUtil::GetInstallReturnCode(install_status),
- installer::kAppLauncherGuid);
-#endif
-}
diff --git a/chrome/installer/util/chrome_app_host_distribution.h b/chrome/installer/util/chrome_app_host_distribution.h
deleted file mode 100644
index 9c28fe5..0000000
--- a/chrome/installer/util/chrome_app_host_distribution.h
+++ /dev/null
@@ -1,65 +0,0 @@
-// Copyright (c) 2012 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.
-//
-// This file extends the browser distribution with a specific implementation
-// for Chrome AppHost.
-
-#ifndef CHROME_INSTALLER_UTIL_CHROME_APP_HOST_DISTRIBUTION_H_
-#define CHROME_INSTALLER_UTIL_CHROME_APP_HOST_DISTRIBUTION_H_
-
-#include "chrome/installer/util/browser_distribution.h"
-#include "chrome/installer/util/util_constants.h"
-
-class ChromeAppHostDistribution : public BrowserDistribution {
- public:
- virtual base::string16 GetDisplayName() override;
-
- virtual base::string16 GetBrowserProgIdPrefix() override;
-
- virtual base::string16 GetBrowserProgIdDesc() override;
-
- // This can only be called with SHORTCUT_APP_LAUNCHER for |shortcut_type|.
- virtual base::string16 GetShortcutName(ShortcutType shortcut_type) override;
-
- virtual base::string16 GetIconFilename() override;
-
- virtual base::string16 GetBaseAppName() override;
-
- virtual base::string16 GetBaseAppId() override;
-
- virtual base::string16 GetInstallSubDir() override;
-
- virtual base::string16 GetPublisherName() override;
-
- virtual base::string16 GetAppDescription() override;
-
- virtual base::string16 GetLongAppDescription() override;
-
- virtual std::string GetSafeBrowsingName() override;
-
- virtual std::string GetNetworkStatsServer() const override;
-
- virtual base::string16 GetUninstallLinkName() override;
-
- virtual base::string16 GetUninstallRegPath() override;
-
- virtual DefaultBrowserControlPolicy GetDefaultBrowserControlPolicy() override;
-
- virtual bool CanCreateDesktopShortcuts() override;
-
- virtual bool GetCommandExecuteImplClsid(
- base::string16* handler_class_uuid) override;
-
- virtual void UpdateInstallStatus(bool system_install,
- installer::ArchiveType archive_type,
- installer::InstallStatus install_status) override;
-
- protected:
- friend class BrowserDistribution;
-
- // Disallow construction from non-friends.
- ChromeAppHostDistribution();
-};
-
-#endif // CHROME_INSTALLER_UTIL_CHROME_APP_HOST_DISTRIBUTION_H_
diff --git a/chrome/installer/util/chrome_app_host_operations.cc b/chrome/installer/util/chrome_app_host_operations.cc
deleted file mode 100644
index 6130d41..0000000
--- a/chrome/installer/util/chrome_app_host_operations.cc
+++ /dev/null
@@ -1,134 +0,0 @@
-// Copyright (c) 2012 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.
-
-#include "chrome/installer/util/chrome_app_host_operations.h"
-
-#include "base/command_line.h"
-#include "base/files/file_path.h"
-#include "base/logging.h"
-#include "chrome/common/chrome_switches.h"
-#include "chrome/installer/util/browser_distribution.h"
-#include "chrome/installer/util/channel_info.h"
-#include "chrome/installer/util/helper.h"
-#include "chrome/installer/util/master_preferences.h"
-#include "chrome/installer/util/master_preferences_constants.h"
-#include "chrome/installer/util/shell_util.h"
-#include "chrome/installer/util/util_constants.h"
-
-namespace installer {
-
-void ChromeAppHostOperations::ReadOptions(const MasterPreferences& prefs,
- std::set<base::string16>* options)
- const {
- DCHECK(options);
-
- bool pref_value;
- if (prefs.GetBool(master_preferences::kMultiInstall, &pref_value) &&
- pref_value) {
- options->insert(kOptionMultiInstall);
- }
-}
-
-void ChromeAppHostOperations::ReadOptions(
- const base::CommandLine& uninstall_command,
- std::set<base::string16>* options) const {
- DCHECK(options);
-
- if (uninstall_command.HasSwitch(switches::kMultiInstall))
- options->insert(kOptionMultiInstall);
-}
-
-void ChromeAppHostOperations::AddKeyFiles(
- const std::set<base::string16>& options,
- std::vector<base::FilePath>* key_files) const {
-}
-
-void ChromeAppHostOperations::AddComDllList(
- const std::set<base::string16>& options,
- std::vector<base::FilePath>* com_dll_list) const {
-}
-
-void ChromeAppHostOperations::AppendProductFlags(
- const std::set<base::string16>& options,
- base::CommandLine* cmd_line) const {
- DCHECK(cmd_line);
- bool is_multi_install = options.find(kOptionMultiInstall) != options.end();
-
- // Non-multi-install not supported for the app host.
- DCHECK(is_multi_install);
-
- // Add --multi-install if it isn't already there.
- if (is_multi_install && !cmd_line->HasSwitch(switches::kMultiInstall))
- cmd_line->AppendSwitch(switches::kMultiInstall);
-
- // Add --app-launcher.
- cmd_line->AppendSwitch(switches::kChromeAppLauncher);
-}
-
-void ChromeAppHostOperations::AppendRenameFlags(
- const std::set<base::string16>& options,
- base::CommandLine* cmd_line) const {
- DCHECK(cmd_line);
- bool is_multi_install = options.find(kOptionMultiInstall) != options.end();
-
- // Non-multi-install not supported for the app host.
- DCHECK(is_multi_install);
-
- // Add --multi-install if it isn't already there.
- if (is_multi_install && !cmd_line->HasSwitch(switches::kMultiInstall))
- cmd_line->AppendSwitch(switches::kMultiInstall);
-}
-
-bool ChromeAppHostOperations::SetChannelFlags(
- const std::set<base::string16>& options,
- bool set,
- ChannelInfo* channel_info) const {
-#if defined(GOOGLE_CHROME_BUILD)
- DCHECK(channel_info);
- return channel_info->SetAppLauncher(set);
-#else
- return false;
-#endif
-}
-
-bool ChromeAppHostOperations::ShouldCreateUninstallEntry(
- const std::set<base::string16>& options) const {
- return true;
-}
-
-void ChromeAppHostOperations::AddDefaultShortcutProperties(
- BrowserDistribution* dist,
- const base::FilePath& target_exe,
- ShellUtil::ShortcutProperties* properties) const {
- if (!properties->has_target())
- properties->set_target(target_exe);
-
- if (!properties->has_arguments()) {
- base::CommandLine app_host_args(base::CommandLine::NO_PROGRAM);
- app_host_args.AppendSwitch(::switches::kShowAppList);
- properties->set_arguments(app_host_args.GetCommandLineString());
- }
-
- if (!properties->has_icon())
- properties->set_icon(target_exe,
- dist->GetIconIndex(BrowserDistribution::SHORTCUT_APP_LAUNCHER));
-
- if (!properties->has_app_id()) {
- std::vector<base::string16> components;
- components.push_back(dist->GetBaseAppId());
- properties->set_app_id(ShellUtil::BuildAppModelId(components));
- }
-}
-
-void ChromeAppHostOperations::LaunchUserExperiment(
- const base::FilePath& setup_path,
- const std::set<base::string16>& options,
- InstallStatus status,
- bool system_level) const {
- // No experiments yet. If adding some in the future, need to have
- // ChromeAppHostDistribution::HasUserExperiments() return true.
- NOTREACHED();
-}
-
-} // namespace installer
diff --git a/chrome/installer/util/chrome_app_host_operations.h b/chrome/installer/util/chrome_app_host_operations.h
deleted file mode 100644
index dc9f098..0000000
--- a/chrome/installer/util/chrome_app_host_operations.h
+++ /dev/null
@@ -1,63 +0,0 @@
-// Copyright (c) 2012 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.
-
-#ifndef CHROME_INSTALLER_UTIL_CHROME_APP_HOST_OPERATIONS_H_
-#define CHROME_INSTALLER_UTIL_CHROME_APP_HOST_OPERATIONS_H_
-
-#include "base/basictypes.h"
-#include "base/compiler_specific.h"
-#include "chrome/installer/util/product_operations.h"
-
-namespace installer {
-
-// Operations specific to Chrome App Host; see ProductOperations for general
-// info.
-class ChromeAppHostOperations : public ProductOperations {
- public:
- ChromeAppHostOperations() {}
-
- virtual void ReadOptions(const MasterPreferences& prefs,
- std::set<base::string16>* options) const override;
-
- virtual void ReadOptions(const base::CommandLine& uninstall_command,
- std::set<base::string16>* options) const override;
-
- virtual void AddKeyFiles(
- const std::set<base::string16>& options,
- std::vector<base::FilePath>* key_files) const override;
-
- virtual void AddComDllList(
- const std::set<base::string16>& options,
- std::vector<base::FilePath>* com_dll_list) const override;
-
- virtual void AppendProductFlags(const std::set<base::string16>& options,
- base::CommandLine* cmd_line) const override;
-
- virtual void AppendRenameFlags(const std::set<base::string16>& options,
- base::CommandLine* cmd_line) const override;
-
- virtual bool SetChannelFlags(const std::set<base::string16>& options,
- bool set,
- ChannelInfo* channel_info) const override;
-
- virtual bool ShouldCreateUninstallEntry(
- const std::set<base::string16>& options) const override;
-
- virtual void AddDefaultShortcutProperties(
- BrowserDistribution* dist,
- const base::FilePath& target_exe,
- ShellUtil::ShortcutProperties* properties) const override;
-
- virtual void LaunchUserExperiment(const base::FilePath& setup_path,
- const std::set<base::string16>& options,
- InstallStatus status,
- bool system_level) const override;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(ChromeAppHostOperations);
-};
-
-} // namespace installer
-
-#endif // CHROME_INSTALLER_UTIL_CHROME_APP_HOST_OPERATIONS_H_
diff --git a/chrome/installer/util/chrome_browser_operations.cc b/chrome/installer/util/chrome_browser_operations.cc
index 431b2e1..133fa9f 100644
--- a/chrome/installer/util/chrome_browser_operations.cc
+++ b/chrome/installer/util/chrome_browser_operations.cc
@@ -88,7 +88,11 @@ bool ChromeBrowserOperations::SetChannelFlags(
ChannelInfo* channel_info) const {
#if defined(GOOGLE_CHROME_BUILD)
DCHECK(channel_info);
- return channel_info->SetChrome(set);
+ bool chrome_changed = channel_info->SetChrome(set);
+ // Remove App Launcher's channel flags, since App Launcher does not exist as
+ // an independent product, and is a part of Chrome.
+ bool app_launcher_changed = channel_info->SetAppLauncher(false);
+ return chrome_changed || app_launcher_changed;
#else
return false;
#endif
diff --git a/chrome/installer/util/eula_util.cc b/chrome/installer/util/eula_util.cc
deleted file mode 100644
index 12e0bf2..0000000
--- a/chrome/installer/util/eula_util.cc
+++ /dev/null
@@ -1,95 +0,0 @@
-// Copyright (c) 2013 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.
-
-#include "chrome/installer/util/eula_util.h"
-
-#include "base/files/file_util.h"
-#include "base/memory/scoped_ptr.h"
-#include "chrome/installer/util/browser_distribution.h"
-#include "chrome/installer/util/install_util.h"
-#include "chrome/installer/util/installation_state.h"
-#include "chrome/installer/util/master_preferences.h"
-#include "chrome/installer/util/master_preferences_constants.h"
-
-namespace installer {
-
-namespace {
-
-bool IsEULAAcceptanceFlagged(BrowserDistribution* dist) {
- // Chrome creates the EULA sentinel after the EULA has been accepted when
- // doing so is required by master_preferences. Assume the EULA has not been
- // accepted if the path to the sentinel cannot be determined.
- base::FilePath eula_sentinel;
- return InstallUtil::GetEULASentinelFilePath(&eula_sentinel) &&
- base::PathExists(eula_sentinel);
-}
-
-scoped_ptr<MasterPreferences> GetMasterPrefs(const ProductState& prod_state) {
- // The standard location of the master prefs is next to the chrome binary.
- base::FilePath master_prefs_path(
- prod_state.GetSetupPath().DirName().DirName().DirName());
- scoped_ptr<MasterPreferences> install_prefs(new MasterPreferences(
- master_prefs_path.AppendASCII(kDefaultMasterPrefs)));
- if (install_prefs && install_prefs->read_from_file())
- return install_prefs.Pass();
-
- return scoped_ptr<MasterPreferences>();
-}
-
-// Attempts to initialize |state| with any Chrome-related product.
-// Returns true if any of these product are installed, otherwise false.
-bool GetAnyChromeProductState(bool system_level, ProductState* state) {
- return state->Initialize(system_level, BrowserDistribution::CHROME_BROWSER)
- || state->Initialize(system_level, BrowserDistribution::CHROME_FRAME)
- || state->Initialize(system_level, BrowserDistribution::CHROME_APP_HOST);
-}
-
-} // namespace
-
-EULAAcceptanceResponse IsEULAAccepted(bool system_level) {
- ProductState prod_state;
-
- if (!system_level) { // User-level case has seprate flow.
- // Do not simply check Chrome binaries. Instead, check whether or not
- // any Chrome-related products is installed, because the presence of any of
- // these products at user-level implies that the EULA has been accepted.
- return GetAnyChromeProductState(false, &prod_state)
- ? QUERY_EULA_ACCEPTED : QUERY_EULA_NOT_ACCEPTED;
- }
-
- // System-level. Try to use Chrome binaries product state.
- if (!prod_state.Initialize(true, BrowserDistribution::CHROME_BINARIES)) {
- // Fall back to Chrome Browser product state only.
- if (!prod_state.Initialize(true, BrowserDistribution::CHROME_BROWSER))
- return QUERY_EULA_FAIL;
-
- LOG_IF(DFATAL, prod_state.is_multi_install())
- << "Binaries are not installed, but Chrome is multi-install.";
- }
- BrowserDistribution* dist = BrowserDistribution::GetSpecificDistribution(
- BrowserDistribution::CHROME_BROWSER);
-
- // Is Google Update waiting for Chrome's EULA to be accepted?
- DWORD eula_accepted = 0;
- if (prod_state.GetEulaAccepted(&eula_accepted) && !eula_accepted)
- return QUERY_EULA_NOT_ACCEPTED;
-
- if (InstallUtil::IsFirstRunSentinelPresent() || IsEULAAcceptanceFlagged(dist))
- return QUERY_EULA_ACCEPTED;
-
- // EULA acceptance not flagged. Now see if it is required.
- scoped_ptr<MasterPreferences> install_prefs(GetMasterPrefs(prod_state));
- // If we fail to get master preferences, assume that EULA is not required.
- if (!install_prefs)
- return QUERY_EULA_ACCEPTED;
-
- bool eula_required = false;
- // If kRequireEula value is absent, assume EULA is not required.
- if (!install_prefs->GetBool(master_preferences::kRequireEula, &eula_required))
- return QUERY_EULA_ACCEPTED;
-
- return eula_required ? QUERY_EULA_NOT_ACCEPTED : QUERY_EULA_ACCEPTED;
-}
-
-} // namespace installer
diff --git a/chrome/installer/util/eula_util.h b/chrome/installer/util/eula_util.h
deleted file mode 100644
index 7888c09..0000000
--- a/chrome/installer/util/eula_util.h
+++ /dev/null
@@ -1,25 +0,0 @@
-// Copyright (c) 2013 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.
-//
-// This file contains helper functions to read the Chrome EULA.
-
-#ifndef CHROME_INSTALLER_UTIL_EULA_UTIL_H_
-#define CHROME_INSTALLER_UTIL_EULA_UTIL_H_
-
-namespace installer {
-
-enum EULAAcceptanceResponse{
- QUERY_EULA_FAIL = -1,
- QUERY_EULA_NOT_ACCEPTED = 0,
- QUERY_EULA_ACCEPTED = 1,
-};
-
-// Performs a comprehensive test on EULA acceptance in Chrome.
-// This is mostly intended for system-level Chrome, although it also supports
-// user-level Chrome (should return QUERY_EULA_ACCEPTED).
-EULAAcceptanceResponse IsEULAAccepted(bool system_level);
-
-} // namespace installer
-
-#endif // CHROME_INSTALLER_UTIL_EULA_UTIL_H_
diff --git a/chrome/installer/util/google_chrome_distribution.cc b/chrome/installer/util/google_chrome_distribution.cc
index 12b1268..102f163 100644
--- a/chrome/installer/util/google_chrome_distribution.cc
+++ b/chrome/installer/util/google_chrome_distribution.cc
@@ -256,10 +256,6 @@ bool GoogleChromeDistribution::GetCommandExecuteImplClsid(
return true;
}
-bool GoogleChromeDistribution::AppHostIsSupported() {
- return true;
-}
-
// This method checks if we need to change "ap" key in Google Update to try
// full installer as fall back method in case incremental installer fails.
// - If incremental installer fails we append a magic string ("-full"), if
diff --git a/chrome/installer/util/google_chrome_distribution.h b/chrome/installer/util/google_chrome_distribution.h
index c63e135..d6611ba 100644
--- a/chrome/installer/util/google_chrome_distribution.h
+++ b/chrome/installer/util/google_chrome_distribution.h
@@ -72,8 +72,6 @@ class GoogleChromeDistribution : public BrowserDistribution {
virtual bool GetCommandExecuteImplClsid(
base::string16* handler_class_uuid) override;
- virtual bool AppHostIsSupported() override;
-
virtual void UpdateInstallStatus(
bool system_install,
installer::ArchiveType archive_type,
diff --git a/chrome/installer/util/google_chrome_distribution_dummy.cc b/chrome/installer/util/google_chrome_distribution_dummy.cc
index 86016bd1..126eeff 100644
--- a/chrome/installer/util/google_chrome_distribution_dummy.cc
+++ b/chrome/installer/util/google_chrome_distribution_dummy.cc
@@ -106,10 +106,6 @@ bool GoogleChromeDistribution::GetCommandExecuteImplClsid(
return false;
}
-bool GoogleChromeDistribution::AppHostIsSupported() {
- return false;
-}
-
void GoogleChromeDistribution::UpdateInstallStatus(bool system_install,
installer::ArchiveType archive_type,
installer::InstallStatus install_status) {
diff --git a/chrome/installer/util/google_chrome_sxs_distribution.cc b/chrome/installer/util/google_chrome_sxs_distribution.cc
index cd61cbd..f4a3c3b 100644
--- a/chrome/installer/util/google_chrome_sxs_distribution.cc
+++ b/chrome/installer/util/google_chrome_sxs_distribution.cc
@@ -110,10 +110,6 @@ bool GoogleChromeSxSDistribution::GetCommandExecuteImplClsid(
return true;
}
-bool GoogleChromeSxSDistribution::AppHostIsSupported() {
- return false;
-}
-
bool GoogleChromeSxSDistribution::ShouldSetExperimentLabels() {
return true;
}
diff --git a/chrome/installer/util/google_chrome_sxs_distribution.h b/chrome/installer/util/google_chrome_sxs_distribution.h
index 94d7b60..c1be524 100644
--- a/chrome/installer/util/google_chrome_sxs_distribution.h
+++ b/chrome/installer/util/google_chrome_sxs_distribution.h
@@ -33,7 +33,6 @@ class GoogleChromeSxSDistribution : public GoogleChromeDistribution {
virtual bool GetChromeChannel(base::string16* channel) override;
virtual bool GetCommandExecuteImplClsid(
base::string16* handler_class_uuid) override;
- virtual bool AppHostIsSupported() override;
virtual bool ShouldSetExperimentLabels() override;
virtual bool HasUserExperiments() override;
// returns the channel name for GoogleChromeSxSDistribution
diff --git a/chrome/installer/util/installation_state.cc b/chrome/installer/util/installation_state.cc
index 3c62306..645738d 100644
--- a/chrome/installer/util/installation_state.cc
+++ b/chrome/installer/util/installation_state.cc
@@ -227,12 +227,9 @@ int InstallationState::IndexFromDistType(BrowserDistribution::Type type) {
unexpected_chrome_frame_distribution_value_);
COMPILE_ASSERT(BrowserDistribution::CHROME_BINARIES == CHROME_BINARIES_INDEX,
unexpected_chrome_frame_distribution_value_);
- COMPILE_ASSERT(BrowserDistribution::CHROME_APP_HOST == CHROME_APP_HOST_INDEX,
- unexpected_chrome_frame_distribution_value_);
DCHECK(type == BrowserDistribution::CHROME_BROWSER ||
type == BrowserDistribution::CHROME_FRAME ||
- type == BrowserDistribution::CHROME_BINARIES ||
- type == BrowserDistribution::CHROME_APP_HOST);
+ type == BrowserDistribution::CHROME_BINARIES);
return type;
}
@@ -253,11 +250,6 @@ void InstallationState::Initialize() {
BrowserDistribution::CHROME_BINARIES);
user_products_[CHROME_BINARIES_INDEX].Initialize(false, distribution);
system_products_[CHROME_BINARIES_INDEX].Initialize(true, distribution);
-
- distribution = BrowserDistribution::GetSpecificDistribution(
- BrowserDistribution::CHROME_APP_HOST);
- user_products_[CHROME_APP_HOST_INDEX].Initialize(false, distribution);
- system_products_[CHROME_APP_HOST_INDEX].Initialize(true, distribution);
}
const ProductState* InstallationState::GetNonVersionedProductState(
diff --git a/chrome/installer/util/installation_state.h b/chrome/installer/util/installation_state.h
index 28630cc..85cefb0 100644
--- a/chrome/installer/util/installation_state.h
+++ b/chrome/installer/util/installation_state.h
@@ -154,7 +154,6 @@ class InstallationState {
CHROME_BROWSER_INDEX,
CHROME_FRAME_INDEX,
CHROME_BINARIES_INDEX,
- CHROME_APP_HOST_INDEX,
NUM_PRODUCTS
};
diff --git a/chrome/installer/util/installation_validator.cc b/chrome/installer/util/installation_validator.cc
index b8812d3..5c0e25f 100644
--- a/chrome/installer/util/installation_validator.cc
+++ b/chrome/installer/util/installation_validator.cc
@@ -87,38 +87,6 @@ bool InstallationValidator::ChromeFrameRules::UsageStatsAllowed(
}
BrowserDistribution::Type
- InstallationValidator::ChromeAppHostRules::distribution_type() const {
- return BrowserDistribution::CHROME_APP_HOST;
-}
-
-void InstallationValidator::ChromeAppHostRules::AddUninstallSwitchExpectations(
- const ProductContext& ctx,
- SwitchExpectations* expectations) const {
- // --app-launcher must be present.
- expectations->push_back(
- std::make_pair(std::string(switches::kChromeAppLauncher), true));
-
- // --chrome must not be present.
- expectations->push_back(std::make_pair(std::string(switches::kChrome),
- false));
- // --chrome-frame must not be present.
- expectations->push_back(std::make_pair(std::string(switches::kChromeFrame),
- false));
-}
-
-void InstallationValidator::ChromeAppHostRules::AddRenameSwitchExpectations(
- const ProductContext& ctx,
- SwitchExpectations* expectations) const {
- // TODO(erikwright): I guess there will be none?
-}
-
-bool InstallationValidator::ChromeAppHostRules::UsageStatsAllowed(
- const ProductContext& ctx) const {
- // App Host doesn't manage usage stats. The Chrome Binaries will.
- return false;
-}
-
-BrowserDistribution::Type
InstallationValidator::ChromeBinariesRules::distribution_type() const {
return BrowserDistribution::CHROME_BINARIES;
}
@@ -152,12 +120,6 @@ const InstallationValidator::InstallationType
CHROME_FRAME_SINGLE_CHROME_MULTI,
CHROME_FRAME_MULTI,
CHROME_FRAME_MULTI_CHROME_MULTI,
- CHROME_APP_HOST,
- CHROME_APP_HOST_CHROME_FRAME_SINGLE,
- CHROME_APP_HOST_CHROME_FRAME_SINGLE_CHROME_MULTI,
- CHROME_APP_HOST_CHROME_FRAME_MULTI,
- CHROME_APP_HOST_CHROME_FRAME_MULTI_CHROME_MULTI,
- CHROME_APP_HOST_CHROME_MULTI,
};
void InstallationValidator::ValidateAppCommandFlags(
@@ -225,66 +187,6 @@ void InstallationValidator::ValidateOnOsUpgradeCommand(
ValidateAppCommandFlags(ctx, app_cmd, flags_exp, name, is_valid);
}
-// Validates the "query-eula-acceptance" Google Update product command.
-void InstallationValidator::ValidateQueryEULAAcceptanceCommand(
- const ProductContext& ctx,
- const AppCommand& app_cmd,
- bool* is_valid) {
- DCHECK(is_valid);
-
- base::CommandLine cmd_line(
- base::CommandLine::FromString(app_cmd.command_line()));
- base::string16 name(kCmdQueryEULAAcceptance);
-
- ValidateSetupPath(ctx, cmd_line.GetProgram(), name, is_valid);
-
- SwitchExpectations expected;
- expected.push_back(std::make_pair(std::string(switches::kQueryEULAAcceptance),
- true));
- expected.push_back(std::make_pair(std::string(switches::kSystemLevel),
- ctx.system_install));
-
- ValidateCommandExpectations(ctx, cmd_line, expected, name, is_valid);
-
- std::set<base::string16> flags_exp;
- flags_exp.insert(google_update::kRegWebAccessibleField);
- flags_exp.insert(google_update::kRegRunAsUserField);
- ValidateAppCommandFlags(ctx, app_cmd, flags_exp, name, is_valid);
-}
-
-// Validates the "quick-enable-application-host" Google Update product command.
-void InstallationValidator::ValidateQuickEnableApplicationHostCommand(
- const ProductContext& ctx,
- const AppCommand& app_cmd,
- bool* is_valid) {
- DCHECK(is_valid);
-
- base::CommandLine cmd_line(
- base::CommandLine::FromString(app_cmd.command_line()));
- base::string16 name(kCmdQuickEnableApplicationHost);
-
- ValidateSetupPath(ctx, cmd_line.GetProgram(), name, is_valid);
-
- SwitchExpectations expected;
-
- expected.push_back(std::make_pair(
- std::string(switches::kChromeAppLauncher), true));
- expected.push_back(std::make_pair(
- std::string(switches::kSystemLevel), false));
- expected.push_back(std::make_pair(
- std::string(switches::kMultiInstall), true));
- expected.push_back(std::make_pair(
- std::string(switches::kEnsureGoogleUpdatePresent), true));
-
- ValidateCommandExpectations(ctx, cmd_line, expected, name, is_valid);
-
- std::set<base::string16> flags_exp;
- flags_exp.insert(google_update::kRegSendsPingsField);
- flags_exp.insert(google_update::kRegWebAccessibleField);
- flags_exp.insert(google_update::kRegRunAsUserField);
- ValidateAppCommandFlags(ctx, app_cmd, flags_exp, name, is_valid);
-}
-
// Validates a product's set of Google Update product commands against a
// collection of expectations.
void InstallationValidator::ValidateAppCommandExpectations(
@@ -325,27 +227,6 @@ void InstallationValidator::ValidateAppCommandExpectations(
}
}
-// Validates the multi-install binaries' Google Update commands.
-void InstallationValidator::ValidateBinariesCommands(
- const ProductContext& ctx,
- bool* is_valid) {
- DCHECK(is_valid);
-
- const ProductState* binaries_state = ctx.machine_state.GetProductState(
- ctx.system_install, BrowserDistribution::CHROME_BINARIES);
-
- CommandExpectations expectations;
-
- if (binaries_state != NULL) {
- expectations[kCmdQuickEnableApplicationHost] =
- &ValidateQuickEnableApplicationHostCommand;
-
- expectations[kCmdQueryEULAAcceptance] = &ValidateQueryEULAAcceptanceCommand;
- }
-
- ValidateAppCommandExpectations(ctx, expectations, is_valid);
-}
-
// Validates the multi-install binaries at level |system_level|.
void InstallationValidator::ValidateBinaries(
const InstallationState& machine_state,
@@ -392,32 +273,13 @@ void InstallationValidator::ValidateBinaries(
<< "\"";
}
- // ap must have -applauncher iff Chrome App Launcher is installed multi
- const ProductState* app_host_state = machine_state.GetProductState(
- system_install, BrowserDistribution::CHROME_APP_HOST);
- if (app_host_state != NULL) {
- if (!app_host_state->is_multi_install()) {
- *is_valid = false;
- LOG(ERROR) << "Chrome App Launcher is installed in non-multi mode.";
- }
- if (!channel.IsAppLauncher()) {
- *is_valid = false;
- LOG(ERROR) << "Chrome Binaries are missing \"-applauncher\" in channel"
- " name: \"" << channel.value() << "\"";
- }
- } else if (channel.IsAppLauncher()) {
- *is_valid = false;
- LOG(ERROR) << "Chrome Binaries have \"-applauncher\" in channel name, yet "
- "Chrome App Launcher is not installed: \"" << channel.value()
- << "\"";
- }
-
- // Chrome, Chrome Frame, or App Host must be present
- if (chrome_state == NULL && cf_state == NULL && app_host_state == NULL) {
+ // Chrome or Chrome Frame must be present
+ if (chrome_state == NULL && cf_state == NULL) {
*is_valid = false;
LOG(ERROR) << "Chrome Binaries are present with no other products.";
}
+
// Chrome must be multi-install if present.
if (chrome_state != NULL && !chrome_state->is_multi_install()) {
*is_valid = false;
@@ -425,20 +287,18 @@ void InstallationValidator::ValidateBinaries(
<< "Chrome Binaries are present yet Chrome is not multi-install.";
}
- // Chrome Frame must be multi-install if Chrome & App Host are not present.
- if (cf_state != NULL && app_host_state == NULL && chrome_state == NULL &&
+ // Chrome Frame must be multi-install if Chrome is not present.
+ if (cf_state != NULL && chrome_state == NULL &&
!cf_state->is_multi_install()) {
*is_valid = false;
- LOG(ERROR) << "Chrome Binaries are present without Chrome nor App Launcher "
- << "yet Chrome Frame is not multi-install.";
+ LOG(ERROR) << "Chrome Binaries are present without Chrome, yet Chrome Frame"
+ << " is not multi-install.";
}
ChromeBinariesRules binaries_rules;
ProductContext ctx(machine_state, system_install, binaries_state,
binaries_rules);
- ValidateBinariesCommands(ctx, is_valid);
-
ValidateUsageStats(ctx, is_valid);
}
@@ -578,25 +438,10 @@ void InstallationValidator::ValidateMultiInstallProduct(
ctx.machine_state.GetProductState(ctx.system_install,
BrowserDistribution::CHROME_BINARIES);
if (!binaries) {
- if (ctx.dist->GetType() == BrowserDistribution::CHROME_APP_HOST) {
- if (!ctx.machine_state.GetProductState(
- true, // system-level
- BrowserDistribution::CHROME_BINARIES) &&
- !ctx.machine_state.GetProductState(
- true, // system-level
- BrowserDistribution::CHROME_BROWSER)) {
- *is_valid = false;
- LOG(ERROR) << ctx.dist->GetDisplayName()
- << " (" << ctx.state.version().GetString() << ") is "
- << "installed without Chrome Binaries or a system-level "
- << "Chrome.";
- }
- } else {
- *is_valid = false;
- LOG(ERROR) << ctx.dist->GetDisplayName()
- << " (" << ctx.state.version().GetString() << ") is installed "
- << "without Chrome Binaries.";
- }
+ *is_valid = false;
+ LOG(ERROR) << ctx.dist->GetDisplayName()
+ << " (" << ctx.state.version().GetString() << ") is installed "
+ << "without Chrome Binaries.";
} else {
// Version must match that of binaries.
if (ctx.state.version().CompareTo(binaries->version()) != 0) {
@@ -721,21 +566,6 @@ bool InstallationValidator::ValidateInstallationTypeForState(
*type = static_cast<InstallationType>(*type | cf_bit);
}
- // Is Chrome App Host installed?
- product_state =
- machine_state.GetProductState(system_level,
- BrowserDistribution::CHROME_APP_HOST);
- if (product_state != NULL) {
- ChromeAppHostRules chrome_app_host_rules;
- ValidateProduct(machine_state, system_level, *product_state,
- chrome_app_host_rules, &rock_on);
- *type = static_cast<InstallationType>(*type | ProductBits::CHROME_APP_HOST);
- if (!product_state->is_multi_install()) {
- LOG(ERROR) << "Chrome App Launcher must always be multi-install.";
- rock_on = false;
- }
- }
-
DCHECK_NE(std::find(&kInstallationTypes[0],
&kInstallationTypes[arraysize(kInstallationTypes)],
*type),
diff --git a/chrome/installer/util/installation_validator.h b/chrome/installer/util/installation_validator.h
index 087824a..28e7a83 100644
--- a/chrome/installer/util/installation_validator.h
+++ b/chrome/installer/util/installation_validator.h
@@ -38,7 +38,6 @@ class InstallationValidator {
CHROME_MULTI = 0x02,
CHROME_FRAME_SINGLE = 0x04,
CHROME_FRAME_MULTI = 0x08,
- CHROME_APP_HOST = 0x10,
};
}; // class ProductBits
@@ -59,20 +58,6 @@ class InstallationValidator {
ProductBits::CHROME_FRAME_MULTI,
CHROME_FRAME_MULTI_CHROME_MULTI =
ProductBits::CHROME_FRAME_MULTI | ProductBits::CHROME_MULTI,
- CHROME_APP_HOST =
- ProductBits::CHROME_APP_HOST,
- CHROME_APP_HOST_CHROME_FRAME_SINGLE =
- ProductBits::CHROME_APP_HOST | ProductBits::CHROME_FRAME_SINGLE,
- CHROME_APP_HOST_CHROME_FRAME_SINGLE_CHROME_MULTI =
- ProductBits::CHROME_APP_HOST | ProductBits::CHROME_FRAME_SINGLE |
- ProductBits::CHROME_MULTI,
- CHROME_APP_HOST_CHROME_FRAME_MULTI =
- ProductBits::CHROME_APP_HOST | ProductBits::CHROME_FRAME_MULTI,
- CHROME_APP_HOST_CHROME_FRAME_MULTI_CHROME_MULTI =
- ProductBits::CHROME_APP_HOST | ProductBits::CHROME_FRAME_MULTI |
- ProductBits::CHROME_MULTI,
- CHROME_APP_HOST_CHROME_MULTI =
- ProductBits::CHROME_APP_HOST | ProductBits::CHROME_MULTI,
};
// Validates |machine_state| at user or system level, returning true if valid.
@@ -137,19 +122,6 @@ class InstallationValidator {
virtual bool UsageStatsAllowed(const ProductContext& ctx) const override;
};
- // Validation rules for Chrome App Host.
- class ChromeAppHostRules : public ProductRules {
- public:
- virtual BrowserDistribution::Type distribution_type() const override;
- virtual void AddUninstallSwitchExpectations(
- const ProductContext& ctx,
- SwitchExpectations* expectations) const override;
- virtual void AddRenameSwitchExpectations(
- const ProductContext& ctx,
- SwitchExpectations* expectations) const override;
- virtual bool UsageStatsAllowed(const ProductContext& ctx) const override;
- };
-
// Validation rules for the multi-install Chrome binaries.
class ChromeBinariesRules : public ProductRules {
public:
@@ -195,20 +167,10 @@ class InstallationValidator {
static void ValidateOnOsUpgradeCommand(const ProductContext& ctx,
const AppCommand& app_cmd,
bool* is_valid);
- static void ValidateQueryEULAAcceptanceCommand(const ProductContext& ctx,
- const AppCommand& app_cmd,
- bool* is_valid);
- static void ValidateQuickEnableApplicationHostCommand(
- const ProductContext& ctx,
- const AppCommand& app_cmd,
- bool* is_valid);
-
static void ValidateAppCommandExpectations(
const ProductContext& ctx,
const CommandExpectations& expectations,
bool* is_valid);
- static void ValidateBinariesCommands(const ProductContext& ctx,
- bool* is_valid);
static void ValidateBinaries(const InstallationState& machine_state,
bool system_install,
const ProductState& binaries_state,
diff --git a/chrome/installer/util/installation_validator_unittest.cc b/chrome/installer/util/installation_validator_unittest.cc
index ca12e2d..ae015ff 100644
--- a/chrome/installer/util/installation_validator_unittest.cc
+++ b/chrome/installer/util/installation_validator_unittest.cc
@@ -82,14 +82,6 @@ class FakeProductState : public ProductState {
Level install_level,
const char* version,
int channel_modifiers);
- void AddQueryEULAAcceptanceCommand(BrowserDistribution::Type dist_type,
- Level install_level,
- const char* version,
- int channel_modifiers);
- void AddQuickEnableApplicationHostCommand(BrowserDistribution::Type dist_type,
- Level install_level,
- const char* version,
- int channel_modifiers);
void set_multi_install(bool is_multi_install) {
multi_install_ = is_multi_install;
}
@@ -229,47 +221,6 @@ void FakeProductState::AddOsUpgradeCommand(BrowserDistribution::Type dist_type,
commands_.Set(installer::kCmdOnOsUpgrade, app_cmd);
}
-// Adds the "query-eula-acceptance" Google Update product command.
-void FakeProductState::AddQueryEULAAcceptanceCommand(
- BrowserDistribution::Type dist_type,
- Level install_level,
- const char* version,
- int channel_modifiers) {
- DCHECK_EQ(dist_type, BrowserDistribution::CHROME_BINARIES);
-
- base::CommandLine cmd_line(
- GetSetupExePath(dist_type, install_level, version, channel_modifiers));
- cmd_line.AppendSwitch(installer::switches::kQueryEULAAcceptance);
- if (install_level == SYSTEM_LEVEL)
- cmd_line.AppendSwitch(installer::switches::kSystemLevel);
- cmd_line.AppendSwitch(installer::switches::kVerboseLogging);
- AppCommand app_cmd(cmd_line.GetCommandLineString());
- app_cmd.set_is_web_accessible(true);
- app_cmd.set_is_run_as_user(true);
- commands_.Set(installer::kCmdQueryEULAAcceptance, app_cmd);
-}
-
-// Adds the "quick-enable-application-host" Google Update product command.
-void FakeProductState::AddQuickEnableApplicationHostCommand(
- BrowserDistribution::Type dist_type,
- Level install_level,
- const char* version,
- int channel_modifiers) {
- DCHECK_EQ(dist_type, BrowserDistribution::CHROME_BINARIES);
- DCHECK_NE(channel_modifiers & CM_MULTI, 0);
-
- base::CommandLine cmd_line(
- GetSetupExePath(dist_type, install_level, version, channel_modifiers));
- cmd_line.AppendSwitch(installer::switches::kMultiInstall);
- cmd_line.AppendSwitch(installer::switches::kChromeAppLauncher);
- cmd_line.AppendSwitch(installer::switches::kEnsureGoogleUpdatePresent);
- AppCommand app_cmd(cmd_line.GetCommandLineString());
- app_cmd.set_sends_pings(true);
- app_cmd.set_is_web_accessible(true);
- app_cmd.set_is_run_as_user(true);
- commands_.Set(installer::kCmdQuickEnableApplicationHost, app_cmd);
-}
-
} // namespace
// Fixture for testing the InstallationValidator. Errors logged by the
@@ -451,18 +402,6 @@ void InstallationValidatorTest::MakeProductState(
state->SetUninstallCommand(prod_type, install_level, chrome::kChromeVersion,
channel_modifiers, vehicle);
state->set_multi_install(is_multi_install);
- if (prod_type == BrowserDistribution::CHROME_BINARIES) {
- state->AddQueryEULAAcceptanceCommand(prod_type,
- install_level,
- chrome::kChromeVersion,
- channel_modifiers);
- }
- if (prod_type == BrowserDistribution::CHROME_BINARIES) {
- state->AddQuickEnableApplicationHostCommand(prod_type,
- install_level,
- chrome::kChromeVersion,
- channel_modifiers);
- }
if (prod_type == BrowserDistribution::CHROME_BROWSER) {
state->AddOsUpgradeCommand(prod_type,
install_level,
diff --git a/chrome/installer/util/installer_state.cc b/chrome/installer/util/installer_state.cc
index 520fd58..5488d83 100644
--- a/chrome/installer/util/installer_state.cc
+++ b/chrome/installer/util/installer_state.cc
@@ -70,8 +70,7 @@ InstallerState::InstallerState()
package_type_(UNKNOWN_PACKAGE_TYPE),
root_key_(NULL),
msi_(false),
- verbose_logging_(false),
- ensure_google_update_present_(false) {
+ verbose_logging_(false) {
}
InstallerState::InstallerState(Level level)
@@ -82,8 +81,7 @@ InstallerState::InstallerState(Level level)
package_type_(UNKNOWN_PACKAGE_TYPE),
root_key_(NULL),
msi_(false),
- verbose_logging_(false),
- ensure_google_update_present_(false) {
+ verbose_logging_(false) {
// Use set_level() so that root_key_ is updated properly.
set_level(level);
}
@@ -108,9 +106,6 @@ void InstallerState::Initialize(const base::CommandLine& command_line,
if (!prefs.GetBool(master_preferences::kMsi, &msi_))
msi_ = false;
- ensure_google_update_present_ =
- command_line.HasSwitch(installer::switches::kEnsureGoogleUpdatePresent);
-
const bool is_uninstall = command_line.HasSwitch(switches::kUninstall);
if (prefs.install_chrome()) {
@@ -120,141 +115,15 @@ void InstallerState::Initialize(const base::CommandLine& command_line,
<< " distribution: " << p->distribution()->GetDisplayName();
}
- if (prefs.install_chrome_app_launcher()) {
+ // Binaries are only used by Chrome.
+ if (is_multi_install() &&
+ FindProduct(BrowserDistribution::CHROME_BROWSER)) {
Product* p = AddProductFromPreferences(
- BrowserDistribution::CHROME_APP_HOST, prefs, machine_state);
+ BrowserDistribution::CHROME_BINARIES, prefs, machine_state);
VLOG(1) << (is_uninstall ? "Uninstall" : "Install")
<< " distribution: " << p->distribution()->GetDisplayName();
}
- if (!is_uninstall && is_multi_install()) {
- bool need_binaries = false;
- if (FindProduct(BrowserDistribution::CHROME_APP_HOST)) {
- // App Host will happily use Chrome at system level, or binaries at system
- // level, even if app host is user level.
- const ProductState* chrome_state = machine_state.GetProductState(
- true, // system level
- BrowserDistribution::CHROME_BROWSER);
- // If Chrome is at system-level, multi- or otherwise. We'll use it.
- if (!chrome_state) {
- const ProductState* binaries_state = machine_state.GetProductState(
- true, // system level
- BrowserDistribution::CHROME_BINARIES);
- if (!binaries_state)
- need_binaries = true;
- }
- }
-
- // Chrome multi needs Binaries at its own level.
- if (FindProduct(BrowserDistribution::CHROME_BROWSER))
- need_binaries = true;
-
- if (need_binaries && !FindProduct(BrowserDistribution::CHROME_BINARIES)) {
- // Force binaries to be installed/updated.
- Product* p = AddProductFromPreferences(
- BrowserDistribution::CHROME_BINARIES, prefs, machine_state);
- VLOG(1) << "Install distribution: "
- << p->distribution()->GetDisplayName();
- }
- }
-
- if (is_uninstall && prefs.is_multi_install()) {
- if (FindProduct(BrowserDistribution::CHROME_BROWSER)) {
- // Uninstall each product of type |type| listed below based on the
- // presence or absence of |switch_name| in that product's uninstall
- // command.
- const struct {
- BrowserDistribution::Type type;
- const char* switch_name;
- bool switch_expected;
- } conditional_additions[] = {
- // If the App Host is installed, but not the App Launcher, remove it
- // with Chrome. Note however that for system-level Chrome uninstalls,
- // any installed user-level App Host will remain even if there is no
- // App Launcher present (the orphaned app_host.exe will prompt the user
- // for further action when executed).
- { BrowserDistribution::CHROME_APP_HOST,
- switches::kChromeAppLauncher,
- false },
- };
-
- for (size_t i = 0; i < arraysize(conditional_additions); ++i) {
- const ProductState* product_state = machine_state.GetProductState(
- system_install(), conditional_additions[i].type);
- if (product_state != NULL &&
- product_state->uninstall_command().HasSwitch(
- conditional_additions[i].switch_name) ==
- conditional_additions[i].switch_expected &&
- !FindProduct(conditional_additions[i].type)) {
- Product* p = AddProductFromPreferences(
- conditional_additions[i].type, prefs, machine_state);
- VLOG(1) << "Uninstall distribution: "
- << p->distribution()->GetDisplayName();
- }
- }
- }
-
- bool keep_binaries = false;
- // Look for a multi-install product that is not the binaries and that is not
- // being uninstalled. If not found, binaries are uninstalled too.
- for (size_t i = 0; i < BrowserDistribution::NUM_TYPES; ++i) {
- BrowserDistribution::Type type =
- static_cast<BrowserDistribution::Type>(i);
-
- if (type == BrowserDistribution::CHROME_BINARIES)
- continue;
-
- const ProductState* product_state =
- machine_state.GetProductState(system_install(), type);
- if (product_state == NULL) {
- // The product is not installed.
- continue;
- }
-
- if (!product_state->is_multi_install() &&
- type != BrowserDistribution::CHROME_BROWSER) {
- // The product is not sharing the binaries. It is ordinarily impossible
- // for single-install Chrome to be installed along with any
- // multi-install product. Treat single-install Chrome the same as any
- // multi-install product just in case the impossible happens.
- continue;
- }
-
- // The product is installed.
-
- if (!FindProduct(type)) {
- // The product is not being uninstalled.
- if (type != BrowserDistribution::CHROME_APP_HOST) {
- keep_binaries = true;
- break;
- } else {
- // If binaries/chrome are at system-level, we can discard them at
- // user-level...
- if (!machine_state.GetProductState(
- true, // system-level
- BrowserDistribution::CHROME_BROWSER) &&
- !machine_state.GetProductState(
- true, // system-level
- BrowserDistribution::CHROME_BINARIES)) {
- // ... otherwise keep them.
- keep_binaries = true;
- break;
- }
- }
- }
-
- // The product is being uninstalled.
- }
- if (!keep_binaries &&
- machine_state.GetProductState(system_install(),
- BrowserDistribution::CHROME_BINARIES)) {
- Product* p = AddProductFromPreferences(
- BrowserDistribution::CHROME_BINARIES, prefs, machine_state);
- VLOG(1) << (is_uninstall ? "Uninstall" : "Install")
- << " distribution: " << p->distribution()->GetDisplayName();
- }
- }
-
BrowserDistribution* operand = NULL;
if (is_uninstall) {
@@ -272,18 +141,13 @@ void InstallerState::Initialize(const base::CommandLine& command_line,
operation_ = MULTI_INSTALL;
}
- // Initial, over, and un-installs will take place under one of the product app
- // guids (Chrome, App Host, or Binaries, in order of preference).
+ // Initial, over, and un-installs will take place under Chrome or Binaries
+ // app guid.
if (operand == NULL) {
- BrowserDistribution::Type operand_distribution_type =
- BrowserDistribution::CHROME_BINARIES;
- if (prefs.install_chrome())
- operand_distribution_type = BrowserDistribution::CHROME_BROWSER;
- else if (prefs.install_chrome_app_launcher())
- operand_distribution_type = BrowserDistribution::CHROME_APP_HOST;
-
operand = BrowserDistribution::GetSpecificDistribution(
- operand_distribution_type);
+ prefs.install_chrome() ?
+ BrowserDistribution::CHROME_BROWSER :
+ BrowserDistribution::CHROME_BINARIES);
}
state_key_ = operand->GetStateKey();
@@ -606,7 +470,6 @@ void InstallerState::Clear() {
root_key_ = NULL;
msi_ = false;
verbose_logging_ = false;
- ensure_google_update_present_ = false;
}
bool InstallerState::AnyExistsAndIsInUse(
diff --git a/chrome/installer/util/installer_state.h b/chrome/installer/util/installer_state.h
index 7b22cf6..e9306d8 100644
--- a/chrome/installer/util/installer_state.h
+++ b/chrome/installer/util/installer_state.h
@@ -113,12 +113,6 @@ class InstallerState {
// TODO(grt): Eradicate the bool in favor of the enum.
bool is_multi_install() const;
- // A convenient method returning the presence of the
- // --ensure-google-update-present switch.
- bool ensure_google_update_present() const {
- return ensure_google_update_present_;
- }
-
// The full path to the place where the operand resides.
const base::FilePath& target_path() const { return target_path_; }
@@ -274,7 +268,6 @@ class InstallerState {
#endif
bool msi_;
bool verbose_logging_;
- bool ensure_google_update_present_;
private:
DISALLOW_COPY_AND_ASSIGN(InstallerState);
diff --git a/chrome/installer/util/master_preferences.cc b/chrome/installer/util/master_preferences.cc
index 7bf5c2f7..2c08b1f 100644
--- a/chrome/installer/util/master_preferences.cc
+++ b/chrome/installer/util/master_preferences.cc
@@ -73,7 +73,6 @@ namespace installer {
MasterPreferences::MasterPreferences() : distribution_(NULL),
preferences_read_from_file_(false),
chrome_(true),
- chrome_app_launcher_(false),
multi_install_(false) {
InitializeFromCommandLine(*base::CommandLine::ForCurrentProcess());
}
@@ -82,7 +81,6 @@ MasterPreferences::MasterPreferences(const base::CommandLine& cmd_line)
: distribution_(NULL),
preferences_read_from_file_(false),
chrome_(true),
- chrome_app_launcher_(false),
multi_install_(false) {
InitializeFromCommandLine(cmd_line);
}
@@ -91,7 +89,6 @@ MasterPreferences::MasterPreferences(const base::FilePath& prefs_path)
: distribution_(NULL),
preferences_read_from_file_(false),
chrome_(true),
- chrome_app_launcher_(false),
multi_install_(false) {
std::string json_data;
// Failure to read the file is ignored as |json_data| will be the empty string
@@ -109,7 +106,6 @@ MasterPreferences::MasterPreferences(const std::string& prefs)
: distribution_(NULL),
preferences_read_from_file_(false),
chrome_(true),
- chrome_app_launcher_(false),
multi_install_(false) {
InitializeFromString(prefs);
}
@@ -139,10 +135,6 @@ void MasterPreferences::InitializeFromCommandLine(
} translate_switches[] = {
{ installer::switches::kAutoLaunchChrome,
installer::master_preferences::kAutoLaunchChrome },
- { installer::switches::kChromeAppHostDeprecated,
- installer::master_preferences::kChromeAppHostDeprecated },
- { installer::switches::kChromeAppLauncher,
- installer::master_preferences::kChromeAppLauncher },
{ installer::switches::kChrome,
installer::master_preferences::kChrome },
{ installer::switches::kDisableLogging,
@@ -225,20 +217,10 @@ bool MasterPreferences::InitializeFromString(const std::string& json_data) {
void MasterPreferences::InitializeProductFlags() {
// Make sure we start out with the correct defaults.
multi_install_ = false;
- chrome_app_launcher_ = false;
chrome_ = true;
GetBool(installer::master_preferences::kMultiInstall, &multi_install_);
- GetBool(installer::master_preferences::kChromeAppLauncher,
- &chrome_app_launcher_);
-
- // The deprecated switch --app-host behaves like --app-launcher.
- bool chrome_app_host = false;
- GetBool(installer::master_preferences::kChromeAppHostDeprecated,
- &chrome_app_host);
- chrome_app_launcher_ = chrome_app_launcher_ || chrome_app_host;
-
// When multi-install is specified, the checks are pretty simple (in theory):
// In order to be installed/uninstalled, each product must have its switch
// present on the command line.
diff --git a/chrome/installer/util/master_preferences.h b/chrome/installer/util/master_preferences.h
index 83f1150..9a7355e 100644
--- a/chrome/installer/util/master_preferences.h
+++ b/chrome/installer/util/master_preferences.h
@@ -171,10 +171,6 @@ class MasterPreferences {
return chrome_;
}
- bool install_chrome_app_launcher() const {
- return chrome_app_launcher_;
- }
-
bool is_multi_install() const {
return multi_install_;
}
@@ -212,7 +208,6 @@ class MasterPreferences {
base::DictionaryValue* distribution_;
bool preferences_read_from_file_;
bool chrome_;
- bool chrome_app_launcher_;
bool multi_install_;
private:
diff --git a/chrome/installer/util/master_preferences_constants.cc b/chrome/installer/util/master_preferences_constants.cc
index 1676d21..3baacc1 100644
--- a/chrome/installer/util/master_preferences_constants.cc
+++ b/chrome/installer/util/master_preferences_constants.cc
@@ -9,9 +9,6 @@ namespace master_preferences {
const char kAltShortcutText[] = "alternate_shortcut_text";
const char kAutoLaunchChrome[] = "auto_launch_chrome";
const char kChrome[] = "chrome";
- // TODO(huangs): Remove by M27.
- const char kChromeAppHostDeprecated[] = "app_host";
- const char kChromeAppLauncher[] = "app_launcher";
const char kChromeShortcutIconIndex[] = "chrome_shortcut_icon_index";
const char kCreateAllShortcuts[] = "create_all_shortcuts";
const char kDisableLogging[] = "disable_logging";
diff --git a/chrome/installer/util/master_preferences_constants.h b/chrome/installer/util/master_preferences_constants.h
index 8b03d12..a8ebd48 100644
--- a/chrome/installer/util/master_preferences_constants.h
+++ b/chrome/installer/util/master_preferences_constants.h
@@ -22,10 +22,6 @@ extern const char kAltShortcutText[];
extern const char kAutoLaunchChrome[];
// Boolean. This is to be a Chrome install. (When using MultiInstall)
extern const char kChrome[];
-// Boolean. This is to be a Chrome App Host install.
-extern const char kChromeAppHostDeprecated[]; // TODO(huangs): Remove by M27.
-// Boolean. This is to be a Chrome App Launcher install.
-extern const char kChromeAppLauncher[];
// Integer. Icon index from chrome.exe to use for shortcuts.
extern const char kChromeShortcutIconIndex[];
// Boolean. This is a legacy preference and should no longer be used; it is
diff --git a/chrome/installer/util/prebuild/create_string_rc.py b/chrome/installer/util/prebuild/create_string_rc.py
index 96ca2ab..8c4bf22 100755
--- a/chrome/installer/util/prebuild/create_string_rc.py
+++ b/chrome/installer/util/prebuild/create_string_rc.py
@@ -47,13 +47,12 @@ from grit.extern import tclib
STRING_IDS = [
'IDS_PRODUCT_NAME',
'IDS_SXS_SHORTCUT_NAME',
- 'IDS_PRODUCT_APP_LAUNCHER_NAME',
+ 'IDS_PRODUCT_APP_LAUNCHER_NAME', # Used in App Launcher registry.
'IDS_PRODUCT_BINARIES_NAME',
'IDS_PRODUCT_DESCRIPTION',
'IDS_UNINSTALL_CHROME',
'IDS_ABOUT_VERSION_COMPANY_NAME',
'IDS_INSTALL_HIGHER_VERSION',
- 'IDS_INSTALL_HIGHER_VERSION_APP_LAUNCHER',
'IDS_INSTALL_FAILED',
'IDS_SAME_VERSION_REPAIR_FAILED',
'IDS_SETUP_PATCH_FAILED',
@@ -69,9 +68,6 @@ STRING_IDS = [
'IDS_OEM_MAIN_SHORTCUT_NAME',
'IDS_SHORTCUT_TOOLTIP',
'IDS_SHORTCUT_NEW_WINDOW',
- 'IDS_APP_LAUNCHER_PRODUCT_DESCRIPTION',
- 'IDS_APP_LAUNCHER_SHORTCUT_TOOLTIP',
- 'IDS_UNINSTALL_APP_LAUNCHER',
'IDS_APP_LIST_SHORTCUT_NAME',
'IDS_APP_LIST_SHORTCUT_NAME_CANARY',
'IDS_APP_SHORTCUTS_SUBDIR_NAME',
diff --git a/chrome/installer/util/product.cc b/chrome/installer/util/product.cc
index 89486a8..bd0b268 100644
--- a/chrome/installer/util/product.cc
+++ b/chrome/installer/util/product.cc
@@ -10,7 +10,6 @@
#include "base/logging.h"
#include "base/process/launch.h"
#include "base/win/registry.h"
-#include "chrome/installer/util/chrome_app_host_operations.h"
#include "chrome/installer/util/chrome_binaries_operations.h"
#include "chrome/installer/util/chrome_browser_operations.h"
#include "chrome/installer/util/chrome_browser_sxs_operations.h"
@@ -38,9 +37,6 @@ Product::Product(BrowserDistribution* distribution)
case BrowserDistribution::CHROME_FRAME:
operations_.reset(new ChromeFrameOperations());
break;
- case BrowserDistribution::CHROME_APP_HOST:
- operations_.reset(new ChromeAppHostOperations());
- break;
case BrowserDistribution::CHROME_BINARIES:
operations_.reset(new ChromeBinariesOperations());
break;
diff --git a/chrome/installer/util/product.h b/chrome/installer/util/product.h
index a815fb2..e810139 100644
--- a/chrome/installer/util/product.h
+++ b/chrome/installer/util/product.h
@@ -61,10 +61,6 @@ class Product {
return distribution_->GetType() == BrowserDistribution::CHROME_FRAME;
}
- bool is_chrome_app_host() const {
- return distribution_->GetType() == BrowserDistribution::CHROME_APP_HOST;
- }
-
bool is_chrome_binaries() const {
return distribution_->GetType() == BrowserDistribution::CHROME_BINARIES;
}
diff --git a/chrome/installer/util/util_constants.cc b/chrome/installer/util/util_constants.cc
index 9a65857..6975262 100644
--- a/chrome/installer/util/util_constants.cc
+++ b/chrome/installer/util/util_constants.cc
@@ -15,15 +15,6 @@ const char kAutoLaunchChrome[] = "auto-launch-chrome";
// Currently this is only required when used in combination with kMultiInstall.
const char kChrome[] = "chrome";
-// Install Chrome App Host. This is now interpreted as kChromeAppLauncher.
-// TODO(huangs): Remove by M27.
-const char kChromeAppHostDeprecated[] = "app-host";
-
-// Install Chrome App Launcher, which subsumes Chrome App Host, i.e.,
-// App Launcher install converts App Host to App Launcher, and all subsequent
-// App Host updates/uninstalls become App Launcher updates/uninstalls.
-const char kChromeAppLauncher[] = "app-launcher";
-
// Install Chrome Frame.
const char kChromeFrame[] = "chrome-frame";
@@ -63,9 +54,6 @@ const char kDoNotRemoveSharedItems[] = "do-not-remove-shared-items";
// Enable logging at the error level. This is the default behavior.
const char kEnableLogging[] = "enable-logging";
-// Ensures that Google Update is present at the current level of installation.
-const char kEnsureGoogleUpdatePresent[] = "ensure-google-update-present";
-
// Same as kConfigureUserSettings above; except the checks to know whether
// first run already occured are bypassed and shortcuts are created either way
// (kConfigureUserSettings also needs to be on the command-line for this to have
@@ -108,10 +96,6 @@ const char kNewSetupExe[] = "new-setup-exe";
// Notify the installer that the OS has been upgraded.
const char kOnOsUpgrade[] = "on-os-upgrade";
-// Determines whether or not EULA has been accepted at some point. Returns via
-// exit code: 0 if EULA not accepted, 1 if EULA accepted, and E_FAIL on error.
-const char kQueryEULAAcceptance[] = "query-eula-acceptance";
-
// Requests that setup attempt to reenable autoupdates for Chrome.
const char kReenableAutoupdates[] = "reenable-autoupdates";
@@ -213,7 +197,6 @@ const char kOutputFile[] = "output-file";
// Active Setup.
const wchar_t kActiveSetupExe[] = L"chrmstp.exe";
const wchar_t kAppLauncherGuid[] = L"{FDA71E6F-AC4C-4a00-8B70-9958A68906BF}";
-const wchar_t kChromeAppHostExe[] = L"app_host.exe";
const wchar_t kChromeDll[] = L"chrome.dll";
const wchar_t kChromeChildDll[] = L"chrome_child.dll";
const wchar_t kChromeExe[] = L"chrome.exe";
@@ -226,9 +209,6 @@ const wchar_t kChromeMetroDll[] = L"metro_driver.dll";
const wchar_t kChromeNewExe[] = L"new_chrome.exe";
const wchar_t kChromeOldExe[] = L"old_chrome.exe";
const wchar_t kCmdOnOsUpgrade[] = L"on-os-upgrade";
-const wchar_t kCmdQueryEULAAcceptance[] = L"query-eula-acceptance";
-const wchar_t kCmdQuickEnableApplicationHost[] =
- L"quick-enable-application-host";
const wchar_t kCmdQuickEnableCf[] = L"quick-enable-cf";
const wchar_t kDelegateExecuteExe[] = L"delegate_execute.exe";
const wchar_t kEULASentinelFile[] = L"EULA Accepted";
diff --git a/chrome/installer/util/util_constants.h b/chrome/installer/util/util_constants.h
index 301f26f..d4dc6862 100644
--- a/chrome/installer/util/util_constants.h
+++ b/chrome/installer/util/util_constants.h
@@ -148,8 +148,6 @@ namespace switches {
extern const char kAutoLaunchChrome[];
extern const char kChrome[];
-extern const char kChromeAppHostDeprecated[]; // TODO(huangs): Remove by M27.
-extern const char kChromeAppLauncher[];
extern const char kChromeFrame[];
extern const char kChromeSxS[];
extern const char kConfigureUserSettings[];
@@ -160,7 +158,6 @@ extern const char kDoNotLaunchChrome[];
extern const char kDoNotRegisterForUpdateLaunch[];
extern const char kDoNotRemoveSharedItems[];
extern const char kEnableLogging[];
-extern const char kEnsureGoogleUpdatePresent[];
extern const char kForceConfigureUserSettings[];
extern const char kForceUninstall[];
extern const char kInstallArchive[];
@@ -171,7 +168,6 @@ extern const char kMsi[];
extern const char kMultiInstall[];
extern const char kNewSetupExe[];
extern const char kOnOsUpgrade[];
-extern const char kQueryEULAAcceptance[];
extern const char kReenableAutoupdates[];
extern const char kRegisterChromeBrowser[];
extern const char kRegisterChromeBrowserSuffix[];
@@ -202,7 +198,6 @@ extern const char kOutputFile[];
extern const wchar_t kActiveSetupExe[];
extern const wchar_t kAppLauncherGuid[];
-extern const wchar_t kChromeAppHostExe[];
extern const wchar_t kChromeDll[];
extern const wchar_t kChromeChildDll[];
extern const wchar_t kChromeExe[];
@@ -215,8 +210,6 @@ extern const wchar_t kChromeMetroDll[];
extern const wchar_t kChromeNewExe[];
extern const wchar_t kChromeOldExe[];
extern const wchar_t kCmdOnOsUpgrade[];
-extern const wchar_t kCmdQueryEULAAcceptance[];
-extern const wchar_t kCmdQuickEnableApplicationHost[];
extern const wchar_t kCmdQuickEnableCf[];
extern const wchar_t kDelegateExecuteExe[];
extern const wchar_t kEULASentinelFile[];