summaryrefslogtreecommitdiffstats
path: root/chrome/installer
diff options
context:
space:
mode:
authorrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-11 01:12:20 +0000
committerrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-11 01:12:20 +0000
commit1d3ab96728e057bcbf59f4f6cadf4ca1ff8cebbf (patch)
treea491b9d8c06a6a84f7d07379b4f2724f1ae9cc35 /chrome/installer
parent646ced1bc66dd0fcd98be699229e5440109c8456 (diff)
downloadchromium_src-1d3ab96728e057bcbf59f4f6cadf4ca1ff8cebbf.zip
chromium_src-1d3ab96728e057bcbf59f4f6cadf4ca1ff8cebbf.tar.gz
chromium_src-1d3ab96728e057bcbf59f4f6cadf4ca1ff8cebbf.tar.bz2
Try harder to clean up temp files in case we have a failed install / upgrade.
BUG=37497 TEST=Fail an upgrade (for example, try to apply a differential installer to the wrong base version) while somehow endeavouring to lock the temp files mid upgrade (a debugger or a quick hand will be necessary) and observe that the temp files are scheduled for deletion on reboot. Review URL: http://codereview.chromium.org/1936006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46883 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer')
-rw-r--r--chrome/installer/setup/setup_main.cc17
1 files changed, 16 insertions, 1 deletions
diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc
index 53d0918..c86a95a 100644
--- a/chrome/installer/setup/setup_main.cc
+++ b/chrome/installer/setup/setup_main.cc
@@ -24,6 +24,7 @@
#include "chrome/installer/setup/setup_util.h"
#include "chrome/installer/setup/uninstall.h"
#include "chrome/installer/util/browser_distribution.h"
+#include "chrome/installer/util/delete_after_reboot_helper.h"
#include "chrome/installer/util/delete_tree_work_item.h"
#include "chrome/installer/util/helper.h"
#include "chrome/installer/util/html_dialog.h"
@@ -373,7 +374,21 @@ installer_util::InstallStatus InstallChrome(const CommandLine& cmd_line,
installer_util::switches::kInstallerData);
cleanup_list->AddDeleteTreeWorkItem(prefs_path, std::wstring());
}
- cleanup_list->Do();
+
+ // The above cleanup has been observed to fail on several users machines.
+ // Specifically, it appears that the temp folder may be locked when we try
+ // to delete it. This is Rather Bad in the case where we have failed updates
+ // as we end up filling users' disks with large-ish temp files. To mitigate
+ // this, if we fail to delete the temp folders, then schedule them for
+ // deletion at next reboot.
+ if (!cleanup_list->Do()) {
+ ScheduleDirectoryForDeletion(temp_path.ToWStringHack().c_str());
+ if (cmd_line.HasSwitch(installer_util::switches::kInstallerData)) {
+ std::wstring prefs_path = cmd_line.GetSwitchValue(
+ installer_util::switches::kInstallerData);
+ ScheduleDirectoryForDeletion(prefs_path.c_str());
+ }
+ }
dist->UpdateDiffInstallStatus(system_level, incremental_install,
install_status);