summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-16 21:15:06 +0000
committergab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-16 21:15:06 +0000
commitad0655372571681cc502756e97fb930b93bc4d05 (patch)
treee349237b8367331fea62d40af6e56a6e436db875
parentc6ce9101284251d6338a53bc53ecd35956776287 (diff)
downloadchromium_src-ad0655372571681cc502756e97fb930b93bc4d05.zip
chromium_src-ad0655372571681cc502756e97fb930b93bc4d05.tar.gz
chromium_src-ad0655372571681cc502756e97fb930b93bc4d05.tar.bz2
Remove the run verb on Windows 8.
R=grt@chromium.org BUG=155640 TEST=Install old Chrome (user and system level), over-install new Chrome, make sure <root>\Software\Classes\Chrome<suffix>\.exe\shell\run is deleted. Review URL: https://chromiumcodereview.appspot.com/11146003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162250 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/installer/util/shell_util.cc32
1 files changed, 29 insertions, 3 deletions
diff --git a/chrome/installer/util/shell_util.cc b/chrome/installer/util/shell_util.cc
index c48bdd6..0a84a5f 100644
--- a/chrome/installer/util/shell_util.cc
+++ b/chrome/installer/util/shell_util.cc
@@ -240,11 +240,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]);
@@ -1016,6 +1015,30 @@ base::win::ShortcutProperties GetShortcutPropertiesFromChromeShortcutProperties(
return shortcut_properties;
}
+// Cleans up an old verb (run) we used to register in
+// <root>\Software\Classes\Chrome<.suffix>\.exe\shell\run on Windows 8.
+// TODO (gab): This was fixed before the general availability of Windows 8 and
+// thus can safely be removed in February 2013.
+void RemoveRunVerbOnWindows8(
+ BrowserDistribution* dist,
+ const string16& chrome_exe) {
+ if (IsChromeMetroSupported()) {
+ bool is_per_user_install =InstallUtil::IsPerUserInstall(chrome_exe.c_str());
+ HKEY root_key = DetermineShellIntegrationRoot(is_per_user_install);
+ // There's no need to rollback, so forgo the usual work item lists and just
+ // remove the key from the registry.
+ string16 run_verb_key(ShellUtil::kRegClasses);
+ run_verb_key.push_back(FilePath::kSeparators[0]);
+ run_verb_key.append(ShellUtil::GetBrowserModelId(
+ dist, is_per_user_install));
+ 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);
+ }
+}
+
// Gets the short (8.3) form of |path|, putting the result in |short_path| and
// returning true on success. |short_path| is not modified on failure.
bool ShortNameFromPath(const FilePath& path, string16* short_path) {
@@ -1694,6 +1717,9 @@ bool ShellUtil::RegisterChromeBrowser(BrowserDistribution* dist,
// TODO(grt): remove this on or after 2012-08-01; see impl for details.
RemoveBadWindows8RegistrationIfNeeded(dist, chrome_exe);
+ // TODO(gab): remove this on or after 2013-02-01; see impl for details.
+ RemoveRunVerbOnWindows8(dist, chrome_exe);
+
// Check if Chromium is already registered with this suffix.
if (IsChromeRegistered(dist, chrome_exe, suffix))
return true;