summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-10 17:29:43 +0000
committerrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-09-10 17:29:43 +0000
commit7e4077d9ee19169eb5631277f860a03088fb0042 (patch)
tree29969774b7ae95a9743678a8137483cc6eb8cb87
parent811734bce820e697febef23f74e5c44a800dd649 (diff)
downloadchromium_src-7e4077d9ee19169eb5631277f860a03088fb0042.zip
chromium_src-7e4077d9ee19169eb5631277f860a03088fb0042.tar.gz
chromium_src-7e4077d9ee19169eb5631277f860a03088fb0042.tar.bz2
Adding a --do-not-create-shortcuts command line switch to the installer to prevent it from trying to create Chrome desktop shortcuts.
Review URL: http://codereview.chromium.org/196068 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@25870 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/installer/setup/install.cc30
-rw-r--r--chrome/installer/setup/setup_util.cc4
-rw-r--r--chrome/installer/util/master_preferences.cc1
-rw-r--r--chrome/installer/util/master_preferences.h2
-rw-r--r--chrome/installer/util/util_constants.cc3
-rw-r--r--chrome/installer/util/util_constants.h1
6 files changed, 28 insertions, 13 deletions
diff --git a/chrome/installer/setup/install.cc b/chrome/installer/setup/install.cc
index 0465d29..11e0522 100644
--- a/chrome/installer/setup/install.cc
+++ b/chrome/installer/setup/install.cc
@@ -540,21 +540,25 @@ installer_util::InstallStatus installer::InstallOrUpdateChrome(
result = installer_util::NEW_VERSION_UPDATED;
}
- bool create_all_shortcut = installer_util::GetDistroBooleanPreference(prefs,
- installer_util::master_preferences::kCreateAllShortcuts);
- bool alt_shortcut = installer_util::GetDistroBooleanPreference(prefs,
- installer_util::master_preferences::kAltShortcutText);
- if (!CreateOrUpdateChromeShortcuts(exe_path, install_path,
- new_version.GetString(), result,
- system_install, create_all_shortcut,
- alt_shortcut))
- LOG(WARNING) << "Failed to create/update start menu shortcut.";
+ if (!installer_util::GetDistroBooleanPreference(prefs,
+ installer_util::master_preferences::kDoNotCreateShortcuts)) {
+ bool create_all_shortcut = installer_util::GetDistroBooleanPreference(
+ prefs, installer_util::master_preferences::kCreateAllShortcuts);
+ bool alt_shortcut = installer_util::GetDistroBooleanPreference(prefs,
+ installer_util::master_preferences::kAltShortcutText);
+ if (!CreateOrUpdateChromeShortcuts(exe_path, install_path,
+ new_version.GetString(), result,
+ system_install, create_all_shortcut,
+ alt_shortcut))
+ LOG(WARNING) << "Failed to create/update start menu shortcut.";
+
+ bool make_chrome_default = installer_util::GetDistroBooleanPreference(
+ prefs, installer_util::master_preferences::kMakeChromeDefault);
+ RegisterChromeOnMachine(install_path, system_install,
+ make_chrome_default);
+ }
RemoveOldVersionDirs(install_path, new_version.GetString());
-
- bool make_chrome_default = installer_util::GetDistroBooleanPreference(prefs,
- installer_util::master_preferences::kMakeChromeDefault);
- RegisterChromeOnMachine(install_path, system_install, make_chrome_default);
}
return result;
diff --git a/chrome/installer/setup/setup_util.cc b/chrome/installer/setup/setup_util.cc
index b90ec9c..20f2f7e 100644
--- a/chrome/installer/setup/setup_util.cc
+++ b/chrome/installer/setup/setup_util.cc
@@ -50,6 +50,10 @@ DictionaryValue* setup_util::GetInstallPreferences(
installer_util::SetDistroBooleanPreference(
prefs, installer_util::master_preferences::kCreateAllShortcuts, true);
+ if (cmd_line.HasSwitch(installer_util::switches::kDoNotCreateShortcuts))
+ installer_util::SetDistroBooleanPreference(
+ prefs, installer_util::master_preferences::kDoNotCreateShortcuts, true);
+
if (cmd_line.HasSwitch(installer_util::switches::kDoNotLaunchChrome))
installer_util::SetDistroBooleanPreference(
prefs, installer_util::master_preferences::kDoNotLaunchChrome, true);
diff --git a/chrome/installer/util/master_preferences.cc b/chrome/installer/util/master_preferences.cc
index 92d57cb..df28658 100644
--- a/chrome/installer/util/master_preferences.cc
+++ b/chrome/installer/util/master_preferences.cc
@@ -28,6 +28,7 @@ const wchar_t kDistroImportSearchPref[] = L"import_search_engine";
const wchar_t kDistroPingDelay[] = L"ping_delay";
const wchar_t kDistroShowWelcomePage[] = L"show_welcome_page";
const wchar_t kDistroSkipFirstRunPref[] = L"skip_first_run_ui";
+const wchar_t kDoNotCreateShortcuts[] = L"do_not_create_shortcuts";
const wchar_t kDoNotLaunchChrome[] = L"do_not_launch_chrome";
const wchar_t kMakeChromeDefault[] = L"make_chrome_default";
const wchar_t kMakeChromeDefaultForUser[] = L"make_chrome_default_for_user";
diff --git a/chrome/installer/util/master_preferences.h b/chrome/installer/util/master_preferences.h
index 5284172..ec88c14 100644
--- a/chrome/installer/util/master_preferences.h
+++ b/chrome/installer/util/master_preferences.h
@@ -41,6 +41,8 @@ extern const wchar_t kDistroPingDelay[];
extern const wchar_t kDistroShowWelcomePage[];
// Boolean pref that triggers skipping the first run dialogs.
extern const wchar_t kDistroSkipFirstRunPref[];
+// Boolean. Do not create Chrome desktop shortcuts. Cmd line override present.
+extern const wchar_t kDoNotCreateShortcuts[];
// Boolean. Do not launch Chrome after first install. Cmd line override present.
extern const wchar_t kDoNotLaunchChrome[];
// Boolean. Register Chrome as default browser. Cmd line override present.
diff --git a/chrome/installer/util/util_constants.cc b/chrome/installer/util/util_constants.cc
index 07afdeb..ad9be15 100644
--- a/chrome/installer/util/util_constants.cc
+++ b/chrome/installer/util/util_constants.cc
@@ -18,6 +18,9 @@ const wchar_t kDeleteProfile[] = L"delete-profile";
// Disable logging
const wchar_t kDisableLogging[] = L"disable-logging";
+// Prevent installer from creating desktop shortcuts.
+const wchar_t kDoNotCreateShortcuts[] = L"do-not-create-shortcuts";
+
// Prevent installer from launching Chrome after a successful first install.
const wchar_t kDoNotLaunchChrome[] = L"do-not-launch-chrome";
diff --git a/chrome/installer/util/util_constants.h b/chrome/installer/util/util_constants.h
index 4e209b2..6893fdf 100644
--- a/chrome/installer/util/util_constants.h
+++ b/chrome/installer/util/util_constants.h
@@ -46,6 +46,7 @@ namespace switches {
extern const wchar_t kCreateAllShortcuts[];
extern const wchar_t kDeleteProfile[];
extern const wchar_t kDisableLogging[];
+extern const wchar_t kDoNotCreateShortcuts[];
extern const wchar_t kDoNotLaunchChrome[];
extern const wchar_t kDoNotRemoveSharedItems[];
extern const wchar_t kEnableLogging[];