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 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
648 } | 648 } |
649 } | 649 } |
650 | 650 |
651 // NOTE: Should the work done here, on Active Setup, change: kActiveSetupVersion | 651 // NOTE: Should the work done here, on Active Setup, change: kActiveSetupVersion |
652 // in install_worker.cc needs to be increased for Active Setup to invoke this | 652 // in install_worker.cc needs to be increased for Active Setup to invoke this |
653 // again for all users of this install. | 653 // again for all users of this install. |
654 void HandleActiveSetupForBrowser(const base::FilePath& installation_root, | 654 void HandleActiveSetupForBrowser(const base::FilePath& installation_root, |
655 const installer::Product& chrome, | 655 const installer::Product& chrome, |
656 bool force) { | 656 bool force) { |
657 DCHECK(chrome.is_chrome()); | 657 DCHECK(chrome.is_chrome()); |
| 658 |
| 659 // If the shortcuts are not being forcefully created we may want to forcefully |
| 660 // create them anyways if this Active Setup trigger is in response to an OS |
| 661 // update. |
| 662 force = force || InstallUtil::UpdateLastOSUpgradeHandledByActiveSetup( |
| 663 chrome.distribution()); |
| 664 |
658 // Only create shortcuts on Active Setup if the first run sentinel is not | 665 // Only create shortcuts on Active Setup if the first run sentinel is not |
659 // present for this user (as some shortcuts used to be installed on first | 666 // present for this user (as some shortcuts used to be installed on first |
660 // run and this could otherwise re-install shortcuts for users that have | 667 // run and this could otherwise re-install shortcuts for users that have |
661 // already deleted them in the past). | 668 // already deleted them in the past). |
662 // Decide whether to create the shortcuts or simply replace existing | 669 // Decide whether to create the shortcuts or simply replace existing |
663 // shortcuts; if the decision is to create them, only shortcuts whose matching | 670 // shortcuts; if the decision is to create them, only shortcuts whose matching |
664 // all-users shortcut isn't present on the system will be created. | 671 // all-users shortcut isn't present on the system will be created. |
665 InstallShortcutOperation install_operation = | 672 InstallShortcutOperation install_operation = |
666 (!force && InstallUtil::IsFirstRunSentinelPresent() ? | 673 (!force && InstallUtil::IsFirstRunSentinelPresent() ? |
667 INSTALL_SHORTCUT_REPLACE_EXISTING : | 674 INSTALL_SHORTCUT_REPLACE_EXISTING : |
668 INSTALL_SHORTCUT_CREATE_EACH_IF_NO_SYSTEM_LEVEL); | 675 INSTALL_SHORTCUT_CREATE_EACH_IF_NO_SYSTEM_LEVEL); |
669 | 676 |
670 // Read master_preferences copied beside chrome.exe at install. | 677 // Read master_preferences copied beside chrome.exe at install. |
671 MasterPreferences prefs(installation_root.AppendASCII(kDefaultMasterPrefs)); | 678 MasterPreferences prefs(installation_root.AppendASCII(kDefaultMasterPrefs)); |
672 base::FilePath chrome_exe(installation_root.Append(kChromeExe)); | 679 base::FilePath chrome_exe(installation_root.Append(kChromeExe)); |
673 CreateOrUpdateShortcuts( | 680 CreateOrUpdateShortcuts( |
674 chrome_exe, chrome, prefs, CURRENT_USER, install_operation); | 681 chrome_exe, chrome, prefs, CURRENT_USER, install_operation); |
675 | 682 |
676 UpdateDefaultBrowserBeaconForPath(chrome_exe); | 683 UpdateDefaultBrowserBeaconForPath(chrome_exe); |
677 } | 684 } |
678 | 685 |
679 } // namespace installer | 686 } // namespace installer |
OLD | NEW |