Index: chrome/installer/setup/install_worker.cc |
diff --git a/chrome/installer/setup/install_worker.cc b/chrome/installer/setup/install_worker.cc |
index f7067c5fbe47e00ff74ba1933ee10e3f866477ad..6844f22a7cc1f6e68717c0cf873a645fb61d49f2 100644 |
--- a/chrome/installer/setup/install_worker.cc |
+++ b/chrome/installer/setup/install_worker.cc |
@@ -140,6 +140,7 @@ void AddUninstallShortcutWorkItems(const InstallerState& installer_state, |
AppendUninstallCommandLineFlags(installer_state, product, |
&uninstall_arguments); |
+ // TODO(erikwright): What does this mean? Chrome Frame _is_ in Add/Remove, No? |
tommi (sloooow) - chröme
2012/07/12 08:11:31
I think the comment is out of date and was probabl
grt (UTC plus 2)
2012/07/12 18:37:10
I think it refers to ready-mode, where Chrome Fram
erikwright (departed)
2012/07/16 20:13:11
Done.
|
// The Chrome uninstallation command serves as the master uninstall command |
// for Chrome + all other products (i.e. Chrome Frame) that do not have an |
// uninstall entry in the Add/Remove Programs dialog. We skip this processing |
@@ -563,7 +564,6 @@ void AddDeleteUninstallShortcutsForMSIWorkItems( |
// false. |
bool AppendPostInstallTasks(const InstallerState& installer_state, |
const FilePath& setup_path, |
- const FilePath& new_chrome_exe, |
const Version* current_version, |
const Version& new_version, |
const FilePath& temp_path, |
@@ -572,6 +572,8 @@ bool AppendPostInstallTasks(const InstallerState& installer_state, |
HKEY root = installer_state.root_key(); |
const Products& products = installer_state.products(); |
+ FilePath new_chrome_exe( |
+ installer_state.target_path().Append(installer::kChromeNewExe)); |
// Append work items that will only be executed if this was an update. |
// We update the 'opv' value with the current version that is active, |
@@ -712,23 +714,17 @@ bool AppendPostInstallTasks(const InstallerState& installer_state, |
return true; |
} |
-void AddInstallWorkItems(const InstallationState& original_state, |
- const InstallerState& installer_state, |
- const FilePath& setup_path, |
- const FilePath& archive_path, |
- const FilePath& src_path, |
- const FilePath& temp_path, |
- const Version& new_version, |
- scoped_ptr<Version>* current_version, |
- WorkItemList* install_list) { |
- DCHECK(install_list); |
- |
+void AddChromeWorkItems(const InstallationState& original_state, |
+ const InstallerState& installer_state, |
+ const FilePath& setup_path, |
+ const FilePath& archive_path, |
+ const FilePath& src_path, |
+ const FilePath& temp_path, |
+ const Version& new_version, |
+ scoped_ptr<Version>* current_version, |
+ WorkItemList* install_list) { |
const FilePath& target_path = installer_state.target_path(); |
- // A temp directory that work items need and the actual install directory. |
- install_list->AddCreateDirWorkItem(temp_path); |
- install_list->AddCreateDirWorkItem(target_path); |
- |
if (current_version != NULL && current_version->get() != NULL) { |
// Delete the archive from an existing install to save some disk space. We |
// make this an unconditional work item since there's no need to roll this |
@@ -840,6 +836,48 @@ void AddInstallWorkItems(const InstallationState& original_state, |
AddInstallerCopyTasks(installer_state, setup_path, archive_path, temp_path, |
new_version, install_list); |
+} |
+ |
+void AddInstallWorkItems(const InstallationState& original_state, |
+ const InstallerState& installer_state, |
+ const FilePath& setup_path, |
+ const FilePath& archive_path, |
+ const FilePath& src_path, |
+ const FilePath& temp_path, |
+ const Version& new_version, |
+ scoped_ptr<Version>* current_version, |
+ WorkItemList* install_list) { |
+ DCHECK(install_list); |
+ |
+ const FilePath& target_path = installer_state.target_path(); |
+ |
+ // A temp directory that work items need and the actual install directory. |
+ install_list->AddCreateDirWorkItem(temp_path); |
+ install_list->AddCreateDirWorkItem(target_path); |
+ |
+ if (installer_state.FindProduct(BrowserDistribution::CHROME_BROWSER) || |
+ installer_state.FindProduct(BrowserDistribution::CHROME_FRAME) || |
+ installer_state.FindProduct(BrowserDistribution::CHROME_BINARIES)) { |
+ AddChromeWorkItems(original_state, |
+ installer_state, |
+ setup_path, |
+ archive_path, |
+ src_path, |
+ temp_path, |
+ new_version, |
+ current_version, |
+ install_list); |
+ } |
+ |
+ if (installer_state.FindProduct(BrowserDistribution::CHROME_APP_HOST)) { |
+ install_list->AddCopyTreeWorkItem( |
+ src_path.Append(installer::kChromeAppHostExe).value(), |
+ target_path.Append(installer::kChromeAppHostExe).value(), |
+ temp_path.value(), |
+ WorkItem::ALWAYS, |
+ L""); |
+ } |
+ |
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. |
@@ -882,7 +920,6 @@ void AddInstallWorkItems(const InstallationState& original_state, |
// Append the tasks that run after the installation. |
AppendPostInstallTasks(installer_state, |
setup_path, |
- new_chrome_exe, |
current_version->get(), |
new_version, |
temp_path, |
@@ -1308,18 +1345,18 @@ void AddQuickEnableWorkItems(const InstallerState& installer_state, |
DCHECK(work_item_list); |
const bool system_install = installer_state.system_install(); |
- bool have_multi_chrome = false; |
+ bool have_chrome_binaries = false; |
bool have_chrome_frame = false; |
// STEP 1: Figure out the state of the machine before the operation. |
const ProductState* product_state = NULL; |
- // Is multi-install Chrome already on the machine? |
+ // Is Chrome Binaries already on the machine? |
tommi (sloooow) - chröme
2012/07/12 08:11:31
s/Is/Are the
erikwright (departed)
2012/07/16 20:13:11
Done.
|
product_state = |
machine_state.GetProductState(system_install, |
- BrowserDistribution::CHROME_BROWSER); |
+ BrowserDistribution::CHROME_BINARIES); |
if (product_state != NULL && product_state->is_multi_install()) |
- have_multi_chrome = true; |
+ have_chrome_binaries = true; |
// Is Chrome Frame !ready-mode already on the machine? |
product_state = |
@@ -1336,9 +1373,9 @@ void AddQuickEnableWorkItems(const InstallerState& installer_state, |
if (installer_state.operation() == InstallerState::UNINSTALL) { |
// Forget about multi-install Chrome if it is being uninstalled. |
product = |
- installer_state.FindProduct(BrowserDistribution::CHROME_BROWSER); |
+ installer_state.FindProduct(BrowserDistribution::CHROME_BINARIES); |
if (product != NULL && installer_state.is_multi_install()) |
- have_multi_chrome = false; |
+ have_chrome_binaries = false; |
// Forget about Chrome Frame if it is being uninstalled. Note that we don't |
// bother to check !HasOption(kOptionReadyMode) since have_chrome_frame |
@@ -1349,11 +1386,11 @@ void AddQuickEnableWorkItems(const InstallerState& installer_state, |
if (installer_state.FindProduct(BrowserDistribution::CHROME_FRAME) != NULL) |
have_chrome_frame = false; |
} else { |
- // Check if we're installing multi-install Chrome. |
+ // Check if we're installing Chrome Binaries |
product = |
- installer_state.FindProduct(BrowserDistribution::CHROME_BROWSER); |
+ installer_state.FindProduct(BrowserDistribution::CHROME_BINARIES); |
if (product != NULL && installer_state.is_multi_install()) |
- have_multi_chrome = true; |
+ have_chrome_binaries = true; |
// Check if we're installing Chrome Frame !ready-mode. |
product = installer_state.FindProduct(BrowserDistribution::CHROME_FRAME); |
@@ -1375,7 +1412,7 @@ void AddQuickEnableWorkItems(const InstallerState& installer_state, |
// multi-install Chrome isn't installed since we don't want them left |
// behind in any case. |
operation = REMOVE_COMMAND; |
- } else if (have_multi_chrome) { |
+ } else if (have_chrome_binaries) { |
// Chrome Frame isn't (to be) installed or is (to be) installed only in |
// ready-mode, while multi-install Chrome is (to be) installed. Add the |
// quick-enable-cf command to the binaries. |
@@ -1383,17 +1420,17 @@ void AddQuickEnableWorkItems(const InstallerState& installer_state, |
// The path to setup.exe contains the version of the Chrome binaries, so it |
// takes a little work to get it right. |
if (installer_state.operation() == InstallerState::UNINSTALL) { |
- // Chrome Frame is being uninstalled. Use the path to the currently |
- // installed Chrome setup.exe. |
+ // One or more products are being uninstalled, but not the binaries. Use |
+ // the path to the currently installed Chrome setup.exe. |
product_state = |
machine_state.GetProductState(system_install, |
- BrowserDistribution::CHROME_BROWSER); |
+ BrowserDistribution::CHROME_BINARIES); |
DCHECK(product_state); |
binaries_setup_path = product_state->uninstall_command().GetProgram(); |
} else { |
- // Chrome is being installed, updated, or otherwise being operated on. |
+ // Chrome Binaries are being installed, updated, or otherwise operated on. |
// Use the path to the given |setup_path| in the normal location of |
- // multi-install Chrome of the given |version|. |
+ // multi-install Chrome Binaries of the given |version|. |
DCHECK(installer_state.is_multi_install()); |
binaries_setup_path = |
installer_state.GetInstallerDirectory(*new_version).Append( |