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

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

Issue 10889028: Install a user-level Start Menu shortcut for every user on system-installs through Active Setup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months 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 ffd0f2b055db97a726f85846a1b7f13a0c8d5437..b9f8ae48ce8004b3ce849e0ad7227128c6aee75d 100644
--- a/chrome/installer/setup/install.cc
+++ b/chrome/installer/setup/install.cc
@@ -315,6 +315,10 @@ void CreateOrUpdateStartMenuAndTaskbarShortcuts(
}
}
+ if (create_always && installer_state.system_install()) {
+ ForceCreateUserLevelStartMenuShortcut(installer_state, product);
+ }
+
// Create/update uninstall link if we are not an MSI install. MSI
// installations are, for the time being, managed only through the
// Add/Remove Programs dialog.
@@ -339,6 +343,40 @@ void CreateOrUpdateStartMenuAndTaskbarShortcuts(
}
}
+void ForceCreateUserLevelStartMenuShortcut(
+ const InstallerState& installer_state,
+ const Product& product) {
+ BrowserDistribution* browser_dist = product.distribution();
+ const string16 product_name(browser_dist->GetAppShortCutName());
+ const string16 product_desc(browser_dist->GetAppDescription());
+ const FilePath chrome_exe(
+ installer_state.target_path().Append(installer::kChromeExe));
+
+ FilePath start_menu_user_level;
+ if (!PathService::Get(base::DIR_START_MENU, &start_menu_user_level)) {
+ LOG(ERROR) << "Failed to get user-level start menu path.";
+ return;
+ }
+ start_menu_user_level = start_menu_user_level.Append(product_name);
+ if (!file_util::PathExists(start_menu_user_level))
grt (UTC plus 2) 2012/08/29 17:07:06 no need for this check, as CreateDirectory does it
gab 2012/08/29 21:53:00 Done.
+ file_util::CreateDirectoryW(start_menu_user_level);
grt (UTC plus 2) 2012/08/29 17:07:06 CreateDirectoryW -> CreateDirectory
gab 2012/08/29 21:53:00 Done.
+
+ const FilePath chrome_link(
+ start_menu_user_level.Append(product_name + L".lnk"));
+
+ const uint32 options = (ShellUtil::SHORTCUT_CREATE_ALWAYS |
+ ShellUtil::SHORTCUT_DUAL_MODE);
+
+ VLOG(1) << "Creating shortcut to " << chrome_exe.value() << " at "
+ << chrome_link.value();
+ if (!ShellUtil::UpdateChromeShortcut(browser_dist, chrome_exe.value(),
+ chrome_link.value(), string16(), product_desc, chrome_exe.value(),
+ browser_dist->GetIconIndex(), options)) {
+ LOG(WARNING) << "Creating shortcut at " << chrome_link.value()
grt (UTC plus 2) 2012/08/29 17:07:06 WARNING -> ERROR?
gab 2012/08/29 21:53:00 Done.
+ << " failed.";
+ }
+}
+
void CreateOrUpdateDesktopAndQuickLaunchShortcuts(
const InstallerState& installer_state,
const Product& product,

Powered by Google App Engine
This is Rietveld 408576698