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

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

Issue 4988001: Revert 66088 - 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
« no previous file with comments | « chrome/installer/util/install_util.h ('k') | chrome/installer/util/master_preferences.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/util/install_util.cc
===================================================================
--- chrome/installer/util/install_util.cc (revision 66088)
+++ chrome/installer/util/install_util.cc (working copy)
@@ -12,6 +12,7 @@
#include <algorithm>
+#include "base/command_line.h"
#include "base/file_util.h"
#include "base/logging.h"
#include "base/path_service.h"
@@ -36,28 +37,14 @@
return prefs;
}
-bool InstallUtil::ExecuteExeAsAdmin(const CommandLine& cmd, DWORD* exit_code) {
- FilePath::StringType program(cmd.GetProgram().value());
- DCHECK(!program.empty());
- DCHECK(program[0] != '\"');
-
- CommandLine::StringType params(cmd.command_line_string());
- if (params[0] == '"') {
- DCHECK_EQ('"', params[program.length() + 1]);
- DCHECK_EQ(program, params.substr(1, program.length()));
- params = params.substr(program.length() + 2);
- } else {
- DCHECK_EQ(program, params.substr(0, program.length()));
- params = params.substr(program.length());
- }
-
- TrimWhitespace(params, TRIM_ALL, &params);
-
+bool InstallUtil::ExecuteExeAsAdmin(const std::wstring& exe,
+ const std::wstring& params,
+ DWORD* exit_code) {
SHELLEXECUTEINFO info = {0};
info.cbSize = sizeof(SHELLEXECUTEINFO);
info.fMask = SEE_MASK_NOCLOSEPROCESS;
info.lpVerb = L"runas";
- info.lpFile = program.c_str();
+ info.lpFile = exe.c_str();
info.lpParameters = params.c_str();
info.nShow = SW_SHOW;
if (::ShellExecuteEx(&info) == FALSE)
« no previous file with comments | « chrome/installer/util/install_util.h ('k') | chrome/installer/util/master_preferences.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698