| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 // This file defines the methods useful for uninstalling Chrome. | 5 // This file defines the methods useful for uninstalling Chrome. |
| 6 | 6 |
| 7 #include "chrome/installer/setup/uninstall.h" | 7 #include "chrome/installer/setup/uninstall.h" |
| 8 | 8 |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 | 10 |
| (...skipping 1299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1310 // (aka non-multi) installation or we are the Chrome Binaries. | 1310 // (aka non-multi) installation or we are the Chrome Binaries. |
| 1311 | 1311 |
| 1312 std::vector<base::FilePath> local_state_folders; | 1312 std::vector<base::FilePath> local_state_folders; |
| 1313 GetLocalStateFolders(product, &local_state_folders); | 1313 GetLocalStateFolders(product, &local_state_folders); |
| 1314 base::FilePath backup_state_file(BackupLocalStateFile(local_state_folders)); | 1314 base::FilePath backup_state_file(BackupLocalStateFile(local_state_folders)); |
| 1315 | 1315 |
| 1316 if (product.is_chrome_app_host()) { | 1316 if (product.is_chrome_app_host()) { |
| 1317 DeleteAppHostFilesAndFolders(installer_state, product_state->version()); | 1317 DeleteAppHostFilesAndFolders(installer_state, product_state->version()); |
| 1318 } else if (!installer_state.is_multi_install() || | 1318 } else if (!installer_state.is_multi_install() || |
| 1319 product.is_chrome_binaries()) { | 1319 product.is_chrome_binaries()) { |
| 1320 base::FilePath setup_exe(cmd_line.GetProgram()); | 1320 base::FilePath setup_exe(base::MakeAbsoluteFilePath(cmd_line.GetProgram())); |
| 1321 file_util::AbsolutePath(&setup_exe); | |
| 1322 DeleteResult delete_result = DeleteChromeFilesAndFolders( | 1321 DeleteResult delete_result = DeleteChromeFilesAndFolders( |
| 1323 installer_state, setup_exe); | 1322 installer_state, setup_exe); |
| 1324 if (delete_result == DELETE_FAILED) { | 1323 if (delete_result == DELETE_FAILED) { |
| 1325 ret = installer::UNINSTALL_FAILED; | 1324 ret = installer::UNINSTALL_FAILED; |
| 1326 } else if (delete_result == DELETE_REQUIRES_REBOOT) { | 1325 } else if (delete_result == DELETE_REQUIRES_REBOOT) { |
| 1327 ret = installer::UNINSTALL_REQUIRES_REBOOT; | 1326 ret = installer::UNINSTALL_REQUIRES_REBOOT; |
| 1328 } | 1327 } |
| 1329 } | 1328 } |
| 1330 | 1329 |
| 1331 if (delete_profile) | 1330 if (delete_profile) |
| (...skipping 21 matching lines...) Expand all Loading... |
| 1353 if (*uninstall_status != installer::UNINSTALL_SUCCESSFUL && | 1352 if (*uninstall_status != installer::UNINSTALL_SUCCESSFUL && |
| 1354 *uninstall_status != installer::UNINSTALL_REQUIRES_REBOOT) { | 1353 *uninstall_status != installer::UNINSTALL_REQUIRES_REBOOT) { |
| 1355 return; | 1354 return; |
| 1356 } | 1355 } |
| 1357 const base::FilePath target_path(installer_state.target_path()); | 1356 const base::FilePath target_path(installer_state.target_path()); |
| 1358 if (target_path.empty()) { | 1357 if (target_path.empty()) { |
| 1359 LOG(ERROR) << "No installation destination path."; | 1358 LOG(ERROR) << "No installation destination path."; |
| 1360 *uninstall_status = installer::UNINSTALL_FAILED; | 1359 *uninstall_status = installer::UNINSTALL_FAILED; |
| 1361 return; | 1360 return; |
| 1362 } | 1361 } |
| 1363 base::FilePath setup_exe(cmd_line.GetProgram()); | 1362 base::FilePath setup_exe(base::MakeAbsoluteFilePath(cmd_line.GetProgram())); |
| 1364 file_util::AbsolutePath(&setup_exe); | |
| 1365 if (!target_path.IsParent(setup_exe)) { | 1363 if (!target_path.IsParent(setup_exe)) { |
| 1366 LOG(INFO) << "setup.exe is not in target path. Skipping installer cleanup."; | 1364 LOG(INFO) << "setup.exe is not in target path. Skipping installer cleanup."; |
| 1367 return; | 1365 return; |
| 1368 } | 1366 } |
| 1369 base::FilePath install_directory(setup_exe.DirName()); | 1367 base::FilePath install_directory(setup_exe.DirName()); |
| 1370 | 1368 |
| 1371 bool remove_setup = true; | 1369 bool remove_setup = true; |
| 1372 bool remove_archive = true; | 1370 bool remove_archive = true; |
| 1373 CheckShouldRemoveSetupAndArchive(original_state, installer_state, | 1371 CheckShouldRemoveSetupAndArchive(original_state, installer_state, |
| 1374 &remove_setup, &remove_archive); | 1372 &remove_setup, &remove_archive); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1416 // deletion unconditionally. If they are not empty, the session manager | 1414 // deletion unconditionally. If they are not empty, the session manager |
| 1417 // will not delete them on reboot. | 1415 // will not delete them on reboot. |
| 1418 ScheduleParentAndGrandparentForDeletion(target_path); | 1416 ScheduleParentAndGrandparentForDeletion(target_path); |
| 1419 } else if (DeleteApplicationProductAndVendorDirectories(target_path) == | 1417 } else if (DeleteApplicationProductAndVendorDirectories(target_path) == |
| 1420 installer::DELETE_FAILED) { | 1418 installer::DELETE_FAILED) { |
| 1421 *uninstall_status = installer::UNINSTALL_FAILED; | 1419 *uninstall_status = installer::UNINSTALL_FAILED; |
| 1422 } | 1420 } |
| 1423 } | 1421 } |
| 1424 | 1422 |
| 1425 } // namespace installer | 1423 } // namespace installer |
| OLD | NEW |