summaryrefslogtreecommitdiffstats
path: root/chrome/installer
diff options
context:
space:
mode:
authorrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-29 11:49:46 +0000
committerrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-29 11:49:46 +0000
commit986f428facdea695fb3ee4eb43c51074fce726ef (patch)
tree4285855edc9f5b91d76c45261006f715961435d7 /chrome/installer
parentf2df53cb51b130e3d42908696ea01e00c4835a59 (diff)
downloadchromium_src-986f428facdea695fb3ee4eb43c51074fce726ef.zip
chromium_src-986f428facdea695fb3ee4eb43c51074fce726ef.tar.gz
chromium_src-986f428facdea695fb3ee4eb43c51074fce726ef.tar.bz2
Have Chrome Frame always delete the user profile on uninstall unless an MSI uninstall is happening. For MSI uninstalls, base our decision on the --delete-profile flag which will tell us whether this is a true uninstall or just an upgrade.
Also correct a comment on the --delete-profile flag that suggests it is only relevant if --force-uninstall is specified. BUG=19370 TEST=Regular and MSI Chrome Frame uninstalls remove the profile directory. MSI upgrades do not. Review URL: http://codereview.chromium.org/1381002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42940 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer')
-rw-r--r--chrome/installer/setup/uninstall.cc23
-rw-r--r--chrome/installer/util/util_constants.cc4
2 files changed, 23 insertions, 4 deletions
diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc
index 1a1c518..3ce98d6 100644
--- a/chrome/installer/setup/uninstall.cc
+++ b/chrome/installer/setup/uninstall.cc
@@ -337,6 +337,26 @@ installer_util::InstallStatus IsChromeActiveOrUserCancelled(
return installer_util::UNINSTALL_CONFIRMED;
}
+
+bool ShouldDeleteProfile(const CommandLine& cmd_line,
+ installer_util::InstallStatus status) {
+ bool should_delete = false;
+
+ // Chrome Frame uninstallations always want to delete the profile (we have no
+ // UI to prompt otherwise and the profile stores no useful data anyway)
+ // unless they are managed by MSI. MSI uninstalls will explicitly include
+ // the --delete-profile flag to distinguish them from MSI upgrades.
+ if (InstallUtil::IsChromeFrameProcess() && !InstallUtil::IsMSIProcess()) {
+ should_delete = true;
+ } else {
+ should_delete =
+ status == installer_util::UNINSTALL_DELETE_PROFILE ||
+ cmd_line.HasSwitch(installer_util::switches::kDeleteProfile);
+ }
+
+ return should_delete;
+}
+
} // namespace
@@ -549,8 +569,7 @@ installer_util::InstallStatus installer_setup::UninstallChrome(
// Finally delete all the files from Chrome folder after moving setup.exe
// and the user's Local State to a temp location.
- bool delete_profile = (status == installer_util::UNINSTALL_DELETE_PROFILE) ||
- (cmd_line.HasSwitch(installer_util::switches::kDeleteProfile));
+ bool delete_profile = ShouldDeleteProfile(cmd_line, status);
std::wstring local_state_path;
ret = installer_util::UNINSTALL_SUCCESSFUL;
diff --git a/chrome/installer/util/util_constants.cc b/chrome/installer/util/util_constants.cc
index 5980992..183bb69 100644
--- a/chrome/installer/util/util_constants.cc
+++ b/chrome/installer/util/util_constants.cc
@@ -17,8 +17,8 @@ const wchar_t kChromeSxS[] = L"chrome-sxs";
// Create Desktop and QuickLaunch shortcuts
const wchar_t kCreateAllShortcuts[] = L"create-all-shortcuts";
-// Delete user profile also. This param is useful only when specified with
-// kUninstall && kForceUninstall, otherwise it is silently ignored.
+// Delete user profile data. This param is useful only when specified with
+// kUninstall, otherwise it is silently ignored.
const wchar_t kDeleteProfile[] = L"delete-profile";
// Disable logging