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

Unified Diff: chrome/installer/util/shell_util.cc

Issue 4928002: Changing the installer switches from wchar_t[] to char[].... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month 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/util/shell_util.cc
===================================================================
--- chrome/installer/util/shell_util.cc (revision 66046)
+++ chrome/installer/util/shell_util.cc (working copy)
@@ -295,9 +295,9 @@
return registered;
}
-// This method registers Chrome on Vista by launching eleavated setup.exe.
-// That will show user standard Vista elevation prompt. If user accepts it
-// the new process will make the necessary changes and return SUCCESS that
+// This method registers Chrome on Vista by launching an elevated setup.exe.
+// That will show the user standard Vista elevation prompt. If the user accepts
robertshield 2010/11/14 15:21:31 will show the user *the* standard Vista elevation
tommi (sloooow) - chröme 2010/11/14 21:28:07 Done.
+// it the new process will make the necessary changes and return SUCCESS that
// we capture and return.
bool ElevateAndRegisterChrome(const std::wstring& chrome_exe,
const std::wstring& suffix) {
@@ -314,26 +314,23 @@
CommandLine command_line = CommandLine::FromString(uninstall_string);
exe_path = command_line.GetProgram();
}
+
if (file_util::PathExists(exe_path)) {
- std::wstring params(L"--");
- params.append(
- ASCIIToWide(installer_util::switches::kRegisterChromeBrowser));
- params.append(L"=\"" + chrome_exe + L"\"");
+ CommandLine cmd(exe_path);
+ cmd.AppendSwitchNative(installer_util::switches::kRegisterChromeBrowser,
+ chrome_exe);
if (!suffix.empty()) {
- params.append(L" --");
- params.append(ASCIIToWide(
- installer_util::switches::kRegisterChromeBrowserSuffix));
- params.append(L"=\"" + suffix + L"\"");
+ cmd.AppendSwitchNative(
+ installer_util::switches::kRegisterChromeBrowserSuffix, suffix);
}
CommandLine& browser_command_line = *CommandLine::ForCurrentProcess();
if (browser_command_line.HasSwitch(switches::kChromeFrame)) {
- params.append(L" --");
- params.append(installer_util::switches::kChromeFrame);
+ cmd.AppendSwitch(installer_util::switches::kChromeFrame);
}
DWORD ret_val = 0;
- InstallUtil::ExecuteExeAsAdmin(exe_path.value(), params, &ret_val);
+ InstallUtil::ExecuteExeAsAdmin(cmd, &ret_val);
if (ret_val == 0)
return true;
}

Powered by Google App Engine
This is Rietveld 408576698