summaryrefslogtreecommitdiffstats
path: root/chrome/installer/setup
diff options
context:
space:
mode:
authorcpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-25 21:55:44 +0000
committercpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-03-25 21:55:44 +0000
commitcdd24e1db2da2fa61261ff78278ce2961a320b84 (patch)
treec47786e883c99acca5fe520055ed6a42184b16e3 /chrome/installer/setup
parent11c49d070cd2b1468a8224aabfabef24a094a488 (diff)
downloadchromium_src-cdd24e1db2da2fa61261ff78278ce2961a320b84.zip
chromium_src-cdd24e1db2da2fa61261ff78278ce2961a320b84.tar.gz
chromium_src-cdd24e1db2da2fa61261ff78278ce2961a320b84.tar.bz2
Wire the alternate desktop shortcut text
- second set of changes, one small one to come - adds a parameter on the desktop shortcut creator function that indicate the text to use - plumbs the master preference and the command line parameter BUG=1522969 Review URL: http://codereview.chromium.org/42586 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12499 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/setup')
-rw-r--r--chrome/installer/setup/main.cc4
-rw-r--r--chrome/installer/setup/setup.cc7
-rw-r--r--chrome/installer/setup/uninstall.cc14
3 files changed, 20 insertions, 5 deletions
diff --git a/chrome/installer/setup/main.cc b/chrome/installer/setup/main.cc
index 3341a06..2b57887 100644
--- a/chrome/installer/setup/main.cc
+++ b/chrome/installer/setup/main.cc
@@ -254,6 +254,10 @@ int GetInstallOptions(const CommandLine& cmd_line) {
cmd_line.HasSwitch(installer_util::switches::kVerboseLogging))
options |= installer_util::VERBOSE_LOGGING;
+ if (preferences & installer_util::MASTER_PROFILE_ALT_SHORTCUT_TXT ||
+ cmd_line.HasSwitch(installer_util::switches::kAltDesktopShortcut))
+ options |= installer_util::ALT_DESKTOP_SHORTCUT;
+
return options;
}
diff --git a/chrome/installer/setup/setup.cc b/chrome/installer/setup/setup.cc
index 2ef653a..32aa152 100644
--- a/chrome/installer/setup/setup.cc
+++ b/chrome/installer/setup/setup.cc
@@ -164,14 +164,17 @@ bool CreateOrUpdateChromeShortcuts(const std::wstring& exe_path,
// is specified we want to create them, otherwise we update them only if
// they exist.
bool create = (options & installer_util::CREATE_ALL_SHORTCUTS) != 0;
+ // In some cases the main desktop shortcut has an alternate name.
+ bool alt_shortcut = (options & installer_util::ALT_DESKTOP_SHORTCUT) != 0;
+
if (system_install) {
ret = ret && ShellUtil::CreateChromeDesktopShortcut(chrome_exe,
- product_desc, ShellUtil::SYSTEM_LEVEL, create);
+ product_desc, ShellUtil::SYSTEM_LEVEL, alt_shortcut, create);
ret = ret && ShellUtil::CreateChromeQuickLaunchShortcut(chrome_exe,
ShellUtil::CURRENT_USER | ShellUtil::SYSTEM_LEVEL, create);
} else {
ret = ret && ShellUtil::CreateChromeDesktopShortcut(chrome_exe,
- product_desc, ShellUtil::CURRENT_USER, create);
+ product_desc, ShellUtil::CURRENT_USER, alt_shortcut, create);
ret = ret && ShellUtil::CreateChromeQuickLaunchShortcut(chrome_exe,
ShellUtil::CURRENT_USER, create);
}
diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc
index e2ec9d18..138f1da 100644
--- a/chrome/installer/setup/uninstall.cc
+++ b/chrome/installer/setup/uninstall.cc
@@ -60,17 +60,25 @@ void CloseAllChromeProcesses() {
// This method deletes Chrome shortcut folder from Windows Start menu. It
// checks system_uninstall to see if the shortcut is in all users start menu
// or current user start menu.
+// We try to remove the standard desktop shortcut but if that fails we try
+// to remove the alternate desktop shortcut. Only one of them should be
+// present in a given install but at this point we don't know which one.
void DeleteChromeShortcut(bool system_uninstall) {
std::wstring shortcut_path;
if (system_uninstall) {
PathService::Get(base::DIR_COMMON_START_MENU, &shortcut_path);
- ShellUtil::RemoveChromeDesktopShortcut(ShellUtil::CURRENT_USER |
- ShellUtil::SYSTEM_LEVEL);
+ if (!ShellUtil::RemoveChromeDesktopShortcut(ShellUtil::CURRENT_USER |
+ ShellUtil::SYSTEM_LEVEL, false))
+ ShellUtil::RemoveChromeDesktopShortcut(ShellUtil::CURRENT_USER |
+ ShellUtil::SYSTEM_LEVEL, true);
+
ShellUtil::RemoveChromeQuickLaunchShortcut(ShellUtil::CURRENT_USER |
ShellUtil::SYSTEM_LEVEL);
} else {
PathService::Get(base::DIR_START_MENU, &shortcut_path);
- ShellUtil::RemoveChromeDesktopShortcut(ShellUtil::CURRENT_USER);
+ if (!ShellUtil::RemoveChromeDesktopShortcut(ShellUtil::CURRENT_USER, false))
+ ShellUtil::RemoveChromeDesktopShortcut(ShellUtil::CURRENT_USER, true);
+
ShellUtil::RemoveChromeQuickLaunchShortcut(ShellUtil::CURRENT_USER);
}
if (shortcut_path.empty()) {