| 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 610 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 621 // At least attempt to update potentially existing all-users shortcuts. | 621 // At least attempt to update potentially existing all-users shortcuts. |
| 622 InstallShortcutLevel level = installer_state.system_install() ? | 622 InstallShortcutLevel level = installer_state.system_install() ? |
| 623 ALL_USERS : CURRENT_USER; | 623 ALL_USERS : CURRENT_USER; |
| 624 base::FilePath chrome_exe(installer_state.target_path().Append(kChromeExe)); | 624 base::FilePath chrome_exe(installer_state.target_path().Append(kChromeExe)); |
| 625 CreateOrUpdateShortcuts( | 625 CreateOrUpdateShortcuts( |
| 626 chrome_exe, chrome, prefs, level, INSTALL_SHORTCUT_REPLACE_EXISTING); | 626 chrome_exe, chrome, prefs, level, INSTALL_SHORTCUT_REPLACE_EXISTING); |
| 627 RegisterChromeOnMachine(installer_state, chrome, false); | 627 RegisterChromeOnMachine(installer_state, chrome, false); |
| 628 | 628 |
| 629 UpdateOsUpgradeBeacon(installer_state.system_install(), | 629 UpdateOsUpgradeBeacon(installer_state.system_install(), |
| 630 BrowserDistribution::GetDistribution()); | 630 BrowserDistribution::GetDistribution()); |
| 631 if (!installer_state.system_install()) | 631 |
| 632 // Update the per-user default-browser-beacon. For user-level installs this |
| 633 // can be done directly; whereas it requires triggering Active Setup for |
| 634 // each users' subsequent login on system-level installs. |
| 635 if (!installer_state.system_install()) { |
| 632 UpdateDefaultBrowserBeaconForPath(chrome_exe); | 636 UpdateDefaultBrowserBeaconForPath(chrome_exe); |
| 637 } else { |
| 638 if (InstallUtil::UpdateActiveSetupVersion(chrome.distribution(), |
| 639 InstallUtil::OS_UPGRADES, |
| 640 InstallUtil::BUMP, 1)) { |
| 641 VLOG(1) << "Bumped Active Setup Version on-os-upgrade."; |
| 642 } else { |
| 643 LOG(ERROR) << "Bumping Active Setup Version on-os-upgrade failed."; |
| 644 } |
| 645 } |
| 633 } | 646 } |
| 634 } | 647 } |
| 635 | 648 |
| 636 // NOTE: Should the work done here, on Active Setup, change: kActiveSetupVersion | 649 // NOTE: Should the work done here, on Active Setup, change: kActiveSetupVersion |
| 637 // in install_worker.cc needs to be increased for Active Setup to invoke this | 650 // in install_worker.cc needs to be increased for Active Setup to invoke this |
| 638 // again for all users of this install. | 651 // again for all users of this install. |
| 639 void HandleActiveSetupForBrowser(const base::FilePath& installation_root, | 652 void HandleActiveSetupForBrowser(const base::FilePath& installation_root, |
| 640 const installer::Product& chrome, | 653 const installer::Product& chrome, |
| 641 bool force) { | 654 bool force) { |
| 642 DCHECK(chrome.is_chrome()); | 655 DCHECK(chrome.is_chrome()); |
| (...skipping 12 matching lines...) Expand all Loading... |
| 655 // Read master_preferences copied beside chrome.exe at install. | 668 // Read master_preferences copied beside chrome.exe at install. |
| 656 MasterPreferences prefs(installation_root.AppendASCII(kDefaultMasterPrefs)); | 669 MasterPreferences prefs(installation_root.AppendASCII(kDefaultMasterPrefs)); |
| 657 base::FilePath chrome_exe(installation_root.Append(kChromeExe)); | 670 base::FilePath chrome_exe(installation_root.Append(kChromeExe)); |
| 658 CreateOrUpdateShortcuts( | 671 CreateOrUpdateShortcuts( |
| 659 chrome_exe, chrome, prefs, CURRENT_USER, install_operation); | 672 chrome_exe, chrome, prefs, CURRENT_USER, install_operation); |
| 660 | 673 |
| 661 UpdateDefaultBrowserBeaconForPath(chrome_exe); | 674 UpdateDefaultBrowserBeaconForPath(chrome_exe); |
| 662 } | 675 } |
| 663 | 676 |
| 664 } // namespace installer | 677 } // namespace installer |
| OLD | NEW |