Chromium Code Reviews| Index: chrome/installer/util/shell_util.cc |
| diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc |
| index 5ababade20aec9b482ef9497fb9a5c179706bb92..425819b5d2e13e37acf197124945a76e10e2fedd 100644 |
| --- a/chrome/installer/util/shell_util.cc |
| +++ b/chrome/installer/util/shell_util.cc |
| @@ -239,11 +239,10 @@ class RegistryEntry { |
| // <root hkey>\Software\Classes\<app_id>\.exe\shell @=open |
| entries->push_back(new RegistryEntry(model_id_shell, |
| - ShellUtil::kRegVerbOpen)); |
| + ShellUtil::kRegVerbOpen)); |
| const wchar_t* const verbs[] = { ShellUtil::kRegVerbOpen, |
| - ShellUtil::kRegVerbOpenNewWindow, |
| - ShellUtil::kRegVerbRun }; |
| + ShellUtil::kRegVerbOpenNewWindow }; |
| for (size_t i = 0; i < arraysize(verbs); ++i) { |
| string16 sub_path(model_id_shell); |
| sub_path.push_back(FilePath::kSeparators[0]); |
| @@ -740,26 +739,31 @@ bool LaunchApplicationAssociationDialog(const string16& app_id) { |
| // present. This affected Chrome 20.0.1115.1 on the dev channel (and anyone who |
| // pulled a Canary >= 20.0.1112.0 and installed it manually as Google Chrome). |
| // This egregious hack is here to remove the bad values for those installs, and |
| -// should be removed after a reasonable time, say 2012-08-01. Anyone on Win8 |
| -// dev channel who hasn't been autoupdated or manually updated by then will have |
| -// to uninstall and reinstall Chrome to repair. See http://crbug.com/124666 and |
| -// http://crbug.com/123994 for gory details. |
| +// should be removed after a reasonable time, say 2012-08-01 (pushed back see |
|
grt (UTC plus 2)
2012/10/13 00:34:26
what do you think about retiring the old "remove b
gab
2012/10/13 03:33:12
Yea, I was tempted by that, but I want to merge th
grt (UTC plus 2)
2012/10/13 13:21:37
Okay
|
| +// below). Anyone on Win8 dev channel who hasn't been autoupdated or manually |
| +// updated by then will have to uninstall and reinstall Chrome to repair. |
| +// See http://crbug.com/124666 and http://crbug.com/123994 for gory details. |
| // This function is also used to remove DelegateExecute verb handler |
| // registrations on builds for which Metro is no longer supported. This will |
| // also become irrelevant sometime after Windows 8 RC (thus the aforementioned |
| // removal date remains correct). |
| +// For installs where we do register the Windows 8 only registrations, this |
| +// method will clean up an old verb (run) we used to register in |
| +// <root>\Software\Classes\Chrome<suffix>\.exe\shell\run. |
| +// TODO (gab): This was fixed before the official release of Windows 8 and thus |
|
grt (UTC plus 2)
2012/10/13 00:34:26
i think it's too late for this to be on stable bef
gab
2012/10/13 03:33:12
As mentioned above, my intent is to merge it in bo
grt (UTC plus 2)
2012/10/13 13:21:37
Merging it will not guarantee that.
grt (UTC plus 2)
2012/10/13 17:50:29
To elaborate, there will be a population of machin
gab
2012/10/13 19:02:09
Right, but see my reply/clarification on the bug.
gab
2012/10/15 21:15:57
Done.
|
| +// can safely be removed in February 2013. |
| void RemoveBadWindows8RegistrationIfNeeded( |
| BrowserDistribution* dist, |
| const string16& chrome_exe) { |
| + // There's no need to rollback, so forgo the usual work item lists and just |
| + // remove the values from the registry. |
| + bool is_per_user_install = |
| + InstallUtil::IsPerUserInstall(chrome_exe.c_str()); |
| + const HKEY root_key = is_per_user_install ? HKEY_CURRENT_USER : |
| + HKEY_LOCAL_MACHINE; |
| if (dist->GetCommandExecuteImplClsid(NULL) && |
| (!InstallUtil::HasDelegateExecuteHandler(dist, chrome_exe) || |
| !IsChromeMetroSupported())) { |
| - // There's no need to rollback, so forgo the usual work item lists and just |
| - // remove the values from the registry. |
| - bool is_per_user_install = |
| - InstallUtil::IsPerUserInstall(chrome_exe.c_str()); |
| - const HKEY root_key = is_per_user_install ? HKEY_CURRENT_USER : |
| - HKEY_LOCAL_MACHINE; |
| // Use the current installation's suffix, not the about-to-be-installed |
| // suffix. |
| const string16 installation_suffix( |
| @@ -780,6 +784,16 @@ void RemoveBadWindows8RegistrationIfNeeded( |
| key.append(ShellUtil::kRegShellOpen); |
| InstallUtil::DeleteRegistryValue(root_key, key, |
| ShellUtil::kRegDelegateExecute); |
| + } else { |
| + string16 run_verb_key(ShellUtil::kRegClasses); |
|
grt (UTC plus 2)
2012/10/13 00:34:26
this code is nearly impenetrable. please add a com
gab
2012/10/13 03:33:12
Done.
|
| + run_verb_key.push_back(FilePath::kSeparators[0]); |
| + run_verb_key.append(ShellUtil::GetBrowserModelId( |
| + dist, InstallUtil::IsPerUserInstall(chrome_exe.c_str()))); |
| + run_verb_key.append(ShellUtil::kRegExePath); |
| + run_verb_key.append(ShellUtil::kRegShellPath); |
| + run_verb_key.push_back(FilePath::kSeparators[0]); |
| + run_verb_key.append(ShellUtil::kRegVerbRun); |
| + InstallUtil::DeleteRegistryKey(root_key, run_verb_key); |
|
grt (UTC plus 2)
2012/10/13 00:34:26
this could be in HKCU even for a system-level inst
gab
2012/10/13 03:33:12
No, on Win8 all user level stuff is in HKCU and sy
grt (UTC plus 2)
2012/10/13 13:21:37
I expect there to be a great number of machines up
gab
2012/10/13 15:17:50
Well technically if this is merged in M22 and M23
grt (UTC plus 2)
2012/10/13 17:50:29
Ah, I just realized that the Win7 -> Win8 path is
gab
2012/10/13 19:02:09
Well not quite, the migration can also happen on n
|
| } |
| } |