diff options
author | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-08 04:39:12 +0000 |
---|---|---|
committer | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-08 04:39:12 +0000 |
commit | 8ff8763e823b748b56c5c688568cd1b449cf3465 (patch) | |
tree | 72d4288c7d34a7a1d4715c60604109444021e8d5 /chrome/installer | |
parent | a6380108bbb19f149186a5abae2a013a470a6381 (diff) | |
download | chromium_src-8ff8763e823b748b56c5c688568cd1b449cf3465.zip chromium_src-8ff8763e823b748b56c5c688568cd1b449cf3465.tar.gz chromium_src-8ff8763e823b748b56c5c688568cd1b449cf3465.tar.bz2 |
Avoid Google Chrome/Chromium default browser conflict by renaming Capabilities key.
BUG=9697
Review URL: http://codereview.chromium.org/62100
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13341 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer')
-rw-r--r-- | chrome/installer/setup/uninstall.cc | 8 | ||||
-rw-r--r-- | chrome/installer/util/shell_util.cc | 65 |
2 files changed, 32 insertions, 41 deletions
diff --git a/chrome/installer/setup/uninstall.cc b/chrome/installer/setup/uninstall.cc index 138f1da..d0b65ae 100644 --- a/chrome/installer/setup/uninstall.cc +++ b/chrome/installer/setup/uninstall.cc @@ -249,8 +249,14 @@ installer_util::InstallStatus installer_setup::UninstallChrome( DeleteRegistryKey(key, html_prog_id); std::wstring set_access_key(ShellUtil::kRegStartMenuInternet); - file_util::AppendToPath(&set_access_key, installer_util::kChromeExe); + file_util::AppendToPath(&set_access_key, dist->GetApplicationName()); DeleteRegistryKey(key, set_access_key); + // We have renamed the StartMenuInternet\chrome.exe to + // StartMenuInternet\Chromium so for old users we still need to delete + // the old key. + std::wstring old_set_access_key(ShellUtil::kRegStartMenuInternet); + file_util::AppendToPath(&old_set_access_key, installer_util::kChromeExe); + DeleteRegistryKey(key, old_set_access_key); DeleteRegistryValue(reg_root, ShellUtil::kRegRegisteredApplications, dist->GetApplicationName()); diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc index 290ad17..3015645 100644 --- a/chrome/installer/util/shell_util.cc +++ b/chrome/installer/util/shell_util.cc @@ -93,60 +93,45 @@ class RegistryEntry { ShellUtil::kChromeExtProgId)); BrowserDistribution* dist = BrowserDistribution::GetDistribution(); + std::wstring start_menu_entry(ShellUtil::kRegStartMenuInternet); + start_menu_entry.append(L"\\" + dist->GetApplicationName()); + entries.push_front(new RegistryEntry(start_menu_entry, + dist->GetApplicationName())); entries.push_front(new RegistryEntry( - L"Software\\Clients\\StartMenuInternet\\chrome.exe", - dist->GetApplicationName())); + start_menu_entry + ShellUtil::kRegShellOpen, quoted_exe_path)); entries.push_front(new RegistryEntry( - L"Software\\Clients\\StartMenuInternet\\chrome.exe\\shell\\open\\" - L"command", - quoted_exe_path)); - entries.push_front(new RegistryEntry( - L"Software\\Clients\\StartMenuInternet\\chrome.exe\\DefaultIcon", - icon_path)); - entries.push_front(new RegistryEntry( - L"Software\\Clients\\StartMenuInternet\\chrome.exe\\InstallInfo", - L"ReinstallCommand", + start_menu_entry + ShellUtil::kRegDefaultIcon, icon_path)); + + std::wstring install_info(start_menu_entry + L"\\InstallInfo"); + entries.push_front(new RegistryEntry(install_info, L"ReinstallCommand", quoted_exe_path + L" --" + switches::kMakeDefaultBrowser)); - entries.push_front(new RegistryEntry( - L"Software\\Clients\\StartMenuInternet\\chrome.exe\\InstallInfo", - L"HideIconsCommand", + entries.push_front(new RegistryEntry(install_info, L"HideIconsCommand", quoted_exe_path + L" --" + switches::kHideIcons)); - entries.push_front(new RegistryEntry( - L"Software\\Clients\\StartMenuInternet\\chrome.exe\\InstallInfo", - L"ShowIconsCommand", + entries.push_front(new RegistryEntry(install_info, L"ShowIconsCommand", quoted_exe_path + L" --" + switches::kShowIcons)); - entries.push_front(new RegistryEntry( - L"Software\\Clients\\StartMenuInternet\\chrome.exe\\InstallInfo", - L"IconsVisible", 1)); + entries.push_front(new RegistryEntry(install_info, L"IconsVisible", 1)); + std::wstring capabilities(start_menu_entry + L"\\Capabilities"); + entries.push_front(new RegistryEntry(ShellUtil::kRegRegisteredApplications, + dist->GetApplicationName(), + capabilities)); entries.push_front(new RegistryEntry( - ShellUtil::kRegRegisteredApplications, - dist->GetApplicationName(), - L"Software\\Clients\\StartMenuInternet\\chrome.exe\\Capabilities")); - entries.push_front(new RegistryEntry( - L"Software\\Clients\\StartMenuInternet\\chrome.exe\\Capabilities", - L"ApplicationDescription", dist->GetApplicationName())); + capabilities, L"ApplicationDescription", dist->GetApplicationName())); entries.push_front(new RegistryEntry( - L"Software\\Clients\\StartMenuInternet\\chrome.exe\\Capabilities", - L"ApplicationIcon", icon_path)); + capabilities, L"ApplicationIcon", icon_path)); entries.push_front(new RegistryEntry( - L"Software\\Clients\\StartMenuInternet\\chrome.exe\\Capabilities", - L"ApplicationName", dist->GetApplicationName())); + capabilities, L"ApplicationName", dist->GetApplicationName())); - entries.push_front(new RegistryEntry( - L"Software\\Clients\\StartMenuInternet\\chrome.exe\\Capabilities\\" - L"StartMenu", - L"StartMenuInternet", L"chrome.exe")); + entries.push_front(new RegistryEntry(capabilities + L"\\StartMenu", + L"StartMenuInternet", dist->GetApplicationName())); for (int i = 0; ShellUtil::kFileAssociations[i] != NULL; i++) { entries.push_front(new RegistryEntry( - L"Software\\Clients\\StartMenuInternet\\chrome.exe\\Capabilities\\" - L"FileAssociations", + capabilities + L"\\FileAssociations", ShellUtil::kFileAssociations[i], ShellUtil::kChromeHTMLProgId)); } for (int i = 0; ShellUtil::kProtocolAssociations[i] != NULL; i++) { entries.push_front(new RegistryEntry( - L"Software\\Clients\\StartMenuInternet\\chrome.exe\\Capabilities\\" - L"URLAssociations", + capabilities + L"\\URLAssociations", ShellUtil::kProtocolAssociations[i], ShellUtil::kChromeHTMLProgId)); } return entries; @@ -266,11 +251,11 @@ bool BindChromeAssociations(HKEY root_key, const std::wstring& chrome_exe) { } // start->Internet shortcut. - std::wstring exe_name = file_util::GetFilenameFromPath(chrome_exe); std::wstring start_internet(ShellUtil::kRegStartMenuInternet); items->AddCreateRegKeyWorkItem(root_key, start_internet); + BrowserDistribution* dist = BrowserDistribution::GetDistribution(); items->AddSetRegValueWorkItem(root_key, start_internet, L"", - exe_name, true); + dist->GetApplicationName(), true); // Apply all the registry changes and if there is a problem, rollback if (!items->Do()) { |