Allow invocation of --multi-install without a product if App Host needs binaries.

The installer will update the app host and install the binaries if only the app host is present at user-level and neither Chrome nor Binaries are present at system-level.


R=robertshield
BUG=138313
TEST=Install Chrome at system level, apps at user level. Uninstall chrome, then run 'setup.exe --multi-install --verbose-logging'


Review URL: https://chromiumcodereview.appspot.com/10829298

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151283 0039d316-1c4b-4281-b951-d872f2087c98
parent 5cce7a0a
...@@ -360,6 +360,15 @@ bool CheckMultiInstallConditions(const InstallationState& original_state, ...@@ -360,6 +360,15 @@ bool CheckMultiInstallConditions(const InstallationState& original_state,
BrowserDistribution::CHROME_BROWSER); BrowserDistribution::CHROME_BROWSER);
if (!binaries) { if (!binaries) {
// 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_frame && !cf_state && !chrome_state) { if (app_host && !chrome && !chrome_frame && !cf_state && !chrome_state) {
DCHECK(!system_level); DCHECK(!system_level);
// App Host may use Chrome/Chrome binaries at system-level. // App Host may use Chrome/Chrome binaries at system-level.
...@@ -370,23 +379,20 @@ bool CheckMultiInstallConditions(const InstallationState& original_state, ...@@ -370,23 +379,20 @@ bool CheckMultiInstallConditions(const InstallationState& original_state,
true, // system true, // system
BrowserDistribution::CHROME_BINARIES)) { BrowserDistribution::CHROME_BINARIES)) {
VLOG(1) << "Installing/updating Application Host without binaries."; VLOG(1) << "Installing/updating Application Host without binaries.";
return true;
} else { } else {
// Somehow the binaries were present when the quick-enable app host // Somehow the binaries were present when the quick-enable app host
// command was run, but now they appear to be missing. // command was run, but now they appear to be missing.
// TODO(erikwright): should the binaries be implicitly added? // Force binaries to be installed/updated.
LOG(ERROR) << "Cannot install Application Host without binaries."; scoped_ptr<Product> binaries_to_add(new Product(
*status = installer::APP_HOST_REQUIRES_BINARIES; BrowserDistribution::GetSpecificDistribution(
installer_state->WriteInstallerResult(*status, 0, NULL); BrowserDistribution::CHROME_BINARIES)));
return false; binaries_to_add->SetOption(installer::kOptionMultiInstall, true);
binaries = installer_state->AddProduct(&binaries_to_add);
VLOG(1) << "Adding binaries for pre-existing App Host installation.";
} }
} else {
// Every other scenario requires the binaries to be installed/updated
// along with the main product. This will only be hit if
// --multi-install is given with no products. See
// CheckPreInstallConditions for handling of this case.
return true;
} }
return true;
} }
if (chrome) { if (chrome) {
......
...@@ -255,8 +255,8 @@ void InstallerState::Initialize(const CommandLine& command_line, ...@@ -255,8 +255,8 @@ void InstallerState::Initialize(const CommandLine& command_line,
operation_ = MULTI_INSTALL; operation_ = MULTI_INSTALL;
} }
// Initial, over, and un-installs will always take place under one of the // Initial, over, and un-installs will take place under one of the
// product app guids (Chrome, Chrome Frame, or App Host, in order of // product app guids (Chrome, Chrome Frame, App Host, or Binaries, in order of
// preference). // preference).
if (operand == NULL) { if (operand == NULL) {
BrowserDistribution::Type operand_distribution_type = BrowserDistribution::Type operand_distribution_type =
...@@ -267,8 +267,6 @@ void InstallerState::Initialize(const CommandLine& command_line, ...@@ -267,8 +267,6 @@ void InstallerState::Initialize(const CommandLine& command_line,
operand_distribution_type = BrowserDistribution::CHROME_FRAME; operand_distribution_type = BrowserDistribution::CHROME_FRAME;
else if (prefs.install_chrome_app_host()) else if (prefs.install_chrome_app_host())
operand_distribution_type = BrowserDistribution::CHROME_APP_HOST; operand_distribution_type = BrowserDistribution::CHROME_APP_HOST;
else
NOTREACHED();
operand = BrowserDistribution::GetSpecificDistribution( operand = BrowserDistribution::GetSpecificDistribution(
operand_distribution_type); operand_distribution_type);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment