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 #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 738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
749 // NOTE: Should the work done here, on Active Setup, change: | 749 // NOTE: Should the work done here, on Active Setup, change: |
750 // kActiveSetupMajorVersion in update_active_setup_version_work_item.cc needs to | 750 // kActiveSetupMajorVersion in update_active_setup_version_work_item.cc needs to |
751 // be increased for Active Setup to invoke this again for all users of this | 751 // be increased for Active Setup to invoke this again for all users of this |
752 // install. It may also be invoked again when a system-level chrome install goes | 752 // install. It may also be invoked again when a system-level chrome install goes |
753 // through an OS upgrade. | 753 // through an OS upgrade. |
754 void HandleActiveSetupForBrowser(const base::FilePath& installation_root, | 754 void HandleActiveSetupForBrowser(const base::FilePath& installation_root, |
755 const installer::Product& chrome, | 755 const installer::Product& chrome, |
756 bool force) { | 756 bool force) { |
757 DCHECK(chrome.is_chrome()); | 757 DCHECK(chrome.is_chrome()); |
758 | 758 |
759 NoRollbackWorkItemList cleanup_list; | 759 std::unique_ptr<WorkItemList> cleanup_list(WorkItem::CreateWorkItemList()); |
760 AddCleanupDeprecatedPerUserRegistrationsWorkItems(chrome, &cleanup_list); | 760 cleanup_list->set_log_message("Cleanup deprecated per-user registrations"); |
761 cleanup_list.Do(); | 761 cleanup_list->set_rollback_enabled(false); |
| 762 cleanup_list->set_best_effort(true); |
| 763 AddCleanupDeprecatedPerUserRegistrationsWorkItems(chrome, cleanup_list.get()); |
| 764 cleanup_list->Do(); |
762 | 765 |
763 // Only create shortcuts on Active Setup if the first run sentinel is not | 766 // Only create shortcuts on Active Setup if the first run sentinel is not |
764 // present for this user (as some shortcuts used to be installed on first | 767 // present for this user (as some shortcuts used to be installed on first |
765 // run and this could otherwise re-install shortcuts for users that have | 768 // run and this could otherwise re-install shortcuts for users that have |
766 // already deleted them in the past). | 769 // already deleted them in the past). |
767 // Decide whether to create the shortcuts or simply replace existing | 770 // Decide whether to create the shortcuts or simply replace existing |
768 // shortcuts; if the decision is to create them, only shortcuts whose matching | 771 // shortcuts; if the decision is to create them, only shortcuts whose matching |
769 // all-users shortcut isn't present on the system will be created. | 772 // all-users shortcut isn't present on the system will be created. |
770 InstallShortcutOperation install_operation = | 773 InstallShortcutOperation install_operation = |
771 (!force && InstallUtil::IsFirstRunSentinelPresent()) | 774 (!force && InstallUtil::IsFirstRunSentinelPresent()) |
772 ? INSTALL_SHORTCUT_REPLACE_EXISTING | 775 ? INSTALL_SHORTCUT_REPLACE_EXISTING |
773 : INSTALL_SHORTCUT_CREATE_EACH_IF_NO_SYSTEM_LEVEL; | 776 : INSTALL_SHORTCUT_CREATE_EACH_IF_NO_SYSTEM_LEVEL; |
774 | 777 |
775 // Read master_preferences copied beside chrome.exe at install. | 778 // Read master_preferences copied beside chrome.exe at install. |
776 MasterPreferences prefs(installation_root.AppendASCII(kDefaultMasterPrefs)); | 779 MasterPreferences prefs(installation_root.AppendASCII(kDefaultMasterPrefs)); |
777 base::FilePath chrome_exe(installation_root.Append(kChromeExe)); | 780 base::FilePath chrome_exe(installation_root.Append(kChromeExe)); |
778 CreateOrUpdateShortcuts( | 781 CreateOrUpdateShortcuts( |
779 chrome_exe, chrome, prefs, CURRENT_USER, install_operation); | 782 chrome_exe, chrome, prefs, CURRENT_USER, install_operation); |
780 | 783 |
781 UpdateDefaultBrowserBeaconForPath(chrome_exe); | 784 UpdateDefaultBrowserBeaconForPath(chrome_exe); |
782 } | 785 } |
783 | 786 |
784 } // namespace installer | 787 } // namespace installer |
OLD | NEW |