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

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

Issue 159172: Allow two user level installs of Chrome to have default browser settings. (Closed)
Patch Set: update comment. Created 11 years, 5 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
« no previous file with comments | « chrome/installer/setup/install.cc ('k') | chrome/installer/setup/uninstall.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/setup/setup_main.cc
diff --git a/chrome/installer/setup/setup_main.cc b/chrome/installer/setup/setup_main.cc
index 159f0651a1c4c2a06f250b7df8221312a47ed38c..d73e4db8f3646054acc6d79acbbcf6538d868966 100644
--- a/chrome/installer/setup/setup_main.cc
+++ b/chrome/installer/setup/setup_main.cc
@@ -573,7 +573,13 @@ bool HandleNonInstallCmdLineOptions(const CommandLine& cmd_line,
// make any user specific changes in this option.
std::wstring chrome_exe(cmd_line.GetSwitchValue(
installer_util::switches::kRegisterChromeBrowser));
- exit_code = ShellUtil::AddChromeToSetAccessDefaults(chrome_exe, true);
+ std::wstring suffix;
+ if (cmd_line.HasSwitch(
+ installer_util::switches::kRegisterChromeBrowserSuffix)) {
+ suffix = cmd_line.GetSwitchValue(
+ installer_util::switches::kRegisterChromeBrowserSuffix);
+ }
+ exit_code = ShellUtil::RegisterChromeBrowser(chrome_exe, suffix, false);
return true;
} else if (cmd_line.HasSwitch(installer_util::switches::kRenameChromeExe)) {
// If --rename-chrome-exe is specified, we want to rename the executables
@@ -582,8 +588,19 @@ bool HandleNonInstallCmdLineOptions(const CommandLine& cmd_line,
return true;
} else if (cmd_line.HasSwitch(
installer_util::switches::kRemoveChromeRegistration)) {
+ // This is almost reverse of --register-chrome-browser option above.
+ // Here we delete Chrome browser registration. This option should only
+ // be used when setup.exe is launched with admin rights. We do not
+ // make any user specific changes in this option.
+ std::wstring suffix;
+ if (cmd_line.HasSwitch(
+ installer_util::switches::kRegisterChromeBrowserSuffix)) {
+ suffix = cmd_line.GetSwitchValue(
+ installer_util::switches::kRegisterChromeBrowserSuffix);
+ }
installer_util::InstallStatus tmp = installer_util::UNKNOWN_STATUS;
- installer_setup::DeleteChromeRegistrationKeys(HKEY_LOCAL_MACHINE, tmp);
+ installer_setup::DeleteChromeRegistrationKeys(HKEY_LOCAL_MACHINE,
+ suffix, tmp);
exit_code = tmp;
return true;
} else if (cmd_line.HasSwitch(installer_util::switches::kInactiveUserToast)) {
« no previous file with comments | « chrome/installer/setup/install.cc ('k') | chrome/installer/setup/uninstall.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698