OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 76 matching lines...) Loading... |
87 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); | 87 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
88 reg_key.append(L"\\" + dist->GetApplicationName() + ShellUtil::kRegShellOpen); | 88 reg_key.append(L"\\" + dist->GetApplicationName() + ShellUtil::kRegShellOpen); |
89 RegKey key(HKEY_LOCAL_MACHINE, reg_key.c_str(), KEY_READ); | 89 RegKey key(HKEY_LOCAL_MACHINE, reg_key.c_str(), KEY_READ); |
90 std::wstring reg_exe; | 90 std::wstring reg_exe; |
91 if (key.ReadValue(L"", ®_exe) && reg_exe.length() > 2) { | 91 if (key.ReadValue(L"", ®_exe) && reg_exe.length() > 2) { |
92 std::wstring chrome_exe = installer::GetChromeInstallPath(system_uninstall); | 92 std::wstring chrome_exe = installer::GetChromeInstallPath(system_uninstall); |
93 file_util::AppendToPath(&chrome_exe, installer_util::kChromeExe); | 93 file_util::AppendToPath(&chrome_exe, installer_util::kChromeExe); |
94 reg_exe = reg_exe.substr(1, reg_exe.length() - 2); | 94 reg_exe = reg_exe.substr(1, reg_exe.length() - 2); |
95 if ((reg_exe.size() == chrome_exe.size()) && | 95 if ((reg_exe.size() == chrome_exe.size()) && |
96 (std::equal(chrome_exe.begin(), chrome_exe.end(), | 96 (std::equal(chrome_exe.begin(), chrome_exe.end(), |
97 reg_exe.begin(), CaseInsensitiveCompare<wchar_t>()))) | 97 reg_exe.begin(), base::CaseInsensitiveCompare<wchar_t>()))) |
98 return true; | 98 return true; |
99 } | 99 } |
100 | 100 |
101 return false; | 101 return false; |
102 } | 102 } |
103 | 103 |
104 // This method deletes Chrome shortcut folder from Windows Start menu. It | 104 // This method deletes Chrome shortcut folder from Windows Start menu. It |
105 // checks system_uninstall to see if the shortcut is in all users start menu | 105 // checks system_uninstall to see if the shortcut is in all users start menu |
106 // or current user start menu. | 106 // or current user start menu. |
107 // We try to remove the standard desktop shortcut but if that fails we try | 107 // We try to remove the standard desktop shortcut but if that fails we try |
(...skipping 481 matching lines...) Loading... |
589 distribution_data); | 589 distribution_data); |
590 } | 590 } |
591 | 591 |
592 // Try and delete the preserved local state once the post-install | 592 // Try and delete the preserved local state once the post-install |
593 // operations are complete. | 593 // operations are complete. |
594 if (!local_state_path.empty()) | 594 if (!local_state_path.empty()) |
595 file_util::Delete(local_state_path, false); | 595 file_util::Delete(local_state_path, false); |
596 | 596 |
597 return ret; | 597 return ret; |
598 } | 598 } |
OLD | NEW |