| Index: chrome/installer/util/installer_state.cc
|
| diff --git a/chrome/installer/util/installer_state.cc b/chrome/installer/util/installer_state.cc
|
| index 24572be38f526e9795e1457b850ca6ee08f77cf2..a142924180c3a3d3fd4c5d6bdeb791f920a425e6 100644
|
| --- a/chrome/installer/util/installer_state.cc
|
| +++ b/chrome/installer/util/installer_state.cc
|
| @@ -126,6 +126,49 @@ void InstallerState::Initialize(const CommandLine& command_line,
|
| VLOG(1) << (is_uninstall ? "Uninstall" : "Install")
|
| << " distribution: " << p->distribution()->GetAppShortCutName();
|
| }
|
| + if (prefs.install_chrome_app_host()) {
|
| + Product* p =
|
| + AddProductFromPreferences(BrowserDistribution::CHROME_APP_HOST, prefs,
|
| + machine_state);
|
| + VLOG(1) << (is_uninstall ? "Uninstall" : "Install")
|
| + << " distribution: " << p->distribution()->GetAppShortCutName();
|
| + }
|
| +
|
| + if (is_uninstall && prefs.is_multi_install()) {
|
| + bool keep_binaries = false;
|
| + // Look for a product that is not the binaries and that is not being
|
| + // uninstalled. If not found, binaries are uninstalled too.
|
| + for (size_t i = 0; i < BrowserDistribution::kNumProductTypes; ++i) {
|
| + if (BrowserDistribution::kProductTypes[i] ==
|
| + BrowserDistribution::CHROME_BINARIES) {
|
| + continue;
|
| + }
|
| +
|
| + if (machine_state.GetProductState(
|
| + system_install(),
|
| + BrowserDistribution::kProductTypes[i]) == NULL) {
|
| + // The product is not installed.
|
| + continue;
|
| + }
|
| +
|
| + // The product is installed.
|
| +
|
| + if (!FindProduct(BrowserDistribution::kProductTypes[i])) {
|
| + // The product is not being uninstalled.
|
| + keep_binaries = true;
|
| + break;
|
| + }
|
| +
|
| + // The product is being uninstalled.
|
| + }
|
| + if (!keep_binaries) {
|
| + Product* p =
|
| + AddProductFromPreferences(BrowserDistribution::CHROME_BINARIES, prefs,
|
| + machine_state);
|
| + VLOG(1) << (is_uninstall ? "Uninstall" : "Install")
|
| + << " distribution: " << p->distribution()->GetAppShortCutName();
|
| + }
|
| + }
|
|
|
| BrowserDistribution* operand = NULL;
|
|
|
| @@ -148,10 +191,19 @@ void InstallerState::Initialize(const CommandLine& command_line,
|
| }
|
|
|
| if (operand == NULL) {
|
| + BrowserDistribution::Type operand_distribution_type =
|
| + BrowserDistribution::CHROME_BINARIES;
|
| + if (prefs.install_chrome())
|
| + operand_distribution_type = BrowserDistribution::CHROME_BROWSER;
|
| + else if (prefs.install_chrome_frame())
|
| + 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(
|
| - prefs.install_chrome() ?
|
| - BrowserDistribution::CHROME_BROWSER :
|
| - BrowserDistribution::CHROME_FRAME);
|
| + operand_distribution_type);
|
| }
|
|
|
| state_key_ = operand->GetStateKey();
|
|
|