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

Unified Diff: chrome/browser/chrome_browser_main_win.cc

Issue 11685006: [Fixit-Dec-2012] Auto-launch system-level Chrome post user-level Chrome self-destruction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years 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 | « no previous file | chrome/installer/setup/install.cc » ('j') | chrome/installer/setup/setup_main.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
}
« no previous file with comments | « no previous file | chrome/installer/setup/install.cc » ('j') | chrome/installer/setup/setup_main.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698