Index: chrome/browser/chrome_browser_main_win.cc |
diff --git a/chrome/browser/chrome_browser_main_win.cc b/chrome/browser/chrome_browser_main_win.cc |
index 67850bafb37462585818d4656910ea88774481f4..5a88d87ddfc545154911b6c77eeb4ddb0dfd326b 100644 |
--- a/chrome/browser/chrome_browser_main_win.cc |
+++ b/chrome/browser/chrome_browser_main_win.cc |
@@ -358,13 +358,25 @@ bool ChromeBrowserMainPartsWin::CheckMachineLevelInstall() { |
CommandLine uninstall_cmd( |
InstallUtil::GetChromeUninstallCmd(false, dist->GetType())); |
if (!uninstall_cmd.GetProgram().empty()) { |
+ uninstall_cmd.AppendSwitch(installer::switches::kSelfDestruct); |
uninstall_cmd.AppendSwitch(installer::switches::kForceUninstall); |
uninstall_cmd.AppendSwitch( |
installer::switches::kDoNotRemoveSharedItems); |
- base::LaunchOptions launch_options; |
+ |
+ const FilePath setup_exe(uninstall_cmd.GetProgram()); |
+ const string16 params(uninstall_cmd.GetArgumentsString()); |
+ |
+ SHELLEXECUTEINFO sei = { sizeof(sei) }; |
grt (UTC plus 2)
2013/01/02 17:59:33
For safety, I think you need:
sei.fMask =
gab
2013/01/02 21:15:48
Done.
|
+ sei.nShow = SW_SHOWNORMAL; |
+ sei.lpFile = setup_exe.value().c_str(); |
+ sei.lpParameters = params.c_str(); |
grt (UTC plus 2)
2013/01/02 17:59:33
MSDN says that quotes in lpParameters must be quot
gab
2013/01/02 21:15:48
Interesting, if this is ever a problem (and if it
grt (UTC plus 2)
2013/01/03 15:41:27
Yup. Wasn't suggesting that this was the place, ju
|
+ // On Windows 8 SEE_MASK_FLAG_LOG_USAGE is necessary to guarantee we |
+ // flip to the Desktop when launching. |
if (is_metro) |
- launch_options.force_breakaway_from_job_ = true; |
- base::LaunchProcess(uninstall_cmd, launch_options, NULL); |
+ sei.fMask = SEE_MASK_FLAG_LOG_USAGE; |
grt (UTC plus 2)
2013/01/02 17:59:33
= -> |=
gab
2013/01/02 21:15:48
Done.
|
+ |
+ if (!::ShellExecuteExW(&sei)) |
grt (UTC plus 2)
2013/01/02 17:59:33
nit: please remove the trailing 'W'
grt (UTC plus 2)
2013/01/02 17:59:33
MSDN suggests that COM should always be initialize
robertshield
2013/01/02 19:36:06
This should be fine.
gab
2013/01/02 21:15:48
Done.
gab
2013/01/02 21:15:48
Ack.
|
+ NOTREACHED(); |
grt (UTC plus 2)
2013/01/02 17:59:33
DPCHECK(false); so that the last-error code is log
gab
2013/01/02 21:15:48
Done.
|
} |
return true; |
} |