summaryrefslogtreecommitdiffstats
path: root/chrome/installer/launcher_support
diff options
context:
space:
mode:
authorcalamity@chromium.org <calamity@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-02 03:54:28 +0000
committercalamity@chromium.org <calamity@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-02 03:54:28 +0000
commit508b89a64ab700aa09f21fc666a5588b47360eab (patch)
tree466272df258d736ab239d300cc991f9288e5d1e9 /chrome/installer/launcher_support
parent9b21ba2ada09e34dffacd41cddb84dc4692054c2 (diff)
downloadchromium_src-508b89a64ab700aa09f21fc666a5588b47360eab.zip
chromium_src-508b89a64ab700aa09f21fc666a5588b47360eab.tar.gz
chromium_src-508b89a64ab700aa09f21fc666a5588b47360eab.tar.bz2
Upgrade old app host to new app launcher on startup
This patch is a continuation of https://codereview.chromium.org/16805002/. BUG=248825 Review URL: https://chromiumcodereview.appspot.com/17022015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209604 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/launcher_support')
-rw-r--r--chrome/installer/launcher_support/chrome_launcher_support.cc19
-rw-r--r--chrome/installer/launcher_support/chrome_launcher_support.h5
2 files changed, 24 insertions, 0 deletions
diff --git a/chrome/installer/launcher_support/chrome_launcher_support.cc b/chrome/installer/launcher_support/chrome_launcher_support.cc
index 14321cc..181007d 100644
--- a/chrome/installer/launcher_support/chrome_launcher_support.cc
+++ b/chrome/installer/launcher_support/chrome_launcher_support.cc
@@ -11,6 +11,7 @@
#include "base/file_util.h"
#include "base/files/file_path.h"
#include "base/logging.h"
+#include "base/process_util.h"
#include "base/strings/string16.h"
#include "base/win/registry.h"
@@ -142,6 +143,24 @@ base::FilePath FindExeRelativeToSetupExe(const base::FilePath setup_exe_path,
} // namespace
+void UninstallLegacyAppLauncher(InstallationLevel level) {
+ base::FilePath setup_exe(GetSetupExeFromRegistry(level, kAppHostAppId));
+ if (setup_exe.empty())
+ return;
+ string16 uninstall_arguments;
+ if (GetClientStateValue(level,
+ kAppHostAppId,
+ 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(
diff --git a/chrome/installer/launcher_support/chrome_launcher_support.h b/chrome/installer/launcher_support/chrome_launcher_support.h
index 7c5bc68..5a948db 100644
--- a/chrome/installer/launcher_support/chrome_launcher_support.h
+++ b/chrome/installer/launcher_support/chrome_launcher_support.h
@@ -52,6 +52,11 @@ base::FilePath GetAnyChromePath();
// The file path returned (if any) is guaranteed to exist.
base::FilePath GetAnyAppHostPath();
+// Uninstalls the legacy app launcher by launching setup.exe with the uninstall
+// arguments from the App Launcher ClientState registry key. The uninstall will
+// run asynchronously.
+void UninstallLegacyAppLauncher(InstallationLevel level);
+
// Returns true if App Host is installed (system-level or user-level),
// or in the same directory as the current executable.
bool IsAppHostPresent();