Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2249)

Unified Diff: chrome/installer/setup/main.cc

Issue 99229: Fix the uninstall failures caused by elevated uninstaller. (Closed)
Patch Set: Created 11 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/installer/setup/uninstall.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/setup/main.cc
diff --git a/chrome/installer/setup/main.cc b/chrome/installer/setup/main.cc
index 4731b2f08c1ab322f78c55c2d58c39e30de1eb41..20fb65cfadcde5f2e595fcdb8ae6983fe108e5bb 100644
--- a/chrome/installer/setup/main.cc
+++ b/chrome/installer/setup/main.cc
@@ -458,7 +458,8 @@ installer_util::InstallStatus UninstallChrome(const CommandLine& cmd_line,
const installer::Version* version,
bool system_install) {
LOG(INFO) << "Uninstalling Chome";
- if (!version) {
+ bool force = cmd_line.HasSwitch(installer_util::switches::kForceUninstall);
+ if (!version && !force) {
LOG(ERROR) << "No Chrome installation found for uninstall.";
InstallUtil::WriteInstallerResult(system_install,
installer_util::CHROME_NOT_INSTALLED,
@@ -468,29 +469,9 @@ installer_util::InstallStatus UninstallChrome(const CommandLine& cmd_line,
bool remove_all = !cmd_line.HasSwitch(
installer_util::switches::kDoNotRemoveSharedItems);
- bool force = cmd_line.HasSwitch(installer_util::switches::kForceUninstall);
-
- // Check if we need admin rights to cleanup HKLM. Try to elevate - if it works
- // exit from this process, if not just continue uninstalling in the current
- // process itself.
- if (remove_all &&
- ShellUtil::AdminNeededForRegistryCleanup() &&
- !IsUserAnAdmin() &&
- (win_util::GetWinVersion() >= win_util::WINVERSION_VISTA) &&
- !cmd_line.HasSwitch(installer_util::switches::kRunAsAdmin)) {
- std::wstring exe = cmd_line.program();
- std::wstring params(cmd_params);
- // Append --run-as-admin flag to let the new instance of setup.exe know
- // that we already tried to launch ourselves as admin.
- params.append(L" --");
- params.append(installer_util::switches::kRunAsAdmin);
- DWORD exit_code = installer_util::UNKNOWN_STATUS;
- if (InstallUtil::ExecuteExeAsAdmin(exe, params, &exit_code))
- return static_cast<installer_util::InstallStatus>(exit_code);
- }
-
return installer_setup::UninstallChrome(cmd_line.program(), system_install,
- *version, remove_all, force);
+ remove_all, force,
+ cmd_line, cmd_params);
}
installer_util::InstallStatus ShowEULADialog(const std::wstring& inner_frame) {
« no previous file with comments | « no previous file | chrome/installer/setup/uninstall.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698