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

Side by Side Diff: chrome/installer/setup/install.cc

Issue 2273113002: Delete old files after an update. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@harvester
Patch Set: Created 4 years, 3 months 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 unified diff | Download patch
OLDNEW
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 #include "chrome/installer/setup/install.h" 5 #include "chrome/installer/setup/install.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <shlobj.h> 8 #include <shlobj.h>
9 #include <time.h> 9 #include <time.h>
10 10
(...skipping 14 matching lines...) Expand all
25 #include "chrome/common/chrome_switches.h" 25 #include "chrome/common/chrome_switches.h"
26 #include "chrome/installer/setup/install_worker.h" 26 #include "chrome/installer/setup/install_worker.h"
27 #include "chrome/installer/setup/installer_crash_reporting.h" 27 #include "chrome/installer/setup/installer_crash_reporting.h"
28 #include "chrome/installer/setup/setup_constants.h" 28 #include "chrome/installer/setup/setup_constants.h"
29 #include "chrome/installer/setup/setup_util.h" 29 #include "chrome/installer/setup/setup_util.h"
30 #include "chrome/installer/setup/update_active_setup_version_work_item.h" 30 #include "chrome/installer/setup/update_active_setup_version_work_item.h"
31 #include "chrome/installer/util/beacons.h" 31 #include "chrome/installer/util/beacons.h"
32 #include "chrome/installer/util/browser_distribution.h" 32 #include "chrome/installer/util/browser_distribution.h"
33 #include "chrome/installer/util/create_reg_key_work_item.h" 33 #include "chrome/installer/util/create_reg_key_work_item.h"
34 #include "chrome/installer/util/delete_after_reboot_helper.h" 34 #include "chrome/installer/util/delete_after_reboot_helper.h"
35 #include "chrome/installer/util/delete_old_versions.h"
35 #include "chrome/installer/util/google_update_constants.h" 36 #include "chrome/installer/util/google_update_constants.h"
36 #include "chrome/installer/util/helper.h" 37 #include "chrome/installer/util/helper.h"
37 #include "chrome/installer/util/install_util.h" 38 #include "chrome/installer/util/install_util.h"
38 #include "chrome/installer/util/master_preferences.h" 39 #include "chrome/installer/util/master_preferences.h"
39 #include "chrome/installer/util/master_preferences_constants.h" 40 #include "chrome/installer/util/master_preferences_constants.h"
40 #include "chrome/installer/util/set_reg_value_work_item.h" 41 #include "chrome/installer/util/set_reg_value_work_item.h"
41 #include "chrome/installer/util/shell_util.h" 42 #include "chrome/installer/util/shell_util.h"
42 #include "chrome/installer/util/util_constants.h" 43 #include "chrome/installer/util/util_constants.h"
43 #include "chrome/installer/util/work_item.h" 44 #include "chrome/installer/util/work_item.h"
44 #include "chrome/installer/util/work_item_list.h" 45 #include "chrome/installer/util/work_item_list.h"
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 673
673 if (!installer_state.system_install()) { 674 if (!installer_state.system_install()) {
674 DCHECK_EQ(chrome_product->distribution(), 675 DCHECK_EQ(chrome_product->distribution(),
675 BrowserDistribution::GetDistribution()); 676 BrowserDistribution::GetDistribution());
676 UpdateDefaultBrowserBeaconForPath( 677 UpdateDefaultBrowserBeaconForPath(
677 installer_state.target_path().Append(installer::kChromeExe)); 678 installer_state.target_path().Append(installer::kChromeExe));
678 } 679 }
679 } 680 }
680 681
681 installer_state.SetStage(REMOVING_OLD_VERSIONS); 682 installer_state.SetStage(REMOVING_OLD_VERSIONS);
682 683 // TODO(fdoray): Launch a cleanup process when this fails during a not-in-
683 installer_state.RemoveOldVersionDirectories( 684 // use update. crbug.com/451546
684 new_version, 685 DeleteOldVersions(installer_state.target_path());
685 existing_version.get(),
686 install_temp_path);
687 } 686 }
688 687
689 return result; 688 return result;
690 } 689 }
691 690
692 void HandleOsUpgradeForBrowser(const installer::InstallerState& installer_state, 691 void HandleOsUpgradeForBrowser(const installer::InstallerState& installer_state,
693 const installer::Product& chrome, 692 const installer::Product& chrome,
694 const base::Version& installed_version) { 693 const base::Version& installed_version) {
695 DCHECK(chrome.is_chrome()); 694 DCHECK(chrome.is_chrome());
696 695
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
780 // Read master_preferences copied beside chrome.exe at install. 779 // Read master_preferences copied beside chrome.exe at install.
781 MasterPreferences prefs(installation_root.AppendASCII(kDefaultMasterPrefs)); 780 MasterPreferences prefs(installation_root.AppendASCII(kDefaultMasterPrefs));
782 base::FilePath chrome_exe(installation_root.Append(kChromeExe)); 781 base::FilePath chrome_exe(installation_root.Append(kChromeExe));
783 CreateOrUpdateShortcuts( 782 CreateOrUpdateShortcuts(
784 chrome_exe, chrome, prefs, CURRENT_USER, install_operation); 783 chrome_exe, chrome, prefs, CURRENT_USER, install_operation);
785 784
786 UpdateDefaultBrowserBeaconForPath(chrome_exe); 785 UpdateDefaultBrowserBeaconForPath(chrome_exe);
787 } 786 }
788 787
789 } // namespace installer 788 } // namespace installer
OLDNEW
« no previous file with comments | « no previous file | chrome/installer/util/BUILD.gn » ('j') | chrome/installer/util/delete_old_versions.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698