From c6e89201faff8f99401daaa604b78d3a5e5070ea Mon Sep 17 00:00:00 2001 From: "robertshield@chromium.org" Date: Thu, 11 Mar 2010 21:45:57 +0000 Subject: If running under an MSI, setup.exe must always return 0 on uninstallation. BUG=19370 TEST=None Review URL: http://codereview.chromium.org/755002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41322 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/installer/setup/setup_main.cc | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'chrome/installer') diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc index 4c9e6c9..96339e0 100644 --- a/chrome/installer/setup/setup_main.cc +++ b/chrome/installer/setup/setup_main.cc @@ -708,8 +708,17 @@ int WINAPI wWinMain(HINSTANCE instance, HINSTANCE prev_instance, } } - // Note that we allow the status installer_util::UNINSTALL_REQUIRES_REBOOT - // to pass through, since this is only returned on uninstall which is never - // invoked directly by Google Update. - return dist->GetInstallReturnCode(install_status); + int return_code = 0; + // MSI demands that custom actions always return 0 (ERROR_SUCCESS) or it will + // rollback the action. If we're uninstalling we want to avoid this, so always + // report success, squashing any more informative return codes. + if (!(parsed_command_line.HasSwitch(installer_util::switches::kMsi) && + parsed_command_line.HasSwitch(installer_util::switches::kUninstall))) { + // Note that we allow the status installer_util::UNINSTALL_REQUIRES_REBOOT + // to pass through, since this is only returned on uninstall which is never + // invoked directly by Google Update. + dist->GetInstallReturnCode(install_status); + } + + return return_code; } -- cgit v1.1