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

Unified Diff: chrome/installer/setup/install.cc

Issue 11465025: Keep installing all-users Start Menu and Desktop shortcuts on system-level installs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/installer/setup/install.cc
diff --git a/chrome/installer/setup/install.cc b/chrome/installer/setup/install.cc
index 8726ee2f57a3245561a4ecab28cf04d66b5f4f69..62a7b8bd3fa8ac6206cfeaea8c5747d76518fb62 100644
--- a/chrome/installer/setup/install.cc
+++ b/chrome/installer/setup/install.cc
@@ -442,9 +442,13 @@ void CreateOrUpdateShortcuts(
if (!do_not_create_quick_launch_shortcut ||
shortcut_operation == ShellUtil::SHELL_SHORTCUT_REPLACE_EXISTING) {
+ // There is no such thing as an all-users Quick Launch shortcut, always
+ // install the per-user shortcut.
+ ShellUtil::ShortcutProperties quick_launch_properties(base_properties);
+ quick_launch_properties.level = ShellUtil::CURRENT_USER;
ExecuteAndLogShortcutOperation(
- ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH, dist, base_properties,
- shortcut_operation);
+ ShellUtil::SHORTCUT_LOCATION_QUICK_LAUNCH, dist,
+ quick_launch_properties, shortcut_operation);
}
ShellUtil::ShortcutProperties start_menu_properties(base_properties);
@@ -571,6 +575,14 @@ InstallStatus InstallOrUpdateProduct(
installer_state.target_path().Append(kChromeExe));
CleanupLegacyShortcuts(installer_state, dist, chrome_exe);
+ // Install per-user shortcuts on user-level installs and all-users
+ // shortcuts on system-level installs. Note that Active Setup will take
+ // care of installing missing per-user shortcuts on system-level install
+ // (i.e., quick launch, taskbar pin, and possibly deleted all-users
+ // shortcuts).
+ InstallShortcutLevel install_level = installer_state.system_install() ?
+ ALL_USERS : CURRENT_USER;
+
InstallShortcutOperation install_operation =
INSTALL_SHORTCUT_REPLACE_EXISTING;
if (result == installer::FIRST_INSTALL_SUCCESS ||
@@ -578,14 +590,7 @@ InstallStatus InstallOrUpdateProduct(
install_operation = INSTALL_SHORTCUT_CREATE_ALL;
}
- if (installer_state.system_install()) {
- // Update existing all-users shortcuts for legacy installs.
- CreateOrUpdateShortcuts(chrome_exe, *chrome_product, prefs, ALL_USERS,
- INSTALL_SHORTCUT_REPLACE_EXISTING);
- }
- // Always install per-user shortcuts (even on system-level installs where
- // we do so for the installing user instead of waiting for Active Setup).
- CreateOrUpdateShortcuts(chrome_exe, *chrome_product, prefs, CURRENT_USER,
+ CreateOrUpdateShortcuts(chrome_exe, *chrome_product, prefs, install_level,
install_operation);
}
@@ -652,7 +657,7 @@ void HandleOsUpgradeForBrowser(const InstallerState& installer_state,
// Unfortunately, if this is a system-level install, we can't update the
// shortcuts of each individual user (this only matters if this is an OS
- // upgrade for XP/Vista to Win7+ as some properties are only set on
+ // upgrade from XP/Vista to Win7+ as some properties are only set on
// shortcuts as of Win7).
// At least attempt to update potentially existing all-users shortcuts.
InstallShortcutLevel level = installer_state.system_install() ?
@@ -678,6 +683,9 @@ void HandleActiveSetupForBrowser(const FilePath& installation_root,
FilePath first_run_sentinel;
InstallUtil::GetSentinelFilePath(
chrome::kFirstRunSentinel, chrome.distribution(), &first_run_sentinel);
+ // Decide whether to create the shortcuts or simply replace existing
+ // shortcuts; if the decision is to create them, only shortcuts whose matching
+ // all-users shortcut isn't present on the system will be created.
InstallShortcutOperation install_operation =
(!force && file_util::PathExists(first_run_sentinel) ?
INSTALL_SHORTCUT_REPLACE_EXISTING :

Powered by Google App Engine
This is Rietveld 408576698