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

Side by Side Diff: chrome/installer/setup/uninstall.cc

Issue 10446111: Abstract suffixing logic away from GetApplicationName (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 months 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
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 // This file defines the methods useful for uninstalling Chrome. 5 // This file defines the methods useful for uninstalling Chrome.
6 6
7 #include "chrome/installer/setup/uninstall.h" 7 #include "chrome/installer/setup/uninstall.h"
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 string16(L".DEFAULT\\").append( 565 string16(L".DEFAULT\\").append(
566 ShellUtil::kRegStartMenuInternet).c_str(), 566 ShellUtil::kRegStartMenuInternet).c_str(),
567 L"", InstallUtil::ValueEquals(client_name)); 567 L"", InstallUtil::ValueEquals(client_name));
568 } 568 }
569 } 569 }
570 } 570 }
571 } 571 }
572 572
573 // Delete Software\RegisteredApplications\Chromium 573 // Delete Software\RegisteredApplications\Chromium
574 InstallUtil::DeleteRegistryValue(root, ShellUtil::kRegRegisteredApplications, 574 InstallUtil::DeleteRegistryValue(root, ShellUtil::kRegRegisteredApplications,
575 dist->GetApplicationName() + browser_entry_suffix); 575 dist->GetUnsuffixedAppName() + browser_entry_suffix);
576 576
577 // Delete Software\Classes\Applications\chrome.exe 577 // Delete Software\Classes\Applications\chrome.exe
578 string16 app_key(ShellUtil::kRegClasses); 578 string16 app_key(ShellUtil::kRegClasses);
579 app_key.push_back(FilePath::kSeparators[0]); 579 app_key.push_back(FilePath::kSeparators[0]);
580 app_key.append(L"Applications"); 580 app_key.append(L"Applications");
581 app_key.push_back(FilePath::kSeparators[0]); 581 app_key.push_back(FilePath::kSeparators[0]);
582 app_key.append(installer::kChromeExe); 582 app_key.append(installer::kChromeExe);
583 InstallUtil::DeleteRegistryKey(root, app_key); 583 InstallUtil::DeleteRegistryKey(root, app_key);
584 584
585 // Delete the App Paths key that lets explorer find Chrome. 585 // Delete the App Paths key that lets explorer find Chrome.
(...skipping 16 matching lines...) Expand all
602 } 602 }
603 603
604 // Cleanup in case Chrome had been made the default browser. 604 // Cleanup in case Chrome had been made the default browser.
605 605
606 // Delete the default value of SOFTWARE\Clients\StartMenuInternet if it 606 // Delete the default value of SOFTWARE\Clients\StartMenuInternet if it
607 // references this Chrome. Do this explicitly here for the case where HKCU is 607 // references this Chrome. Do this explicitly here for the case where HKCU is
608 // being processed; the iteration above will have no hits since registration 608 // being processed; the iteration above will have no hits since registration
609 // lives in HKLM. 609 // lives in HKLM.
610 InstallUtil::DeleteRegistryValueIf( 610 InstallUtil::DeleteRegistryValueIf(
611 root, ShellUtil::kRegStartMenuInternet, L"", 611 root, ShellUtil::kRegStartMenuInternet, L"",
612 InstallUtil::ValueEquals(dist->GetApplicationName() + 612 InstallUtil::ValueEquals(dist->GetUnsuffixedAppName() +
613 browser_entry_suffix)); 613 browser_entry_suffix));
614 614
615 // Delete each protocol association if it references this Chrome. 615 // Delete each protocol association if it references this Chrome.
616 InstallUtil::ProgramCompare open_command_pred(chrome_exe); 616 InstallUtil::ProgramCompare open_command_pred(chrome_exe);
617 string16 parent_key(ShellUtil::kRegClasses); 617 string16 parent_key(ShellUtil::kRegClasses);
618 const string16::size_type base_length = parent_key.size(); 618 const string16::size_type base_length = parent_key.size();
619 string16 child_key; 619 string16 child_key;
620 for (const wchar_t* const* proto = 620 for (const wchar_t* const* proto =
621 &ShellUtil::kPotentialProtocolAssociations[0]; 621 &ShellUtil::kPotentialProtocolAssociations[0];
622 *proto != NULL; 622 *proto != NULL;
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
703 const CommandLine& cmd_line) { 703 const CommandLine& cmd_line) {
704 InstallStatus status = installer::UNINSTALL_CONFIRMED; 704 InstallStatus status = installer::UNINSTALL_CONFIRMED;
705 BrowserDistribution* browser_dist = product.distribution(); 705 BrowserDistribution* browser_dist = product.distribution();
706 const string16 chrome_exe( 706 const string16 chrome_exe(
707 installer_state.target_path().Append(installer::kChromeExe).value()); 707 installer_state.target_path().Append(installer::kChromeExe).value());
708 708
709 const string16 suffix(ShellUtil::GetCurrentInstallationSuffix()); 709 const string16 suffix(ShellUtil::GetCurrentInstallationSuffix());
710 710
711 bool is_chrome = product.is_chrome(); 711 bool is_chrome = product.is_chrome();
712 712
713 VLOG(1) << "UninstallProduct: " << browser_dist->GetApplicationName(); 713 VLOG(1) << "UninstallProduct: " << browser_dist->GetUnsuffixedAppName();
714 714
715 if (force_uninstall) { 715 if (force_uninstall) {
716 // Since --force-uninstall command line option is used, we are going to 716 // Since --force-uninstall command line option is used, we are going to
717 // do silent uninstall. Try to close all running Chrome instances. 717 // do silent uninstall. Try to close all running Chrome instances.
718 // NOTE: We don't do this for Chrome Frame. 718 // NOTE: We don't do this for Chrome Frame.
719 if (is_chrome) 719 if (is_chrome)
720 CloseAllChromeProcesses(); 720 CloseAllChromeProcesses();
721 } else if (is_chrome) { 721 } else if (is_chrome) {
722 // no --force-uninstall so lets show some UI dialog boxes. 722 // no --force-uninstall so lets show some UI dialog boxes.
723 status = IsChromeActiveOrUserCancelled(installer_state, product); 723 status = IsChromeActiveOrUserCancelled(installer_state, product);
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
937 937
938 // Try and delete the preserved local state once the post-install 938 // Try and delete the preserved local state once the post-install
939 // operations are complete. 939 // operations are complete.
940 if (!backup_state_file.empty()) 940 if (!backup_state_file.empty())
941 file_util::Delete(backup_state_file, false); 941 file_util::Delete(backup_state_file, false);
942 942
943 return ret; 943 return ret;
944 } 944 }
945 945
946 } // namespace installer 946 } // namespace installer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698