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

Side by Side Diff: chrome/browser/chrome_browser_main_win.cc

Issue 11417036: Fix user-level Chrome self-destruction issues on Windows 8. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/installer/setup/uninstall.cc » ('j') | chrome/installer/setup/uninstall.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chrome_browser_main_win.h" 5 #include "chrome/browser/chrome_browser_main_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 #include <shellapi.h> 8 #include <shellapi.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 // thing to do. 354 // thing to do.
355 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); 355 BrowserDistribution* dist = BrowserDistribution::GetDistribution();
356 Version version; 356 Version version;
357 InstallUtil::GetChromeVersion(dist, true, &version); 357 InstallUtil::GetChromeVersion(dist, true, &version);
358 if (version.IsValid()) { 358 if (version.IsValid()) {
359 FilePath exe_path; 359 FilePath exe_path;
360 PathService::Get(base::DIR_EXE, &exe_path); 360 PathService::Get(base::DIR_EXE, &exe_path);
361 std::wstring exe = exe_path.value(); 361 std::wstring exe = exe_path.value();
362 FilePath user_exe_path(installer::GetChromeInstallPath(false, dist)); 362 FilePath user_exe_path(installer::GetChromeInstallPath(false, dist));
363 if (FilePath::CompareEqualIgnoreCase(exe, user_exe_path.value())) { 363 if (FilePath::CompareEqualIgnoreCase(exe, user_exe_path.value())) {
364 const string16 text =
365 l10n_util::GetStringUTF16(IDS_MACHINE_LEVEL_INSTALL_CONFLICT);
366 const string16 caption = l10n_util::GetStringUTF16(IDS_PRODUCT_NAME);
367 const UINT flags = MB_OK | MB_ICONERROR | MB_TOPMOST;
368 ui::MessageBox(NULL, text, caption, flags);
robertshield 2012/11/16 20:23:33 Let's only remove this on Win8/metro for now. We c
grt (UTC plus 2) 2012/11/16 21:11:24 what he said.
gab 2012/11/20 00:46:36 Done.
369 CommandLine uninstall_cmd( 364 CommandLine uninstall_cmd(
370 InstallUtil::GetChromeUninstallCmd(false, dist->GetType())); 365 InstallUtil::GetChromeUninstallCmd(false, dist->GetType()));
371 if (!uninstall_cmd.GetProgram().empty()) { 366 if (!uninstall_cmd.GetProgram().empty()) {
372 uninstall_cmd.AppendSwitch(installer::switches::kForceUninstall); 367 uninstall_cmd.AppendSwitch(installer::switches::kForceUninstall);
373 uninstall_cmd.AppendSwitch( 368 uninstall_cmd.AppendSwitch(
374 installer::switches::kDoNotRemoveSharedItems); 369 installer::switches::kDoNotRemoveSharedItems);
375 base::LaunchProcess(uninstall_cmd, base::LaunchOptions(), NULL); 370 base::LaunchOptions launch_options;
371 launch_options.force_breakaway_from_job_ = true;
372 base::LaunchProcess(uninstall_cmd, launch_options, NULL);
376 } 373 }
377 return true; 374 return true;
378 } 375 }
379 } 376 }
380 return false; 377 return false;
381 } 378 }
382 379
383 string16 TranslationDelegate::GetLocalizedString(int installer_string_id) { 380 string16 TranslationDelegate::GetLocalizedString(int installer_string_id) {
384 int resource_id = 0; 381 int resource_id = 0;
385 switch (installer_string_id) { 382 switch (installer_string_id) {
(...skipping 11 matching lines...) Expand all
397 if (resource_id) 394 if (resource_id)
398 return l10n_util::GetStringUTF16(resource_id); 395 return l10n_util::GetStringUTF16(resource_id);
399 return string16(); 396 return string16();
400 } 397 }
401 398
402 // static 399 // static
403 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() { 400 void ChromeBrowserMainPartsWin::SetupInstallerUtilStrings() {
404 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ()); 401 CR_DEFINE_STATIC_LOCAL(TranslationDelegate, delegate, ());
405 installer::SetTranslationDelegate(&delegate); 402 installer::SetTranslationDelegate(&delegate);
406 } 403 }
OLDNEW
« no previous file with comments | « no previous file | chrome/installer/setup/uninstall.cc » ('j') | chrome/installer/setup/uninstall.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698