Chromium Code Reviews| 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 10ed28d3807543761ded08f6d77fd3101b70667a..3da771b9c16db20086d3ca44d8840450f58e3e9e 100644 |
| --- a/chrome/browser/chrome_browser_main_win.cc |
| +++ b/chrome/browser/chrome_browser_main_win.cc |
| @@ -361,18 +361,27 @@ bool ChromeBrowserMainPartsWin::CheckMachineLevelInstall() { |
| std::wstring exe = exe_path.value(); |
| FilePath user_exe_path(installer::GetChromeInstallPath(false, dist)); |
| if (FilePath::CompareEqualIgnoreCase(exe, user_exe_path.value())) { |
| - const string16 text = |
| - l10n_util::GetStringUTF16(IDS_MACHINE_LEVEL_INSTALL_CONFLICT); |
| - const string16 caption = l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); |
| - const UINT flags = MB_OK | MB_ICONERROR | MB_TOPMOST; |
| - ui::MessageBox(NULL, text, caption, flags); |
| + if (base::win::GetVersion() < base::win::VERSION_WIN8 || |
| + !base::win::IsMetroProcess()) { |
| + // The dialog cannot be shown in Win8 Metro as doing so hangs Chrome on |
| + // an invisible dialog. |
| + // TODO (gab): Get rid of this dialog altogether and auto-launch |
| + // system-level Chrome instead. |
| + const string16 text = |
| + l10n_util::GetStringUTF16(IDS_MACHINE_LEVEL_INSTALL_CONFLICT); |
| + const string16 caption = l10n_util::GetStringUTF16(IDS_PRODUCT_NAME); |
| + const UINT flags = MB_OK | MB_ICONERROR | MB_TOPMOST; |
| + ui::MessageBox(NULL, text, caption, flags); |
| + } |
| CommandLine uninstall_cmd( |
| InstallUtil::GetChromeUninstallCmd(false, dist->GetType())); |
| if (!uninstall_cmd.GetProgram().empty()) { |
| uninstall_cmd.AppendSwitch(installer::switches::kForceUninstall); |
| uninstall_cmd.AppendSwitch( |
| installer::switches::kDoNotRemoveSharedItems); |
| - base::LaunchProcess(uninstall_cmd, base::LaunchOptions(), NULL); |
| + base::LaunchOptions launch_options; |
| + launch_options.force_breakaway_from_job_ = true; |
|
grt (UTC plus 2)
2012/11/20 02:35:38
i'm a bit concerned about always doing this. as i
gab
2012/11/20 15:38:06
Done.
|
| + base::LaunchProcess(uninstall_cmd, launch_options, NULL); |
| } |
| return true; |
| } |