diff options
author | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-17 00:18:27 +0000 |
---|---|---|
committer | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-17 00:18:27 +0000 |
commit | aae9cf7ec74de68a042357506ccd29b76b5885b9 (patch) | |
tree | ec2b547a02ca2d8faad5eab8450759548c3af1a7 /chrome/installer | |
parent | 6273e2e7892702061d535025f7144a005ea2fc5d (diff) | |
download | chromium_src-aae9cf7ec74de68a042357506ccd29b76b5885b9.zip chromium_src-aae9cf7ec74de68a042357506ccd29b76b5885b9.tar.gz chromium_src-aae9cf7ec74de68a042357506ccd29b76b5885b9.tar.bz2 |
Use different names for Chrome/Chromium for Chrome HTML prog id. If we
user the same name for both (ChromeHTML) Vista reports that http/https
are associated with Chrome as well as Chromium and each treats itself
as default browser.
Also do some cleanup - instead of trying to update only the Chrome open
cmd, go ahead and register the whole browser again (this doesn't change
user preferences).
BUG=9697
Review URL: http://codereview.chromium.org/67229
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13906 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer')
-rw-r--r-- | chrome/installer/setup/main.cc | 18 | ||||
-rw-r--r-- | chrome/installer/setup/setup.cc | 11 | ||||
-rw-r--r-- | chrome/installer/util/shell_util.cc | 18 |
3 files changed, 18 insertions, 29 deletions
diff --git a/chrome/installer/setup/main.cc b/chrome/installer/setup/main.cc index 2b57887..98b2191 100644 --- a/chrome/installer/setup/main.cc +++ b/chrome/installer/setup/main.cc @@ -294,21 +294,6 @@ void ReplaceRegistryValue(const std::wstring& reg_key, } } -// This method is only temporary to update Chrome open cmd for existing users -// of Chrome. This can be deleted once we make one release including this patch -// to every user. -void UpdateChromeOpenCmd(bool system_install) { - std::wstring chrome_exe = installer::GetChromeInstallPath(system_install); - file_util::AppendToPath(&chrome_exe, installer_util::kChromeExe); - std::wstring old_open_cmd = L"\"" + chrome_exe + L"\" \"%1\""; - std::wstring new_open_cmd = ShellUtil::GetChromeShellOpenCmd(chrome_exe); - std::wstring reg_key[] = { L"ChromeHTML\\shell\\open\\command", - L"http\\shell\\open\\command", - L"https\\shell\\open\\command" }; - for (int i = 0; i < _countof(reg_key); i++) - ReplaceRegistryValue(reg_key[i], old_open_cmd, new_open_cmd); -} - bool CheckPreInstallConditions(const installer::Version* installed_version, int options, installer_util::InstallStatus& status) { @@ -445,9 +430,6 @@ installer_util::InstallStatus InstallChrome(const CommandLine& cmd_line, if (!(options & installer_util::DO_NOT_LAUNCH_CHROME) && !(options & installer_util::SYSTEM_LEVEL)) installer::LaunchChrome(system_install); - } else if (install_status == installer_util::NEW_VERSION_UPDATED) { - // This is temporary hack and will be deleted after one release. - UpdateChromeOpenCmd(system_install); } } } diff --git a/chrome/installer/setup/setup.cc b/chrome/installer/setup/setup.cc index 32aa152..e59b702 100644 --- a/chrome/installer/setup/setup.cc +++ b/chrome/installer/setup/setup.cc @@ -40,7 +40,7 @@ void AddChromeToMediaPlayerList() { } -void DoFirstInstallTasks(std::wstring install_path, int options) { +void RegisterChromeOnMachine(std::wstring install_path, int options) { bool system_level = (options & installer_util::SYSTEM_LEVEL) != 0; // Try to add Chrome to Media Player shim inclusion list. We don't do any // error checking here because this operation will fail if user doesn't @@ -236,12 +236,9 @@ installer_util::InstallStatus installer::InstallOrUpdateChrome( install_path, new_version.GetString())) LOG(WARNING) << "Failed to create/update start menu shortcut."; - if (result == installer_util::FIRST_INSTALL_SUCCESS || - result == installer_util::INSTALL_REPAIRED) { - DoFirstInstallTasks(install_path, options); - } else { - RemoveOldVersionDirs(install_path, new_version.GetString()); - } + RemoveOldVersionDirs(install_path, new_version.GetString()); + + RegisterChromeOnMachine(install_path, options); } return result; diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc index 3015645..6370c61 100644 --- a/chrome/installer/util/shell_util.cc +++ b/chrome/installer/util/shell_util.cc @@ -53,12 +53,14 @@ class RegistryEntry { std::wstring quoted_exe_path = L"\"" + chrome_exe + L"\""; std::wstring open_cmd = ShellUtil::GetChromeShellOpenCmd(chrome_exe); - entries.push_front(new RegistryEntry(L"Software\\Classes\\ChromeHTML", + std::wstring chrome_html_prog_id(ShellUtil::kRegClasses); + file_util::AppendToPath(&chrome_html_prog_id, ShellUtil::kChromeHTMLProgId); + entries.push_front(new RegistryEntry(chrome_html_prog_id, ShellUtil::kChromeHTMLProgIdDesc)); entries.push_front(new RegistryEntry( - L"Software\\Classes\\ChromeHTML\\DefaultIcon", icon_path)); + chrome_html_prog_id + ShellUtil::kRegDefaultIcon, icon_path)); entries.push_front(new RegistryEntry( - L"Software\\Classes\\ChromeHTML\\shell\\open\\command", open_cmd)); + chrome_html_prog_id + ShellUtil::kRegShellOpen, open_cmd)); std::wstring exe_name = file_util::GetFilenameFromPath(chrome_exe); std::wstring app_key = L"Software\\Classes\\Applications\\" + exe_name + @@ -357,7 +359,9 @@ ShellUtil::RegisterStatus RegisterOnVista(const std::wstring& chrome_exe, // Remove unnecessary "URL Protocol" entry from shell registration. This value // was written by older installers so ignoring error conditions. void RemoveUrlProtocol(HKEY root) { - RegKey key(root, L"Software\\Classes\\ChromeHTML", KEY_ALL_ACCESS); + std::wstring chrome_html_prog_id(ShellUtil::kRegClasses); + file_util::AppendToPath(&chrome_html_prog_id, ShellUtil::kChromeHTMLProgId); + RegKey key(root, chrome_html_prog_id.c_str(), KEY_ALL_ACCESS); key.DeleteValue(ShellUtil::kRegUrlProtocol); } @@ -379,8 +383,14 @@ const wchar_t* ShellUtil::kAppPathsRegistryKey = L"Software\\Microsoft\\Windows\\CurrentVersion\\App Paths"; const wchar_t* ShellUtil::kAppPathsRegistryPathName = L"Path"; +#if defined(GOOGLE_CHROME_BUILD) const wchar_t* ShellUtil::kChromeHTMLProgId = L"ChromeHTML"; const wchar_t* ShellUtil::kChromeHTMLProgIdDesc = L"Chrome HTML"; +#else +const wchar_t* ShellUtil::kChromeHTMLProgId = L"ChromiumHTML"; +const wchar_t* ShellUtil::kChromeHTMLProgIdDesc = L"Chromium HTML"; +#endif + const wchar_t* ShellUtil::kFileAssociations[] = {L".htm", L".html", L".shtml", L".xht", L".xhtml", NULL}; const wchar_t* ShellUtil::kProtocolAssociations[] = {L"ftp", L"http", L"https", |