summaryrefslogtreecommitdiffstats
path: root/chrome/installer
diff options
context:
space:
mode:
authorrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-11 17:01:31 +0000
committerrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-01-11 17:01:31 +0000
commitcbf87625962dbbef6e03665b060fbfdfa979153c (patch)
tree40612e6b5145160962bc05761ceb49d08d1cfa0e /chrome/installer
parent899505c5a3a10ac024fc8e91dd08beda12549312 (diff)
downloadchromium_src-cbf87625962dbbef6e03665b060fbfdfa979153c.zip
chromium_src-cbf87625962dbbef6e03665b060fbfdfa979153c.tar.gz
chromium_src-cbf87625962dbbef6e03665b060fbfdfa979153c.tar.bz2
Applying http://codereview.chromium.org/6156005/ for tommi. Original desc.:
Fix problem with uninstallation of multi-install products. We would incorrectly uninstall both installed products when we should only uninstall one. BUG=68876 TEST=See bug description. Review URL: http://codereview.chromium.org/6186006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71050 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer')
-rw-r--r--chrome/installer/setup/setup_main.cc23
1 files changed, 13 insertions, 10 deletions
diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc
index 8520da5..96f93b9 100644
--- a/chrome/installer/setup/setup_main.cc
+++ b/chrome/installer/setup/setup_main.cc
@@ -736,7 +736,8 @@ class AutoCom {
bool initialized_;
};
-bool PopulateInstallations(const MasterPreferences& prefs,
+bool PopulateInstallations(bool for_uninstall,
+ const MasterPreferences& prefs,
ProductPackageMapping* installations) {
DCHECK(installations);
bool success = true;
@@ -744,10 +745,11 @@ bool PopulateInstallations(const MasterPreferences& prefs,
bool implicit_chrome_install = false;
bool implicit_gcf_install = false;
- if (prefs.is_multi_install()) {
- // See what products are already installed in multi mode.
- // When we do multi installs, we must upgrade all installations
- // in sync since they share the binaries.
+ // See what products are already installed in multi mode.
+ // When we do multi installs, we must upgrade all installations in sync since
+ // they share the binaries. Be careful to not do this when we're uninstalling
+ // a product.
+ if (prefs.is_multi_install() && !for_uninstall) {
struct CheckInstall {
bool* installed;
BrowserDistribution::Type type;
@@ -768,13 +770,15 @@ bool PopulateInstallations(const MasterPreferences& prefs,
}
if (prefs.install_chrome() || implicit_chrome_install) {
- VLOG(1) << "Install distribution: Chrome";
+ VLOG(1) << (for_uninstall ? "Uninstall" : "Install")
+ << " distribution: Chrome";
success = installations->AddDistribution(
BrowserDistribution::CHROME_BROWSER, prefs);
}
if (success && (prefs.install_chrome_frame() || implicit_gcf_install)) {
- VLOG(1) << "Install distribution: Chrome Frame";
+ VLOG(1) << (for_uninstall ? "Uninstall" : "Install")
+ << " distribution: Chrome Frame";
success = installations->AddDistribution(
BrowserDistribution::CHROME_FRAME, prefs);
}
@@ -876,9 +880,10 @@ int WINAPI wWinMain(HINSTANCE instance, HINSTANCE prev_instance,
InstallerState installer_state;
installer_state.Initialize(prefs, original_state);
+ const bool is_uninstall = cmd_line.HasSwitch(installer::switches::kUninstall);
ProductPackageMapping installations(prefs.is_multi_install(), system_install);
- if (!PopulateInstallations(prefs, &installations)) {
+ if (!PopulateInstallations(is_uninstall, prefs, &installations)) {
// Currently this can only fail if one of the installations is a multi and
// a pre-existing single installation exists or vice versa.
installer::InstallStatus status = installer::NON_MULTI_INSTALLATION_EXISTS;
@@ -952,8 +957,6 @@ int WINAPI wWinMain(HINSTANCE instance, HINSTANCE prev_instance,
}
}
- bool is_uninstall = cmd_line.HasSwitch(installer::switches::kUninstall);
-
installer::InstallStatus install_status = installer::UNKNOWN_STATUS;
// If --uninstall option is given, uninstall chrome
if (is_uninstall) {