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

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: CR grt #4 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
« no previous file with comments | « no previous file | chrome/installer/util/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 628 matching lines...) Expand 10 before | Expand all | Expand 10 after
673 674
674 if (!installer_state.system_install()) { 675 if (!installer_state.system_install()) {
675 DCHECK_EQ(chrome_product->distribution(), 676 DCHECK_EQ(chrome_product->distribution(),
676 BrowserDistribution::GetDistribution()); 677 BrowserDistribution::GetDistribution());
677 UpdateDefaultBrowserBeaconForPath( 678 UpdateDefaultBrowserBeaconForPath(
678 installer_state.target_path().Append(installer::kChromeExe)); 679 installer_state.target_path().Append(installer::kChromeExe));
679 } 680 }
680 } 681 }
681 682
682 installer_state.SetStage(REMOVING_OLD_VERSIONS); 683 installer_state.SetStage(REMOVING_OLD_VERSIONS);
683 684 // TODO(fdoray): Launch a cleanup process when this fails during a not-in-
684 installer_state.RemoveOldVersionDirectories( 685 // use update. crbug.com/451546
685 new_version, 686 DeleteOldVersions(installer_state.target_path());
686 existing_version.get(),
687 install_temp_path);
688 } 687 }
689 688
690 return result; 689 return result;
691 } 690 }
692 691
693 void HandleOsUpgradeForBrowser(const installer::InstallerState& installer_state, 692 void HandleOsUpgradeForBrowser(const installer::InstallerState& installer_state,
694 const installer::Product& chrome, 693 const installer::Product& chrome,
695 const base::Version& installed_version) { 694 const base::Version& installed_version) {
696 DCHECK(chrome.is_chrome()); 695 DCHECK(chrome.is_chrome());
697 696
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
781 // Read master_preferences copied beside chrome.exe at install. 780 // Read master_preferences copied beside chrome.exe at install.
782 MasterPreferences prefs(installation_root.AppendASCII(kDefaultMasterPrefs)); 781 MasterPreferences prefs(installation_root.AppendASCII(kDefaultMasterPrefs));
783 base::FilePath chrome_exe(installation_root.Append(kChromeExe)); 782 base::FilePath chrome_exe(installation_root.Append(kChromeExe));
784 CreateOrUpdateShortcuts( 783 CreateOrUpdateShortcuts(
785 chrome_exe, chrome, prefs, CURRENT_USER, install_operation); 784 chrome_exe, chrome, prefs, CURRENT_USER, install_operation);
786 785
787 UpdateDefaultBrowserBeaconForPath(chrome_exe); 786 UpdateDefaultBrowserBeaconForPath(chrome_exe);
788 } 787 }
789 788
790 } // namespace installer 789 } // namespace installer
OLDNEW
« no previous file with comments | « no previous file | chrome/installer/util/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698