summaryrefslogtreecommitdiffstats
path: root/chrome/installer/launcher_support
diff options
context:
space:
mode:
authorjackhou@chromium.org <jackhou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-19 11:50:42 +0000
committerjackhou@chromium.org <jackhou@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-19 11:50:42 +0000
commita15f188ced85888d3a92a34ed714480a97123616 (patch)
tree5b2ec49886d2415830be9f4e87a78ec81f73a3b9 /chrome/installer/launcher_support
parentc4bdf9def9001c3cb9a27bba14a51008dc2914c3 (diff)
downloadchromium_src-a15f188ced85888d3a92a34ed714480a97123616.zip
chromium_src-a15f188ced85888d3a92a34ed714480a97123616.tar.gz
chromium_src-a15f188ced85888d3a92a34ed714480a97123616.tar.bz2
Add GetAnyChromeSxSPath.
BUG=341353 Review URL: https://codereview.chromium.org/200713003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@257937 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/launcher_support')
-rw-r--r--chrome/installer/launcher_support/chrome_launcher_support.cc16
-rw-r--r--chrome/installer/launcher_support/chrome_launcher_support.h10
2 files changed, 26 insertions, 0 deletions
diff --git a/chrome/installer/launcher_support/chrome_launcher_support.cc b/chrome/installer/launcher_support/chrome_launcher_support.cc
index c28bf99..fdac65c 100644
--- a/chrome/installer/launcher_support/chrome_launcher_support.cc
+++ b/chrome/installer/launcher_support/chrome_launcher_support.cc
@@ -38,6 +38,9 @@ const wchar_t kBinariesAppGuid[] = L"{4DC8B4CA-1BDA-483e-B5FA-D3C12E15B62D}";
// Copied from google_chrome_distribution.cc.
const wchar_t kBrowserAppGuid[] = L"{8A69D345-D564-463c-AFF1-A69D9E530F96}";
+// Copied frome google_chrome_sxs_distribution.cc.
+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";
@@ -170,6 +173,11 @@ base::FilePath GetAppHostPathForInstallationLevel(InstallationLevel level) {
GetSetupExeFromRegistry(level, kAppHostAppId), kChromeAppHostExe);
}
+base::FilePath GetChromeSxSPathForInstallationLevel(InstallationLevel level) {
+ return FindExeRelativeToSetupExe(
+ GetSetupExeFromRegistry(level, kSxSBrowserAppGuid), kChromeExe);
+}
+
base::FilePath GetAnyChromePath() {
base::FilePath chrome_path;
if (chrome_path.empty())
@@ -190,6 +198,14 @@ base::FilePath GetAnyAppHostPath() {
return app_host_path;
}
+base::FilePath GetAnyChromeSxSPath() {
+ base::FilePath path =
+ GetChromeSxSPathForInstallationLevel(USER_LEVEL_INSTALLATION);
+ if (path.empty())
+ path = GetChromeSxSPathForInstallationLevel(SYSTEM_LEVEL_INSTALLATION);
+ return path;
+}
+
bool IsAppHostPresent() {
base::FilePath app_host_exe = GetAnyAppHostPath();
return !app_host_exe.empty();
diff --git a/chrome/installer/launcher_support/chrome_launcher_support.h b/chrome/installer/launcher_support/chrome_launcher_support.h
index e9f6280..1a8847f 100644
--- a/chrome/installer/launcher_support/chrome_launcher_support.h
+++ b/chrome/installer/launcher_support/chrome_launcher_support.h
@@ -36,6 +36,10 @@ base::FilePath GetChromePathForInstallationLevel(InstallationLevel level);
// it can be found via Omaha client state.
base::FilePath GetAppHostPathForInstallationLevel(InstallationLevel level);
+// Returns the path to an installed SxS chrome.exe at the specified level, if
+// it can be found via Omaha client state.
+base::FilePath GetChromeSxSPathForInstallationLevel(InstallationLevel level);
+
// Returns the path to an installed chrome.exe, or an empty path. Prefers a
// system-level installation to a user-level installation. Uses Omaha client
// state to identify a Chrome installation location.
@@ -48,6 +52,12 @@ base::FilePath GetAnyChromePath();
// The file path returned (if any) is guaranteed to exist.
base::FilePath GetAnyAppHostPath();
+// Returns the path to an installed SxS chrome.exe, or an empty path. Prefers a
+// user-level installation to a system-level installation. Uses Omaha client
+// state to identify a Chrome Canary installation location.
+// The file path returned (if any) is guaranteed to exist.
+base::FilePath GetAnyChromeSxSPath();
+
// 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.