summaryrefslogtreecommitdiffstats
path: root/chrome/installer/setup
diff options
context:
space:
mode:
authorhuangs@chromium.org <huangs@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-20 00:37:49 +0000
committerhuangs@chromium.org <huangs@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-01-20 00:37:49 +0000
commitf0d583dfa0a622cf3c6b7c494a91bc9f0e1fc959 (patch)
treefb43ab5dad5c4e0094ef57cd5f18a4804e42a747 /chrome/installer/setup
parent3dbd64d89febbe85df9b53ad16fbdca06ecdeb9a (diff)
downloadchromium_src-f0d583dfa0a622cf3c6b7c494a91bc9f0e1fc959.zip
chromium_src-f0d583dfa0a622cf3c6b7c494a91bc9f0e1fc959.tar.gz
chromium_src-f0d583dfa0a622cf3c6b7c494a91bc9f0e1fc959.tar.bz2
During App Launcher install, install V2 App if instructed to do so via environment variable.
The environment variable read is GoogleUpdateUntrustedData. To test this: 1. Set the following environmental variable (to install Smooth Life): set GoogleUpdateUntrustedData=install-from-webstore=cehnejjbgmkcpmabgambbdjiechjaped 2. Install App Launcher: mini_installer.exe --verbose-logging --multi-install --app-launcher We're making 'setup' depend on 'launcher_support' because install.c needs to call chrome_launcher_support::GetAnyAppHostPath(). BUG=151107 Review URL: https://chromiumcodereview.appspot.com/11737011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@177855 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/setup')
-rw-r--r--chrome/installer/setup/install.cc13
-rw-r--r--chrome/installer/setup/install.h5
-rw-r--r--chrome/installer/setup/setup_constants.cc4
-rw-r--r--chrome/installer/setup/setup_constants.h2
-rw-r--r--chrome/installer/setup/setup_main.cc12
5 files changed, 36 insertions, 0 deletions
diff --git a/chrome/installer/setup/install.cc b/chrome/installer/setup/install.cc
index 0574eee..2be1efd 100644
--- a/chrome/installer/setup/install.cc
+++ b/chrome/installer/setup/install.cc
@@ -17,6 +17,7 @@
#include "base/logging.h"
#include "base/memory/scoped_ptr.h"
#include "base/path_service.h"
+#include "base/process_util.h"
#include "base/string_util.h"
#include "base/stringprintf.h"
#include "base/utf_string_conversions.h"
@@ -24,6 +25,7 @@
#include "base/win/windows_version.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/installer/launcher_support/chrome_launcher_support.h"
#include "chrome/installer/setup/install_worker.h"
#include "chrome/installer/setup/setup_constants.h"
#include "chrome/installer/util/auto_launch_util.h"
@@ -697,4 +699,15 @@ void HandleActiveSetupForBrowser(const FilePath& installation_root,
chrome_exe, chrome, prefs, CURRENT_USER, install_operation);
}
+bool InstallFromWebstore(const std::string& app_code) {
+ FilePath app_host_path(chrome_launcher_support::GetAnyAppHostPath());
+ if (app_host_path.empty())
+ return false;
+
+ CommandLine cmd(app_host_path);
+ cmd.AppendSwitchASCII(::switches::kInstallFromWebstore, app_code);
+ VLOG(1) << "App install command: " << cmd.GetCommandLineString();
+ return base::LaunchProcess(cmd, base::LaunchOptions(), NULL);
+}
+
} // namespace installer
diff --git a/chrome/installer/setup/install.h b/chrome/installer/setup/install.h
index b8c35f1..abf0ab3 100644
--- a/chrome/installer/setup/install.h
+++ b/chrome/installer/setup/install.h
@@ -131,6 +131,11 @@ void HandleActiveSetupForBrowser(const FilePath& installation_root,
const Product& chrome,
bool force);
+// Launches app_host.exe to install content from web store (non-blocking).
+// Returns true on successful execution (although successful installation
+// is not guaranteed).
+bool InstallFromWebstore(const std::string& app_code);
+
} // namespace installer
#endif // CHROME_INSTALLER_SETUP_INSTALL_H_
diff --git a/chrome/installer/setup/setup_constants.cc b/chrome/installer/setup/setup_constants.cc
index 77c03a6..10b8479 100644
--- a/chrome/installer/setup/setup_constants.cc
+++ b/chrome/installer/setup/setup_constants.cc
@@ -20,4 +20,8 @@ const wchar_t kInstallSourceChromeDir[] = L"Chrome-bin";
const wchar_t kMediaPlayerRegPath[] =
L"Software\\Microsoft\\MediaPlayer\\ShimInclusionList";
+// Key names for values passed via the GoogleUpdateUntrustedData environment
+// variable.
+const char kInstallFromWebstore[] = "install-from-webstore";
+
} // namespace installer
diff --git a/chrome/installer/setup/setup_constants.h b/chrome/installer/setup/setup_constants.h
index 9e146b8..376350a 100644
--- a/chrome/installer/setup/setup_constants.h
+++ b/chrome/installer/setup/setup_constants.h
@@ -20,6 +20,8 @@ extern const wchar_t kInstallSourceChromeDir[];
extern const wchar_t kMediaPlayerRegPath[];
+extern const char kInstallFromWebstore[];
+
} // namespace installer
#endif // CHROME_INSTALLER_SETUP_SETUP_CONSTANTS_H__
diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc
index e31afaa..4ec738f 100644
--- a/chrome/installer/setup/setup_main.cc
+++ b/chrome/installer/setup/setup_main.cc
@@ -7,6 +7,8 @@
#include <shellapi.h>
#include <shlobj.h>
+#include <string>
+
#include "base/at_exit.h"
#include "base/basictypes.h"
#include "base/command_line.h"
@@ -884,6 +886,16 @@ installer::InstallStatus InstallProductsHelper(
chrome_exe);
}
}
+
+ if (prefs.install_chrome_app_launcher() &&
+ InstallUtil::GetInstallReturnCode(install_status) == 0) {
+ std::string webstore_item(google_update::GetUntrustedDataValue(
+ installer::kInstallFromWebstore));
+ if (!webstore_item.empty()) {
+ bool success = installer::InstallFromWebstore(webstore_item);
+ VLOG_IF(1, !success) << "Failed to launch app installation.";
+ }
+ }
}
}