diff options
author | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-17 23:23:54 +0000 |
---|---|---|
committer | kuchhal@chromium.org <kuchhal@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-17 23:23:54 +0000 |
commit | e1119fd89881a3ce9683f98ff8eacf9bac86d319 (patch) | |
tree | 5c81eac09052656ee964fe5060a5b18d5e45f02c /chrome/installer | |
parent | c02d073b528ab61ac3556b8683451fba52f2d9d3 (diff) | |
download | chromium_src-e1119fd89881a3ce9683f98ff8eacf9bac86d319.zip chromium_src-e1119fd89881a3ce9683f98ff8eacf9bac86d319.tar.gz chromium_src-e1119fd89881a3ce9683f98ff8eacf9bac86d319.tar.bz2 |
In system level install case go back to copying files instead of moving them.
BUG=10656
Review URL: http://codereview.chromium.org/79060
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13979 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/installer')
-rw-r--r-- | chrome/installer/setup/install.cc | 35 |
1 files changed, 25 insertions, 10 deletions
diff --git a/chrome/installer/setup/install.cc b/chrome/installer/setup/install.cc index d872335..e63885a8 100644 --- a/chrome/installer/setup/install.cc +++ b/chrome/installer/setup/install.cc @@ -98,7 +98,8 @@ void AddInstallerCopyTasks(const std::wstring& exe_path, 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 @@ void AddInstallerCopyTasks(const std::wstring& exe_path, 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 @@ bool installer::InstallNewVersion(const std::wstring& exe_path, 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 @@ bool installer::InstallNewVersion(const std::wstring& exe_path, // 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 @@ bool installer::InstallNewVersion(const std::wstring& exe_path, // 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()); |