Index: chrome/installer/setup/install.cc |
=================================================================== |
--- chrome/installer/setup/install.cc (revision 66088) |
+++ chrome/installer/setup/install.cc (working copy) |
@@ -82,10 +82,15 @@ |
} |
} |
+// A little helper function to save on tons of WideToASCII call sites. |
+void AppendWideSwitch(CommandLine* cmd, const wchar_t* switch_name) { |
+ cmd->AppendSwitch(WideToASCII(switch_name)); |
+} |
+ |
void AppendUninstallCommandLineFlags(CommandLine* uninstall_cmd, |
bool is_system) { |
DCHECK(uninstall_cmd); |
- uninstall_cmd->AppendSwitch(installer_util::switches::kUninstall); |
+ AppendWideSwitch(uninstall_cmd, installer_util::switches::kUninstall); |
// TODO(tommi): In case of multiple installations, we need to create multiple |
// uninstall entries, and not one magic one for all. |
@@ -94,26 +99,26 @@ |
DCHECK(!prefs.is_multi_install()); |
if (prefs.install_chrome_frame()) { |
- uninstall_cmd->AppendSwitch(installer_util::switches::kDeleteProfile); |
- uninstall_cmd->AppendSwitch(installer_util::switches::kChromeFrame); |
+ AppendWideSwitch(uninstall_cmd, installer_util::switches::kDeleteProfile); |
+ AppendWideSwitch(uninstall_cmd, installer_util::switches::kChromeFrame); |
} |
if (InstallUtil::IsChromeSxSProcess()) { |
- uninstall_cmd->AppendSwitch(installer_util::switches::kChromeSxS); |
+ AppendWideSwitch(uninstall_cmd, installer_util::switches::kChromeSxS); |
} |
if (InstallUtil::IsMSIProcess(is_system)) { |
- uninstall_cmd->AppendSwitch(installer_util::switches::kMsi); |
+ AppendWideSwitch(uninstall_cmd, installer_util::switches::kMsi); |
} |
// Propagate the verbose logging switch to uninstalls too. |
const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
if (command_line.HasSwitch(installer_util::switches::kVerboseLogging)) { |
- uninstall_cmd->AppendSwitch(installer_util::switches::kVerboseLogging); |
+ AppendWideSwitch(uninstall_cmd, installer_util::switches::kVerboseLogging); |
} |
if (is_system) { |
- uninstall_cmd->AppendSwitch(installer_util::switches::kSystemLevel); |
+ AppendWideSwitch(uninstall_cmd, installer_util::switches::kSystemLevel); |
} |
} |
@@ -415,26 +420,30 @@ |
google_update::kRegOldVersionField, |
current_version.c_str(), |
true); |
- FilePath installer_path(installer::GetInstallerPathUnderChrome(install_path, |
- new_version.GetString())); |
- installer_path = installer_path.Append( |
- file_util::GetFilenameFromPath(exe_path)); |
- CommandLine rename_cmd(installer_path); |
- rename_cmd.AppendSwitch(installer_util::switches::kRenameChromeExe); |
+ std::wstring rename_cmd(installer::GetInstallerPathUnderChrome( |
+ install_path, new_version.GetString())); |
+ file_util::AppendToPath(&rename_cmd, |
+ file_util::GetFilenameFromPath(exe_path)); |
+ rename_cmd = L"\"" + rename_cmd + |
+ L"\" --" + installer_util::switches::kRenameChromeExe; |
if (is_system_install) |
- rename_cmd.AppendSwitch(installer_util::switches::kSystemLevel); |
+ rename_cmd = rename_cmd + L" --" + installer_util::switches::kSystemLevel; |
- if (prefs.install_chrome_frame()) |
- rename_cmd.AppendSwitch(installer_util::switches::kChromeFrame); |
+ if (prefs.install_chrome_frame()) { |
+ rename_cmd += L" --"; |
+ rename_cmd += installer_util::switches::kChromeFrame; |
+ } |
- if (InstallUtil::IsChromeSxSProcess()) |
- rename_cmd.AppendSwitch(installer_util::switches::kChromeSxS); |
+ if (InstallUtil::IsChromeSxSProcess()) { |
+ rename_cmd += L" --"; |
+ rename_cmd += installer_util::switches::kChromeSxS; |
+ } |
inuse_list->AddSetRegValueWorkItem(reg_root, |
version_key, |
google_update::kRegRenameCmdField, |
- rename_cmd.command_line_string(), |
+ rename_cmd.c_str(), |
true); |
if (!inuse_list->Do()) { |
LOG(ERROR) << "Couldn't write opv/cmd values to registry."; |