diff options
author | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-15 00:18:30 +0000 |
---|---|---|
committer | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-11-15 00:18:30 +0000 |
commit | 9d84e1a1e1d17ab3d64757c0a82f7f95a0aae293 (patch) | |
tree | f70d6b45b28c268a03006d0859086d9649e4f0d2 /chrome/installer/setup/uninstall.cc | |
parent | 12c0b1823a10d2b0cf63144bcd32b556c73177af (diff) | |
download | chromium_src-9d84e1a1e1d17ab3d64757c0a82f7f95a0aae293.zip chromium_src-9d84e1a1e1d17ab3d64757c0a82f7f95a0aae293.tar.gz chromium_src-9d84e1a1e1d17ab3d64757c0a82f7f95a0aae293.tar.bz2 |
Revert 66088 - Changing the installer switches from wchar_t[] to char[].
Because of this I'm also refactoring some code that before
was using wstring to build command lines by hand instead of
using the CommandLine class. Now we use CommandLine.
To get this to work correctly, I also needed to fix CommandLine::AppendArguments so I added a little test for it.
TEST=There should be no changes in functionality. Run all installer tests.
BUG=61609
Review URL: http://codereview.chromium.org/4928002
TBR=tommi@chromium.org
Review URL: http://codereview.chromium.org/4988001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66089 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/setup/uninstall.cc')
-rw-r--r-- | chrome/installer/setup/uninstall.cc | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc index ba77cd8..7a3ca1d 100644 --- a/chrome/installer/setup/uninstall.cc +++ b/chrome/installer/setup/uninstall.cc @@ -470,7 +470,7 @@ const wchar_t kChromeExtProgId[] = L"ChromiumExt"; installer_util::InstallStatus installer_setup::UninstallChrome( const std::wstring& exe_path, bool system_uninstall, bool remove_all, bool force_uninstall, - const CommandLine& cmd_line) { + const CommandLine& cmd_line, const wchar_t* cmd_params) { installer_util::InstallStatus status = installer_util::UNINSTALL_CONFIRMED; std::wstring suffix; if (!ShellUtil::GetUserSpecificDefaultBrowserSuffix(&suffix)) @@ -496,19 +496,23 @@ installer_util::InstallStatus installer_setup::UninstallChrome( !::IsUserAnAdmin() && (base::win::GetVersion() >= base::win::VERSION_VISTA) && !cmd_line.HasSwitch(installer_util::switches::kRunAsAdmin)) { - CommandLine new_cmd(CommandLine::NO_PROGRAM); - new_cmd.AppendArguments(cmd_line, true); + std::wstring exe = cmd_line.GetProgram().value(); + std::wstring params(cmd_params); // Append --run-as-admin flag to let the new instance of setup.exe know // that we already tried to launch ourselves as admin. - new_cmd.AppendSwitch(installer_util::switches::kRunAsAdmin); + params.append(L" --"); + params.append(installer_util::switches::kRunAsAdmin); // Append --remove-chrome-registration to remove registry keys only. - new_cmd.AppendSwitch(installer_util::switches::kRemoveChromeRegistration); + params.append(L" --"); + params.append(installer_util::switches::kRemoveChromeRegistration); if (!suffix.empty()) { - new_cmd.AppendSwitchNative( - installer_util::switches::kRegisterChromeBrowserSuffix, suffix); + params.append(L" --"); + params.append(ASCIIToWide( + installer_util::switches::kRegisterChromeBrowserSuffix)); + params.append(L"=\"" + suffix + L"\""); } DWORD exit_code = installer_util::UNKNOWN_STATUS; - InstallUtil::ExecuteExeAsAdmin(new_cmd, &exit_code); + InstallUtil::ExecuteExeAsAdmin(exe, params, &exit_code); } } |