diff options
author | erikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-13 16:31:56 +0000 |
---|---|---|
committer | erikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-13 16:31:56 +0000 |
commit | 540e3e9c67b612eea161edbd4b481345b2ed848f (patch) | |
tree | 2d0163979d6ce28f949ee52eea8f16485aa65670 /chrome/installer | |
parent | 5cce7a0aeb43f788a0fc8e8a98ca315d74209daa (diff) | |
download | chromium_src-540e3e9c67b612eea161edbd4b481345b2ed848f.zip chromium_src-540e3e9c67b612eea161edbd4b481345b2ed848f.tar.gz chromium_src-540e3e9c67b612eea161edbd4b481345b2ed848f.tar.bz2 |
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
Diffstat (limited to 'chrome/installer')
-rw-r--r-- | chrome/installer/setup/setup_main.cc | 30 | ||||
-rw-r--r-- | chrome/installer/util/installer_state.cc | 6 |
2 files changed, 20 insertions, 16 deletions
diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc index 95490b0..139b827 100644 --- a/chrome/installer/setup/setup_main.cc +++ b/chrome/installer/setup/setup_main.cc @@ -360,6 +360,15 @@ bool CheckMultiInstallConditions(const InstallationState& original_state, BrowserDistribution::CHROME_BROWSER); 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) { DCHECK(!system_level); // App Host may use Chrome/Chrome binaries at system-level. @@ -370,23 +379,20 @@ bool CheckMultiInstallConditions(const InstallationState& original_state, true, // system BrowserDistribution::CHROME_BINARIES)) { VLOG(1) << "Installing/updating Application Host without binaries."; - return true; } else { // Somehow the binaries were present when the quick-enable app host // command was run, but now they appear to be missing. - // TODO(erikwright): should the binaries be implicitly added? - LOG(ERROR) << "Cannot install Application Host without binaries."; - *status = installer::APP_HOST_REQUIRES_BINARIES; - installer_state->WriteInstallerResult(*status, 0, NULL); - return false; + // Force binaries to be installed/updated. + scoped_ptr<Product> binaries_to_add(new Product( + BrowserDistribution::GetSpecificDistribution( + BrowserDistribution::CHROME_BINARIES))); + 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) { diff --git a/chrome/installer/util/installer_state.cc b/chrome/installer/util/installer_state.cc index 9e69398..13d5794 100644 --- a/chrome/installer/util/installer_state.cc +++ b/chrome/installer/util/installer_state.cc @@ -255,8 +255,8 @@ void InstallerState::Initialize(const CommandLine& command_line, operation_ = MULTI_INSTALL; } - // Initial, over, and un-installs will always take place under one of the - // product app guids (Chrome, Chrome Frame, or App Host, in order of + // Initial, over, and un-installs will take place under one of the + // product app guids (Chrome, Chrome Frame, App Host, or Binaries, in order of // preference). if (operand == NULL) { BrowserDistribution::Type operand_distribution_type = @@ -267,8 +267,6 @@ void InstallerState::Initialize(const CommandLine& command_line, operand_distribution_type = BrowserDistribution::CHROME_FRAME; else if (prefs.install_chrome_app_host()) operand_distribution_type = BrowserDistribution::CHROME_APP_HOST; - else - NOTREACHED(); operand = BrowserDistribution::GetSpecificDistribution( operand_distribution_type); |