diff options
Diffstat (limited to 'chrome/installer/setup')
-rw-r--r-- | chrome/installer/setup/install.cc | 2 | ||||
-rw-r--r-- | chrome/installer/setup/main.cc | 14 | ||||
-rw-r--r-- | chrome/installer/setup/setup.cc | 2 | ||||
-rw-r--r-- | chrome/installer/setup/uninstall.cc | 23 | ||||
-rw-r--r-- | chrome/installer/setup/uninstall.h | 5 |
5 files changed, 29 insertions, 17 deletions
diff --git a/chrome/installer/setup/install.cc b/chrome/installer/setup/install.cc index 5d65dbf..7a0a2dd 100644 --- a/chrome/installer/setup/install.cc +++ b/chrome/installer/setup/install.cc @@ -52,7 +52,7 @@ void AddUninstallShortcutWorkItems(HKEY reg_root, uninstall_cmd.append(installer_util::switches::kUninstall); if (reg_root == HKEY_LOCAL_MACHINE) { uninstall_cmd.append(L" --"); - uninstall_cmd.append(installer_util::switches::kSystemInstall); + uninstall_cmd.append(installer_util::switches::kSystemLevel); } // Create DisplayName, UninstallString and InstallLocation keys diff --git a/chrome/installer/setup/main.cc b/chrome/installer/setup/main.cc index d9b4bc6..cf08d34 100644 --- a/chrome/installer/setup/main.cc +++ b/chrome/installer/setup/main.cc @@ -253,17 +253,17 @@ installer_util::InstallStatus InstallChrome(const CommandLine& cmd_line, installer_util::InstallStatus UninstallChrome(const CommandLine& cmd_line, const installer::Version* version, bool system_install) { - bool remove_all = true; - if (cmd_line.HasSwitch(installer_util::switches::kDoNotRemoveSharedItems)) - remove_all = false; LOG(INFO) << "Uninstalling Chome"; if (!version) { LOG(ERROR) << "No Chrome installation found for uninstall."; return installer_util::CHROME_NOT_INSTALLED; - } else { - return installer_setup::UninstallChrome(cmd_line.program(), system_install, - *version, remove_all); } + + bool remove_all = !cmd_line.HasSwitch( + installer_util::switches::kDoNotRemoveSharedItems); + bool force = cmd_line.HasSwitch(installer_util::switches::kForceUninstall); + return installer_setup::UninstallChrome(cmd_line.program(), system_install, + *version, remove_all, force); } } // namespace @@ -290,7 +290,7 @@ int WINAPI wWinMain(HINSTANCE instance, HINSTANCE prev_instance, } bool system_install = - parsed_command_line.HasSwitch(installer_util::switches::kSystemInstall); + parsed_command_line.HasSwitch(installer_util::switches::kSystemLevel); LOG(INFO) << "system install is " << system_install; // Check to avoid simultaneous per-user and per-machine installs. diff --git a/chrome/installer/setup/setup.cc b/chrome/installer/setup/setup.cc index e3edf19..0f5b629 100644 --- a/chrome/installer/setup/setup.cc +++ b/chrome/installer/setup/setup.cc @@ -132,7 +132,7 @@ bool CreateOrUpdateChromeShortcuts(const std::wstring& exe_path, arguments.append(installer_util::switches::kUninstall); if (system_install) { arguments.append(L" --"); - arguments.append(installer_util::switches::kSystemInstall); + arguments.append(installer_util::switches::kSystemLevel); } LOG(INFO) << "Creating/updating uninstall link at " << uninstall_link; diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc index 4988e54..dfaafb0 100644 --- a/chrome/installer/setup/uninstall.cc +++ b/chrome/installer/setup/uninstall.cc @@ -81,8 +81,14 @@ bool DeleteFilesAndFolders(const std::wstring& exe_path, bool system_uninstall, file_util::Move(setup_exe, temp_file); LOG(INFO) << "Deleting install path " << install_path; - if (!file_util::Delete(install_path, true)) - LOG(ERROR) << "Failed to delete folder: " << install_path; + if (!file_util::Delete(install_path, true)) { + LOG(ERROR) << "Failed to delete folder (1st try): " << install_path; + // This is to let any closing chrome.exe die before trying delete one + // more time. + Sleep(10000); + if (!file_util::Delete(install_path, true)) + LOG(ERROR) << "Failed to delete folder (2nd try): " << install_path; + } // Now check and delete if the parent directories are empty // For example Google\Chrome or Chromium @@ -163,11 +169,14 @@ installer_util::InstallStatus IsChromeActiveOrUserCancelled( installer_util::InstallStatus installer_setup::UninstallChrome( const std::wstring& exe_path, bool system_uninstall, - const installer::Version& installed_version, bool remove_all) { - installer_util::InstallStatus status = - IsChromeActiveOrUserCancelled(system_uninstall); - if (status != installer_util::UNINSTALL_CONFIRMED) - return status; + const installer::Version& installed_version, + bool remove_all, bool force_uninstall) { + if (!force_uninstall) { + installer_util::InstallStatus status = + IsChromeActiveOrUserCancelled(system_uninstall); + if (status != installer_util::UNINSTALL_CONFIRMED) + return status; + } #if defined(GOOGLE_CHROME_BUILD) // TODO(rahulk): This should be done by DoPreUninstallOperations call above diff --git a/chrome/installer/setup/uninstall.h b/chrome/installer/setup/uninstall.h index eda077e..9004636 100644 --- a/chrome/installer/setup/uninstall.h +++ b/chrome/installer/setup/uninstall.h @@ -22,9 +22,12 @@ namespace installer_setup { // current user. // installed_version: currently installed version of Chrome. // remove_all: Remove all shared files, registry entries as well. +// force_uninstall: Uninstall without prompting for user confirmation or +// any checks for Chrome running. installer_util::InstallStatus UninstallChrome( const std::wstring& exe_path, bool system_uninstall, - const installer::Version& installed_version, bool remove_all); + const installer::Version& installed_version, + bool remove_all, bool force_uninstall); } // namespace installer_setup |