Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5398)

Unified Diff: chrome/installer/util/shell_util.cc

Issue 19758: ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/installer/util/shell_util.h ('k') | chrome/installer/util/util_constants.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/util/shell_util.cc
===================================================================
--- chrome/installer/util/shell_util.cc (revision 8822)
+++ chrome/installer/util/shell_util.cc (working copy)
@@ -13,6 +13,7 @@
#include "chrome/installer/util/shell_util.h"
+#include "base/file_path.h"
#include "base/file_util.h"
#include "base/logging.h"
#include "base/path_service.h"
@@ -291,6 +292,11 @@
delete (*itr);
}
+ // Append the App Paths registry entries. Do this only if we are an admin,
+ // since they are always written to HKLM.
+ if (IsUserAnAdmin())
+ ShellUtil::AddChromeAppPathWorkItems(chrome_exe, items.get());
+
// Apply all the registry changes and if there is a problem, rollback.
if (!items->Do()) {
LOG(ERROR) << "Failed to add Chrome to Set Program Access and Defaults";
@@ -436,6 +442,29 @@
return true;
}
+void ShellUtil::AddChromeAppPathWorkItems(
+ const std::wstring& chrome_exe, WorkItemList* item_list) {
+ WorkItem* create_work_item = WorkItem::CreateCreateRegKeyWorkItem(
+ HKEY_LOCAL_MACHINE, installer_util::kAppPathsRegistryKey);
+
+ item_list->AddWorkItem(create_work_item);
+
+ WorkItem* set_default_value_work_item =
+ WorkItem::CreateSetRegValueWorkItem(HKEY_LOCAL_MACHINE,
+ installer_util::kAppPathsRegistryKey,
+ installer_util::kAppPathsRegistryDefaultName,
+ chrome_exe, true);
+ item_list->AddWorkItem(set_default_value_work_item);
+
+ FilePath chrome_path(chrome_exe);
+ WorkItem* set_path_value_work_item =
+ WorkItem::CreateSetRegValueWorkItem(HKEY_LOCAL_MACHINE,
+ installer_util::kAppPathsRegistryKey,
+ installer_util::kAppPathsRegistryPathName,
+ chrome_path.DirName().value(), true);
+ item_list->AddWorkItem(set_path_value_work_item);
+}
+
bool ShellUtil::CreateChromeDesktopShortcut(const std::wstring& chrome_exe,
int shell_change,
bool create_new) {
« no previous file with comments | « chrome/installer/util/shell_util.h ('k') | chrome/installer/util/util_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698