diff options
author | rahulk@google.com <rahulk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-05 17:30:38 +0000 |
---|---|---|
committer | rahulk@google.com <rahulk@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-05 17:30:38 +0000 |
commit | 4d562a7e2538a1396a4dbeae66aea33f4f4afcd3 (patch) | |
tree | 22017ef638d79153eee6f559773f182e43d6aa40 /chrome/installer | |
parent | 83f614694645507a493c366a9f6319efd9a9c3db (diff) | |
download | chromium_src-4d562a7e2538a1396a4dbeae66aea33f4f4afcd3.zip chromium_src-4d562a7e2538a1396a4dbeae66aea33f4f4afcd3.tar.gz chromium_src-4d562a7e2538a1396a4dbeae66aea33f4f4afcd3.tar.bz2 |
While uninstalling Chrome look for return codes from chrome.exe that indicate success instead of checking for failure codes. This will prevent us from uninstalling Chrome when chrome.exe process gets killed.
BUG=1307273
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@380 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer')
-rw-r--r-- | chrome/installer/setup/uninstall.cc | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc index 9403a8a..d742e62 100644 --- a/chrome/installer/setup/uninstall.cc +++ b/chrome/installer/setup/uninstall.cc @@ -119,8 +119,12 @@ installer_util::InstallStatus IsChromeActiveOrUserCancelled( int32 exit_code = ResultCodes::NORMAL_EXIT; bool is_timeout = false; - // We ignore all other errors such as whether launching chrome fails, - // whether chrome returns UNINSTALL_ERROR, etc. + // We want to continue with the uninstallation only when chrome.exe either + // returns NORMAL_EXIT (means Chrome is not running, user has confirmed + // uninstallation and sentinel file/desktop/ql shortcuts have been + // cleaned up) or UNINSTALL_DELETE_FILE_ERROR (means Chrome is not running, + // user has confirmed uninstallation but there was a problem with deleting + // sentinel file, desktop or ql shortcuts). LOG(INFO) << "Launching Chrome to do uninstall tasks."; if (installer::LaunchChromeAndWaitForResult(system_uninstall, kCmdLineOptions, @@ -128,18 +132,21 @@ installer_util::InstallStatus IsChromeActiveOrUserCancelled( &exit_code, &is_timeout)) { if (is_timeout || exit_code == ResultCodes::UNINSTALL_CHROME_ALIVE) { - LOG(ERROR) << "Can't uninstall when chrome is still running"; + LOG(INFO) << "Can't uninstall when chrome is still running"; return installer_util::CHROME_RUNNING; } else if (exit_code == ResultCodes::UNINSTALL_USER_CANCEL) { LOG(INFO) << "User cancelled uninstall operation"; return installer_util::UNINSTALL_CANCELLED; - } else if (exit_code == ResultCodes::UNINSTALL_ERROR) { - LOG(ERROR) << "chrome.exe reported error while uninstalling."; - return installer_util::UNINSTALL_FAILED; + } else if (exit_code == ResultCodes::NORMAL_EXIT) { + LOG(INFO) << "chrome.exe confirmed uninstallation from user."; + return installer_util::UNINSTALL_CONFIRMED; + } else if (exit_code == ResultCodes::UNINSTALL_DELETE_FILE_ERROR) { + LOG(ERROR) << "chrome.exe returned delete file error."; + return installer_util::UNINSTALL_CONFIRMED; } } - return installer_util::UNINSTALL_CONFIRMED; + return installer_util::UNINSTALL_FAILED; } // Read the URL from the resource file and substitute the locale parameter @@ -222,8 +229,7 @@ installer_util::InstallStatus installer_setup::UninstallChrome( const installer::Version& installed_version, bool remove_all) { installer_util::InstallStatus status = IsChromeActiveOrUserCancelled(system_uninstall); - if (status == installer_util::CHROME_RUNNING || - status == installer_util::UNINSTALL_CANCELLED) + if (status != installer_util::UNINSTALL_CONFIRMED) return status; // Uninstall Gears first. |