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

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

Issue 11412015: Copy setup when quick-enabling app host to user-level from system-level. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: sync Created 8 years 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 | chrome/installer/setup/setup_main.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/setup/install_worker.cc
diff --git a/chrome/installer/setup/install_worker.cc b/chrome/installer/setup/install_worker.cc
index d89a71d0f3fd5c10dcae3f0043b7ae158d32651a..245abc4f53cf4e3b9ec25cfd5a03f91e822e88cc 100644
--- a/chrome/installer/setup/install_worker.cc
+++ b/chrome/installer/setup/install_worker.cc
@@ -162,32 +162,42 @@ void AddInstallerCopyTasks(const InstallerState& installer_state,
install_list->AddCreateDirWorkItem(installer_dir);
FilePath exe_dst(installer_dir.Append(setup_path.BaseName()));
- FilePath archive_dst(installer_dir.Append(archive_path.BaseName()));
if (exe_dst != setup_path) {
install_list->AddCopyTreeWorkItem(setup_path.value(), exe_dst.value(),
temp_path.value(), WorkItem::ALWAYS);
}
- if (archive_path != archive_dst) {
- // In the past, we copied rather than moved for system level installs so
- // that the permissions of %ProgramFiles% would be picked up. Now that
- // |temp_path| is in %ProgramFiles% for system level installs (and in
- // %LOCALAPPDATA% otherwise), there is no need to do this for the archive.
- // Setup.exe, on the other hand, is created elsewhere so it must always be
- // copied.
+ // If only the App Host (not even the Chrome Binaries) is being installed,
+ // this must be a user-level App Host piggybacking on system-level Chrome
+ // Binaries. Only setup.exe is required, and only for uninstall.
+ if (installer_state.products().size() != 1 ||
+ !installer_state.FindProduct(BrowserDistribution::CHROME_APP_HOST)) {
+ FilePath archive_dst(installer_dir.Append(archive_path.BaseName()));
+ if (archive_path != archive_dst) {
+ // In the past, we copied rather than moved for system level installs so
+ // that the permissions of %ProgramFiles% would be picked up. Now that
+ // |temp_path| is in %ProgramFiles% for system level installs (and in
+ // %LOCALAPPDATA% otherwise), there is no need to do this for the archive.
+ // Setup.exe, on the other hand, is created elsewhere so it must always be
+ // copied.
#if !defined(COMPONENT_BUILD)
- install_list->AddMoveTreeWorkItem(archive_path.value(), archive_dst.value(),
- temp_path.value(), WorkItem::ALWAYS_MOVE);
+ install_list->AddMoveTreeWorkItem(archive_path.value(),
+ archive_dst.value(),
+ temp_path.value(),
+ WorkItem::ALWAYS_MOVE);
#else // COMPONENT_BUILD
- // The archive is usually extracted in |temp_path| in which case we want to
- // move it as mentioned above; however in the component build, setup.exe
- // uses chrome.7z directly from the build output, moving it means that
- // setup.exe cannot be run again without regenerating the archive, so copy
- // it instead in this case to save developer time.
- install_list->AddCopyTreeWorkItem(archive_path.value(), archive_dst.value(),
- temp_path.value(), WorkItem::ALWAYS);
+ // The archive is usually extracted in |temp_path| in which case we want
+ // to move it as mentioned above; however in the component build,
+ // setup.exe uses chrome.7z directly from the build output, moving it
+ // means that setup.exe cannot be run again without regenerating the
+ // archive, so copy it instead in this case to save developer time.
+ install_list->AddCopyTreeWorkItem(archive_path.value(),
+ archive_dst.value(),
+ temp_path.value(),
+ WorkItem::ALWAYS);
#endif // COMPONENT_BUILD
+ }
}
}
@@ -409,11 +419,6 @@ void AddChromeWorkItems(const InstallationState& original_state,
install_list->AddDeleteTreeWorkItem(
target_path.Append(installer::kChromeOldExe), temp_path)->
set_ignore_failure(true);
-
- // Copy installer in install directory and
- // add shortcut in Control Panel->Add/Remove Programs.
- AddInstallerCopyTasks(installer_state, setup_path, archive_path, temp_path,
- new_version, install_list);
}
// Probes COM machinery to get an instance of delegate_execute.exe's
@@ -1083,6 +1088,10 @@ void AddInstallWorkItems(const InstallationState& original_state,
L"");
}
+ // Copy installer in install directory
+ AddInstallerCopyTasks(installer_state, setup_path, archive_path, temp_path,
+ new_version, install_list);
+
const HKEY root = installer_state.root_key();
// Only set "lang" for user-level installs since for system-level, the install
// language may not be related to a given user's runtime language.
« no previous file with comments | « no previous file | chrome/installer/setup/setup_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698