| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 DeleteChromeShortcut(system_uninstall); | 235 DeleteChromeShortcut(system_uninstall); |
| 236 | 236 |
| 237 // Delete the registry keys (Uninstall key and Version key). | 237 // Delete the registry keys (Uninstall key and Version key). |
| 238 HKEY reg_root = system_uninstall ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; | 238 HKEY reg_root = system_uninstall ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; |
| 239 RegKey key(reg_root, L"", KEY_ALL_ACCESS); | 239 RegKey key(reg_root, L"", KEY_ALL_ACCESS); |
| 240 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); | 240 BrowserDistribution* dist = BrowserDistribution::GetDistribution(); |
| 241 DeleteRegistryKey(key, dist->GetUninstallRegPath()); | 241 DeleteRegistryKey(key, dist->GetUninstallRegPath()); |
| 242 DeleteRegistryKey(key, dist->GetVersionKey()); | 242 DeleteRegistryKey(key, dist->GetVersionKey()); |
| 243 | 243 |
| 244 // Delete Software\Classes\ChromeHTML, | 244 // Delete Software\Classes\ChromeHTML, |
| 245 // Delete Software\Classes\ChromeExt, |
| 246 // Delete Software\Classes\.crx, |
| 245 // Software\Clients\StartMenuInternet\chrome.exe and | 247 // Software\Clients\StartMenuInternet\chrome.exe and |
| 246 // Software\RegisteredApplications\Chrome | 248 // Software\RegisteredApplications\Chrome |
| 247 std::wstring html_prog_id(ShellUtil::kRegClasses); | 249 std::wstring html_prog_id(ShellUtil::kRegClasses); |
| 248 file_util::AppendToPath(&html_prog_id, ShellUtil::kChromeHTMLProgId); | 250 file_util::AppendToPath(&html_prog_id, ShellUtil::kChromeHTMLProgId); |
| 249 DeleteRegistryKey(key, html_prog_id); | 251 DeleteRegistryKey(key, html_prog_id); |
| 252 std::wstring ext_prog_id(ShellUtil::kRegClasses); |
| 253 file_util::AppendToPath(&ext_prog_id, ShellUtil::kChromeExtProgId); |
| 254 DeleteRegistryKey(key, ext_prog_id); |
| 255 std::wstring ext_association(ShellUtil::kRegClasses); |
| 256 ext_association.append(L"."); |
| 257 ext_association.append(chrome::kExtensionFileExtension); |
| 258 DeleteRegistryKey(key, ext_association); |
| 250 | 259 |
| 251 std::wstring set_access_key(ShellUtil::kRegStartMenuInternet); | 260 std::wstring set_access_key(ShellUtil::kRegStartMenuInternet); |
| 252 file_util::AppendToPath(&set_access_key, dist->GetApplicationName()); | 261 file_util::AppendToPath(&set_access_key, dist->GetApplicationName()); |
| 253 DeleteRegistryKey(key, set_access_key); | 262 DeleteRegistryKey(key, set_access_key); |
| 254 // We have renamed the StartMenuInternet\chrome.exe to | 263 // We have renamed the StartMenuInternet\chrome.exe to |
| 255 // StartMenuInternet\Chromium so for old users we still need to delete | 264 // StartMenuInternet\Chromium so for old users we still need to delete |
| 256 // the old key. | 265 // the old key. |
| 257 std::wstring old_set_access_key(ShellUtil::kRegStartMenuInternet); | 266 std::wstring old_set_access_key(ShellUtil::kRegStartMenuInternet); |
| 258 file_util::AppendToPath(&old_set_access_key, installer_util::kChromeExe); | 267 file_util::AppendToPath(&old_set_access_key, installer_util::kChromeExe); |
| 259 DeleteRegistryKey(key, old_set_access_key); | 268 DeleteRegistryKey(key, old_set_access_key); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 278 if (remove_all) | 287 if (remove_all) |
| 279 DeleteRegistryKey(hklm_key, open_with_key); | 288 DeleteRegistryKey(hklm_key, open_with_key); |
| 280 } | 289 } |
| 281 key.Close(); | 290 key.Close(); |
| 282 | 291 |
| 283 // Delete shared registry keys as well (these require admin rights) if | 292 // Delete shared registry keys as well (these require admin rights) if |
| 284 // remove_all option is specified. | 293 // remove_all option is specified. |
| 285 if (remove_all) { | 294 if (remove_all) { |
| 286 DeleteRegistryKey(hklm_key, set_access_key); | 295 DeleteRegistryKey(hklm_key, set_access_key); |
| 287 DeleteRegistryKey(hklm_key, html_prog_id); | 296 DeleteRegistryKey(hklm_key, html_prog_id); |
| 297 DeleteRegistryKey(hklm_key, ext_prog_id); |
| 298 DeleteRegistryKey(hklm_key, ext_association); |
| 288 DeleteRegistryValue(HKEY_LOCAL_MACHINE, | 299 DeleteRegistryValue(HKEY_LOCAL_MACHINE, |
| 289 ShellUtil::kRegRegisteredApplications, | 300 ShellUtil::kRegRegisteredApplications, |
| 290 dist->GetApplicationName()); | 301 dist->GetApplicationName()); |
| 291 | 302 |
| 292 // Delete the App Paths key that lets explorer find Chrome. | 303 // Delete the App Paths key that lets explorer find Chrome. |
| 293 std::wstring app_path_key(ShellUtil::kAppPathsRegistryKey); | 304 std::wstring app_path_key(ShellUtil::kAppPathsRegistryKey); |
| 294 file_util::AppendToPath(&app_path_key, installer_util::kChromeExe); | 305 file_util::AppendToPath(&app_path_key, installer_util::kChromeExe); |
| 295 DeleteRegistryKey(hklm_key, app_path_key); | 306 DeleteRegistryKey(hklm_key, app_path_key); |
| 296 | 307 |
| 297 // Delete media player registry key that exists only in HKLM. | 308 // Delete media player registry key that exists only in HKLM. |
| (...skipping 26 matching lines...) Expand all Loading... |
| 324 dist->DoPostUninstallOperations(installed_version, local_state_path); | 335 dist->DoPostUninstallOperations(installed_version, local_state_path); |
| 325 } | 336 } |
| 326 | 337 |
| 327 // Try and delete the preserved local state once the post-install | 338 // Try and delete the preserved local state once the post-install |
| 328 // operations are complete. | 339 // operations are complete. |
| 329 if (!local_state_path.empty()) | 340 if (!local_state_path.empty()) |
| 330 file_util::Delete(local_state_path, false); | 341 file_util::Delete(local_state_path, false); |
| 331 | 342 |
| 332 return installer_util::UNINSTALL_SUCCESSFUL; | 343 return installer_util::UNINSTALL_SUCCESSFUL; |
| 333 } | 344 } |
| OLD | NEW |