summaryrefslogtreecommitdiffstats
path: root/chrome/installer/util/install_util.cc
diff options
context:
space:
mode:
authorgab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-17 07:54:24 +0000
committergab@chromium.org <gab@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-17 07:54:24 +0000
commit0cb3b25055494db705ffca1df181afbcaf64d6fb (patch)
tree57ea3c21e1489e5b3cd992d38a5e001e8d6baf81 /chrome/installer/util/install_util.cc
parent9b10059674ad8b44d93ff9e9cfb43235272cdd52 (diff)
downloadchromium_src-0cb3b25055494db705ffca1df181afbcaf64d6fb.zip
chromium_src-0cb3b25055494db705ffca1df181afbcaf64d6fb.tar.gz
chromium_src-0cb3b25055494db705ffca1df181afbcaf64d6fb.tar.bz2
Always suffix ChromeHTML entries on Windows for user-level installs.
This also adds the same suffixing to Chrome's appname for Default Programs registration (this suffix is not user-facing though as we don't suffix the actual string representing Chrome in the UI... obviously!) Design doc: https://docs.google.com/a/chromium.org/document/d/1qmcV3uYBh3JwvXhYkI7asg0nN7KfVMWVOzND4p0jQ3E/edit BUG=125362,124013,133173 TEST=http://goo.gl/ZZ7gE Review URL: https://chromiumcodereview.appspot.com/10451074 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142634 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer/util/install_util.cc')
-rw-r--r--chrome/installer/util/install_util.cc25
1 files changed, 12 insertions, 13 deletions
diff --git a/chrome/installer/util/install_util.cc b/chrome/installer/util/install_util.cc
index d61c0b9..4b096ef 100644
--- a/chrome/installer/util/install_util.cc
+++ b/chrome/installer/util/install_util.cc
@@ -360,8 +360,8 @@ bool InstallUtil::HasDelegateExecuteHandler(BrowserDistribution* dist,
}
// This method tries to delete a registry key and logs an error message
-// in case of failure. It returns true if deletion is successful,
-// otherwise false.
+// in case of failure. It returns true if deletion is successful (or the key did
+// not exist), otherwise false.
bool InstallUtil::DeleteRegistryKey(HKEY root_key,
const string16& key_path) {
VLOG(1) << "Deleting registry key " << key_path;
@@ -375,20 +375,19 @@ bool InstallUtil::DeleteRegistryKey(HKEY root_key,
}
// This method tries to delete a registry value and logs an error message
-// in case of failure. It returns true if deletion is successful,
-// otherwise false.
+// in case of failure. It returns true if deletion is successful (or the key did
+// not exist), otherwise false.
bool InstallUtil::DeleteRegistryValue(HKEY reg_root,
const string16& key_path,
const string16& value_name) {
- RegKey key(reg_root, key_path.c_str(), KEY_ALL_ACCESS);
- VLOG(1) << "Deleting registry value " << value_name;
- if (key.HasValue(value_name.c_str())) {
- LONG result = key.DeleteValue(value_name.c_str());
- if (result != ERROR_SUCCESS) {
- LOG(ERROR) << "Failed to delete registry value: " << value_name
- << " error: " << result;
- return false;
- }
+ RegKey key;
+ LONG result = key.Open(reg_root, key_path.c_str(), KEY_SET_VALUE);
+ if (result == ERROR_SUCCESS)
+ result = key.DeleteValue(value_name.c_str());
+ if (result != ERROR_SUCCESS && result != ERROR_FILE_NOT_FOUND) {
+ LOG(ERROR) << "Failed to delete registry value: " << value_name
+ << " error: " << result;
+ return false;
}
return true;
}