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

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

Issue 811283002: [Installer] Cleaning up dead code for App Launcher / App Host installs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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
Index: chrome/installer/setup/uninstall.cc
diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc
index 0eb961ad2379abb63251967f32bf3a34bd2a9b5c..41e988b8a8a62ab604a79a895b1e40ad2c9ae393 100644
--- a/chrome/installer/setup/uninstall.cc
+++ b/chrome/installer/setup/uninstall.cc
@@ -26,6 +26,7 @@
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_result_codes.h"
+#include "chrome/installer/setup/app_launcher_installer.h"
#include "chrome/installer/setup/install.h"
#include "chrome/installer/setup/install_worker.h"
#include "chrome/installer/setup/setup_constants.h"
@@ -188,8 +189,7 @@ void ClearRlzProductState() {
// Decides whether setup.exe and the installer archive should be removed based
// on the original and installer states:
// * non-multi product being uninstalled: remove both
-// * any multi product left besides App Host: keep both
-// * only App Host left: keep setup.exe
+// * any multi product left: keep both
void CheckShouldRemoveSetupAndArchive(const InstallationState& original_state,
const InstallerState& installer_state,
bool* remove_setup,
@@ -197,8 +197,8 @@ void CheckShouldRemoveSetupAndArchive(const InstallationState& original_state,
*remove_setup = true;
*remove_archive = true;
- // If any multi-install product is left (other than App Host) we must leave
- // the installer and archive. For the App Host, we only leave the installer.
+ // If any multi-install product is left we must leave the installer and
+ // archive.
if (!installer_state.is_multi_install()) {
VLOG(1) << "Removing all installer files for a non-multi installation.";
} else {
@@ -215,16 +215,9 @@ void CheckShouldRemoveSetupAndArchive(const InstallationState& original_state,
// setup.exe will not be removed as there is a remaining multi-install
// product.
*remove_setup = false;
- // As a special case, we can still remove the actual archive if the
- // only remaining product is the App Host.
- if (dist_type != BrowserDistribution::CHROME_APP_HOST) {
- VLOG(1) << "Keeping all installer files due to a remaining "
- << "multi-install product.";
- *remove_archive = false;
- return;
- }
- VLOG(1) << "Keeping setup.exe due to a remaining "
- << "app-host installation.";
+ VLOG(1) << "Keeping all installer files due to a remaining "
+ << "multi-install product.";
+ return;
}
}
VLOG(1) << "Removing the installer archive.";
@@ -513,28 +506,6 @@ bool MoveSetupOutOfInstallFolder(const InstallerState& installer_state,
return true;
}
-DeleteResult DeleteAppHostFilesAndFolders(const InstallerState& installer_state,
- const Version& installed_version) {
- const base::FilePath& target_path = installer_state.target_path();
- if (target_path.empty()) {
- LOG(ERROR) << "DeleteAppHostFilesAndFolders: no installation destination "
- << "path.";
- return DELETE_FAILED; // Nothing else we can do to uninstall, so we return.
- }
-
- DeleteInstallTempDir(target_path);
-
- DeleteResult result = DELETE_SUCCEEDED;
-
- base::FilePath app_host_exe(target_path.Append(installer::kChromeAppHostExe));
- if (!base::DeleteFile(app_host_exe, false)) {
- result = DELETE_FAILED;
- LOG(ERROR) << "Failed to delete path: " << app_host_exe.value();
- }
-
- return result;
-}
-
DeleteResult DeleteChromeFilesAndFolders(const InstallerState& installer_state,
const base::FilePath& setup_exe) {
const base::FilePath& target_path = installer_state.target_path();
@@ -561,8 +532,6 @@ DeleteResult DeleteChromeFilesAndFolders(const InstallerState& installer_state,
base::FileEnumerator::FILES | base::FileEnumerator::DIRECTORIES);
for (base::FilePath to_delete = file_enumerator.Next(); !to_delete.empty();
to_delete = file_enumerator.Next()) {
- if (to_delete.BaseName().value() == installer::kChromeAppHostExe)
- continue;
if (!installer_directory.empty() &&
(to_delete == installer_directory ||
installer_directory.IsParent(to_delete) ||
@@ -1277,20 +1246,8 @@ InstallStatus UninstallProduct(const InstallationState& original_state,
// unregistered.
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL);
- // TODO(huangs): Implement actual migration code and remove the hack below.
- // Remove the "shadow" App Launcher registry keys.
- // TODO(hunags): Management of this key should not be conditional on
- // multi-install since the app list feature is available regardless of how
- // chrome is installed.
if (installer_state.is_multi_install()) {
- // Delete the "shadow" keys.
- BrowserDistribution* shadow_app_launcher_dist =
- BrowserDistribution::GetSpecificDistribution(
- BrowserDistribution::CHROME_APP_HOST);
- InstallUtil::DeleteRegistryKey(
- reg_root,
- shadow_app_launcher_dist->GetVersionKey(),
- KEY_WOW64_32KEY);
+ AppLauncherInstaller::OnUninstall(reg_root);
grt (UTC plus 2) 2014/12/18 19:27:36 this should be done in the "if (is_chrome)" block
huangs 2015/01/05 06:01:12 Done.
}
}
@@ -1368,10 +1325,7 @@ InstallStatus UninstallProduct(const InstallationState& original_state,
delete_profile = false;
}
- if (product.is_chrome_app_host()) {
- DeleteAppHostFilesAndFolders(installer_state, product_state->version());
- } else if (!installer_state.is_multi_install() ||
- product.is_chrome_binaries()) {
+ if (!installer_state.is_multi_install() || product.is_chrome_binaries()) {
DeleteResult delete_result = DeleteChromeFilesAndFolders(
installer_state, base::MakeAbsoluteFilePath(setup_exe));
if (delete_result == DELETE_FAILED) {

Powered by Google App Engine
This is Rietveld 408576698