| Index: chrome/installer/launcher_support/chrome_launcher_support.cc
|
| diff --git a/chrome/installer/launcher_support/chrome_launcher_support.cc b/chrome/installer/launcher_support/chrome_launcher_support.cc
|
| index 8e5b6a5ddad6efe0782a7a228084a5c4895f09a9..a9aed49191f934dcd454a37233ae62d97f2d23e5 100644
|
| --- a/chrome/installer/launcher_support/chrome_launcher_support.cc
|
| +++ b/chrome/installer/launcher_support/chrome_launcher_support.cc
|
| @@ -5,13 +5,9 @@
|
| #include "chrome/installer/launcher_support/chrome_launcher_support.h"
|
|
|
| #include <windows.h>
|
| -#include <tchar.h>
|
|
|
| -#include "base/command_line.h"
|
| #include "base/file_util.h"
|
| #include "base/files/file_path.h"
|
| -#include "base/logging.h"
|
| -#include "base/process/launch.h"
|
| #include "base/strings/string16.h"
|
| #include "base/win/registry.h"
|
|
|
| @@ -39,10 +35,7 @@ const wchar_t kBrowserAppGuid[] = L"{8A69D345-D564-463c-AFF1-A69D9E530F96}";
|
| const wchar_t kSxSBrowserAppGuid[] = L"{4ea16ac7-fd5a-47c3-875b-dbf4a2008c20}";
|
|
|
| // Copied from util_constants.cc.
|
| -const wchar_t kChromeAppHostExe[] = L"app_host.exe";
|
| -const char kChromeAppLauncher[] = "app-launcher";
|
| const wchar_t kChromeExe[] = L"chrome.exe";
|
| -const wchar_t kUninstallArgumentsField[] = L"UninstallArguments";
|
| const wchar_t kUninstallStringField[] = L"UninstallString";
|
|
|
| // Reads a string value from the specified product's "ClientState" registry key.
|
| @@ -80,19 +73,6 @@ bool IsProductInstalled(InstallationLevel level, const wchar_t* app_guid) {
|
| reg_key.HasValue(kRegVersionField);
|
| }
|
|
|
| -bool IsAppLauncherEnabledAtLevel(InstallationLevel level) {
|
| - base::string16 uninstall_arguments;
|
| - if (GetClientStateValue(level,
|
| - kAppLauncherGuid,
|
| - kUninstallArgumentsField,
|
| - &uninstall_arguments)) {
|
| - return CommandLine::FromString(L"dummy.exe " + uninstall_arguments)
|
| - .HasSwitch(kChromeAppLauncher) &&
|
| - !GetAppHostPathForInstallationLevel(level).empty();
|
| - }
|
| - return false;
|
| -}
|
| -
|
| // Reads the path to setup.exe from the value "UninstallString" within the
|
| // specified product's "ClientState" registry key. Returns an empty FilePath if
|
| // an error occurs or the product is not installed at the specified level.
|
| @@ -107,9 +87,9 @@ base::FilePath GetSetupExeFromRegistry(InstallationLevel level,
|
| return base::FilePath();
|
| }
|
|
|
| -// Returns the path to an installed |exe_file| (e.g. chrome.exe, app_host.exe)
|
| -// at the specified level, given |setup_exe_path| from Omaha client state.
|
| -// Returns empty base::FilePath if none found, or if |setup_exe_path| is empty.
|
| +// Returns the path to an installed |exe_file| (e.g. chrome.exe) at the
|
| +// specified level, given |setup_exe_path| from Omaha client state. Returns
|
| +// empty base::FilePath if none found, or if |setup_exe_path| is empty.
|
| base::FilePath FindExeRelativeToSetupExe(const base::FilePath setup_exe_path,
|
| const wchar_t* exe_file) {
|
| if (!setup_exe_path.empty()) {
|
| @@ -131,26 +111,6 @@ base::FilePath FindExeRelativeToSetupExe(const base::FilePath setup_exe_path,
|
|
|
| } // namespace
|
|
|
| -const wchar_t kAppLauncherGuid[] = L"{FDA71E6F-AC4C-4a00-8B70-9958A68906BF}";
|
| -
|
| -void UninstallLegacyAppLauncher(InstallationLevel level) {
|
| - base::FilePath setup_exe(GetSetupExeFromRegistry(level, kAppLauncherGuid));
|
| - if (setup_exe.empty())
|
| - return;
|
| - base::string16 uninstall_arguments;
|
| - if (GetClientStateValue(level,
|
| - kAppLauncherGuid,
|
| - kUninstallArgumentsField,
|
| - &uninstall_arguments)) {
|
| - CommandLine uninstall_cmd = CommandLine::FromString(
|
| - L"\"" + setup_exe.value() + L"\" " + uninstall_arguments);
|
| -
|
| - VLOG(1) << "Uninstalling legacy app launcher with command line: "
|
| - << uninstall_cmd.GetCommandLineString();
|
| - base::LaunchProcess(uninstall_cmd, base::LaunchOptions(), NULL);
|
| - }
|
| -}
|
| -
|
| base::FilePath GetSetupExeForInstallationLevel(InstallationLevel level) {
|
| // Look in the registry for Chrome Binaries first.
|
| base::FilePath setup_exe_path(
|
| @@ -167,11 +127,6 @@ base::FilePath GetChromePathForInstallationLevel(InstallationLevel level) {
|
| GetSetupExeForInstallationLevel(level), kChromeExe);
|
| }
|
|
|
| -base::FilePath GetAppHostPathForInstallationLevel(InstallationLevel level) {
|
| - return FindExeRelativeToSetupExe(
|
| - GetSetupExeFromRegistry(level, kAppLauncherGuid), kChromeAppHostExe);
|
| -}
|
| -
|
| base::FilePath GetChromeSxSPathForInstallationLevel(InstallationLevel level) {
|
| return FindExeRelativeToSetupExe(
|
| GetSetupExeFromRegistry(level, kSxSBrowserAppGuid), kChromeExe);
|
| @@ -186,17 +141,6 @@ base::FilePath GetAnyChromePath() {
|
| return chrome_path;
|
| }
|
|
|
| -base::FilePath GetAnyAppHostPath() {
|
| - base::FilePath app_host_path;
|
| - if (app_host_path.empty()) {
|
| - app_host_path = GetAppHostPathForInstallationLevel(
|
| - SYSTEM_LEVEL_INSTALLATION);
|
| - }
|
| - if (app_host_path.empty())
|
| - app_host_path = GetAppHostPathForInstallationLevel(USER_LEVEL_INSTALLATION);
|
| - return app_host_path;
|
| -}
|
| -
|
| base::FilePath GetAnyChromeSxSPath() {
|
| base::FilePath path =
|
| GetChromeSxSPathForInstallationLevel(USER_LEVEL_INSTALLATION);
|
| @@ -205,25 +149,6 @@ base::FilePath GetAnyChromeSxSPath() {
|
| return path;
|
| }
|
|
|
| -bool IsAppHostPresent() {
|
| - base::FilePath app_host_exe = GetAnyAppHostPath();
|
| - return !app_host_exe.empty();
|
| -}
|
| -
|
| -InstallationState GetAppLauncherInstallationState() {
|
| - if (IsAppLauncherEnabledAtLevel(SYSTEM_LEVEL_INSTALLATION))
|
| - return INSTALLED_AT_SYSTEM_LEVEL;
|
| -
|
| - if (IsAppLauncherEnabledAtLevel(USER_LEVEL_INSTALLATION))
|
| - return INSTALLED_AT_USER_LEVEL;
|
| -
|
| - return NOT_INSTALLED;
|
| -}
|
| -
|
| -bool IsAppLauncherPresent() {
|
| - return GetAppLauncherInstallationState() != NOT_INSTALLED;
|
| -}
|
| -
|
| bool IsChromeBrowserPresent() {
|
| return IsProductInstalled(USER_LEVEL_INSTALLATION, kBrowserAppGuid) ||
|
| IsProductInstalled(SYSTEM_LEVEL_INSTALLATION, kBrowserAppGuid);
|
|
|