Chromium Code Reviews| Index: chrome/installer/setup/install_worker.cc |
| diff --git a/chrome/installer/setup/install_worker.cc b/chrome/installer/setup/install_worker.cc |
| index 2ef5660e3141f79a088857e02643586f4d49fd5a..7022a56acf41ca051527a71bc4ae64a2e1b7ca67 100644 |
| --- a/chrome/installer/setup/install_worker.cc |
| +++ b/chrome/installer/setup/install_worker.cc |
| @@ -169,25 +169,34 @@ void AddInstallerCopyTasks(const InstallerState& installer_state, |
| 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. |
| + // We don't copy the archive when only App Host is at user-level. Only |
|
grt (UTC plus 2)
2012/11/16 04:38:26
how are the App Host binary and this setup.exe kep
erikwright (departed)
2012/11/20 20:14:30
replied elsewhere.
|
| + // setup.exe is required, and only for uninstall. |
| + if (installer_state.products().size() != 1 || |
|
grt (UTC plus 2)
2012/11/16 13:32:42
the comment says to only skip this when doing the
erikwright (departed)
2012/11/16 13:58:33
The code reflects skipping this if exactly one pro
grt (UTC plus 2)
2012/11/16 14:14:59
sgtm
erikwright (departed)
2012/11/20 20:14:30
Done.
|
| + !installer_state.FindProduct(BrowserDistribution::CHROME_APP_HOST)) { |
| + 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 +418,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 |
| @@ -1085,6 +1089,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. |