summaryrefslogtreecommitdiffstats
path: root/chrome/installer/setup
diff options
context:
space:
mode:
authorgab <gab@chromium.org>2015-08-13 08:22:11 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-13 15:22:48 +0000
commite809b5be93b00265acffcb8237b889de25fce83c (patch)
treeb4938110f64b26a9168abaf2b028758d74f9da27 /chrome/installer/setup
parent346c7c687e3eadb7835efa832ed8cb36b1cb1f5e (diff)
downloadchromium_src-e809b5be93b00265acffcb8237b889de25fce83c.zip
chromium_src-e809b5be93b00265acffcb8237b889de25fce83c.tar.gz
chromium_src-e809b5be93b00265acffcb8237b889de25fce83c.tar.bz2
Remove Win8+ condition from HandleOsUpgradeForBrowser().
HandleOsUpgradeForBrowser() used to be only about installing Metro assets. It's now a lot more about making sure Chrome is properly installed on any new Windows OS without having to wait for an explicit auto-update to fix things. BUG=None Review URL: https://codereview.chromium.org/1277003003 Cr-Commit-Position: refs/heads/master@{#343198}
Diffstat (limited to 'chrome/installer/setup')
-rw-r--r--chrome/installer/setup/install.cc104
1 files changed, 49 insertions, 55 deletions
diff --git a/chrome/installer/setup/install.cc b/chrome/installer/setup/install.cc
index edc7cc5..60e368b 100644
--- a/chrome/installer/setup/install.cc
+++ b/chrome/installer/setup/install.cc
@@ -621,63 +621,57 @@ void HandleOsUpgradeForBrowser(const installer::InstallerState& installer_state,
const base::Version& installed_version) {
DCHECK(chrome.is_chrome());
- // Upon upgrading to Windows 8, we need to fix Chrome shortcuts and register
- // Chrome, so that Metro Chrome would work if Chrome is the default browser.
- // TODO(gab): This now handles more than just the Win8 things and this
- // condition should be removed.
- if (base::win::GetVersion() >= base::win::VERSION_WIN8) {
- VLOG(1) << "Updating and registering shortcuts.";
- // Read master_preferences copied beside chrome.exe at install.
- const MasterPreferences prefs(
- installer_state.target_path().AppendASCII(kDefaultMasterPrefs));
-
- // Update shortcuts at this install level, per-user shortcuts on system-
- // level will be updated through Active Setup.
- const InstallShortcutLevel level =
- installer_state.system_install() ? ALL_USERS : CURRENT_USER;
- const base::FilePath chrome_exe(
- installer_state.target_path().Append(kChromeExe));
- CreateOrUpdateShortcuts(chrome_exe, chrome, prefs, level,
- INSTALL_SHORTCUT_REPLACE_EXISTING);
-
- // Adapt Chrome registrations to this new OS.
- RegisterChromeOnMachine(installer_state, chrome, false);
-
- // Active Setup registrations are sometimes lost across OS update, make sure
- // they're back in place. Note: when Active Setup registrations in HKLM are
- // lost, the per-user values of performed Active Setups in HKCU are also
- // lost, so it is fine to restart the dynamic components of the Active Setup
- // version (ref. UpdateActiveSetupVersionWorkItem) from scratch.
- // TODO(gab): This should really perform all registry only update steps
- // (i.e., something between InstallOrUpdateProduct and
- // AddActiveSetupWorkItems, but this takes care of what is most required for
- // now).
- scoped_ptr<WorkItemList> work_item_list(WorkItem::CreateWorkItemList());
- AddActiveSetupWorkItems(installer_state, installed_version, chrome,
- work_item_list.get());
- if (!work_item_list->Do()) {
- LOG(WARNING) << "Failed to reinstall Active Setup keys.";
- work_item_list->Rollback();
- }
+ VLOG(1) << "Updating and registering shortcuts for --on-os-upgrade.";
- UpdateOsUpgradeBeacon(installer_state.system_install(),
- BrowserDistribution::GetDistribution());
+ // Read master_preferences copied beside chrome.exe at install.
+ const MasterPreferences prefs(
+ installer_state.target_path().AppendASCII(kDefaultMasterPrefs));
- // Update the per-user default browser beacon. For user-level installs this
- // can be done directly; whereas it requires triggering Active Setup for
- // each user's subsequent login on system-level installs.
- if (!installer_state.system_install()) {
- UpdateDefaultBrowserBeaconForPath(chrome_exe);
- } else {
- UpdateActiveSetupVersionWorkItem active_setup_work_item(
- InstallUtil::GetActiveSetupPath(chrome.distribution()),
- UpdateActiveSetupVersionWorkItem::
- UPDATE_AND_BUMP_OS_UPGRADES_COMPONENT);
- if (active_setup_work_item.Do())
- VLOG(1) << "Bumped Active Setup Version on-os-upgrade.";
- else
- LOG(ERROR) << "Failed to bump Active Setup Version on-os-upgrade.";
- }
+ // Update shortcuts at this install level (per-user shortcuts on system-level
+ // installs will be updated through Active Setup).
+ const InstallShortcutLevel level =
+ installer_state.system_install() ? ALL_USERS : CURRENT_USER;
+ const base::FilePath chrome_exe(
+ installer_state.target_path().Append(kChromeExe));
+ CreateOrUpdateShortcuts(chrome_exe, chrome, prefs, level,
+ INSTALL_SHORTCUT_REPLACE_EXISTING);
+
+ // Adapt Chrome registrations to this new OS.
+ RegisterChromeOnMachine(installer_state, chrome, false);
+
+ // Active Setup registrations are sometimes lost across OS update, make sure
+ // they're back in place. Note: when Active Setup registrations in HKLM are
+ // lost, the per-user values of performed Active Setups in HKCU are also lost,
+ // so it is fine to restart the dynamic components of the Active Setup version
+ // (ref. UpdateActiveSetupVersionWorkItem) from scratch.
+ // TODO(gab): This should really perform all registry only update steps (i.e.,
+ // something between InstallOrUpdateProduct and AddActiveSetupWorkItems, but
+ // this takes care of what is most required for now).
+ scoped_ptr<WorkItemList> work_item_list(WorkItem::CreateWorkItemList());
+ AddActiveSetupWorkItems(installer_state, installed_version, chrome,
+ work_item_list.get());
+ if (!work_item_list->Do()) {
+ LOG(WARNING) << "Failed to reinstall Active Setup keys.";
+ work_item_list->Rollback();
+ }
+
+ UpdateOsUpgradeBeacon(installer_state.system_install(),
+ BrowserDistribution::GetDistribution());
+
+ // Update the per-user default browser beacon. For user-level installs this
+ // can be done directly; whereas it requires triggering Active Setup for each
+ // user's subsequent login on system-level installs.
+ if (!installer_state.system_install()) {
+ UpdateDefaultBrowserBeaconForPath(chrome_exe);
+ } else {
+ UpdateActiveSetupVersionWorkItem active_setup_work_item(
+ InstallUtil::GetActiveSetupPath(chrome.distribution()),
+ UpdateActiveSetupVersionWorkItem::
+ UPDATE_AND_BUMP_OS_UPGRADES_COMPONENT);
+ if (active_setup_work_item.Do())
+ VLOG(1) << "Bumped Active Setup Version on-os-upgrade.";
+ else
+ LOG(ERROR) << "Failed to bump Active Setup Version on-os-upgrade.";
}
}