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

Unified Diff: chrome/installer/setup/install.cc

Issue 79084: Merge r13979... (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/branches/172/src/
Patch Set: Created 11 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/setup/install.cc
===================================================================
--- chrome/installer/setup/install.cc (revision 14012)
+++ chrome/installer/setup/install.cc (working copy)
@@ -98,7 +98,8 @@
const std::wstring& temp_path,
const std::wstring& install_path,
const std::wstring& new_version,
- WorkItemList* install_list) {
+ WorkItemList* install_list,
+ bool system_level) {
std::wstring installer_dir(installer::GetInstallerPathUnderChrome(
install_path, new_version));
install_list->AddCreateDirWorkItem(installer_dir);
@@ -112,7 +113,12 @@
install_list->AddCopyTreeWorkItem(exe_path, exe_dst, temp_path,
WorkItem::ALWAYS);
- install_list->AddMoveTreeWorkItem(archive_path, archive_dst, temp_path);
+ if (system_level) {
+ install_list->AddCopyTreeWorkItem(archive_path, archive_dst, temp_path,
+ WorkItem::ALWAYS);
+ } else {
+ install_list->AddMoveTreeWorkItem(archive_path, archive_dst, temp_path);
+ }
}
// This method tells if we are running on 64 bit platform so that we can copy
@@ -150,11 +156,19 @@
install_list->AddCreateDirWorkItem(temp_dir);
install_list->AddCreateDirWorkItem(install_path);
- // Move the version folder
- install_list->AddMoveTreeWorkItem(
- AppendPath(src_path, new_version.GetString()),
- AppendPath(install_path, new_version.GetString()),
- temp_dir);
+ // If it is system level install copy the version folder (since we want to
+ // take the permissions of %ProgramFiles% folder) otherwise just move it.
+ if (reg_root == HKEY_LOCAL_MACHINE) {
+ install_list->AddCopyTreeWorkItem(
+ AppendPath(src_path, new_version.GetString()),
+ AppendPath(install_path, new_version.GetString()),
+ temp_dir, WorkItem::ALWAYS);
+ } else {
+ install_list->AddMoveTreeWorkItem(
+ AppendPath(src_path, new_version.GetString()),
+ AppendPath(install_path, new_version.GetString()),
+ temp_dir);
+ }
// Delete any new_chrome.exe if present (we will end up create a new one
// if required) and then copy chrome.exe
@@ -177,10 +191,10 @@
// Extra executable for 64 bit systems.
if (Is64bit()) {
- install_list->AddMoveTreeWorkItem(
+ install_list->AddCopyTreeWorkItem(
AppendPath(src_path, installer::kWowHelperExe),
AppendPath(install_path, installer::kWowHelperExe),
- temp_dir);
+ temp_dir, WorkItem::ALWAYS);
}
// Copy the default Dictionaries only if the folder doesnt exist already
@@ -192,7 +206,8 @@
// Copy installer in install directory and
// add shortcut in Control Panel->Add/Remove Programs.
AddInstallerCopyTasks(exe_path, archive_path, temp_dir, install_path,
- new_version.GetString(), install_list.get());
+ new_version.GetString(), install_list.get(),
+ (reg_root == HKEY_LOCAL_MACHINE));
std::wstring product_name = dist->GetApplicationName();
AddUninstallShortcutWorkItems(reg_root, exe_path, install_path,
product_name, new_version.GetString(), install_list.get());
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698