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 d3366303404614eae086cd17f8ba6f37dcd9bd50..9547c38cc4cacea6a5669b7b8f7bc14f2c26eec9 100644 |
| --- a/chrome/installer/setup/install_worker.cc |
| +++ b/chrome/installer/setup/install_worker.cc |
| @@ -71,6 +71,11 @@ const wchar_t kIELowRightsPolicyOldGuid[] = |
| const wchar_t kElevationPolicyKeyPath[] = |
| L"SOFTWARE\\Microsoft\\Internet Explorer\\Low Rights\\ElevationPolicy\\"; |
| +// The legacy command ids for installing an application or extension. These are |
| +// only here so they can be removed from the registry. |
| +const wchar_t kLegacyCmdInstallApp[] = L"install-application"; |
| +const wchar_t kLegacyCmdInstallExtension[] = L"install-extension"; |
| + |
| void GetOldIELowRightsElevationPolicyKeyPath(base::string16* key_path) { |
| key_path->assign(kElevationPolicyKeyPath, |
| arraysize(kElevationPolicyKeyPath) - 1); |
| @@ -230,31 +235,16 @@ void AddCommandWithParameterWorkItems(const InstallerState& installer_state, |
| } |
| } |
| -void AddInstallAppCommandWorkItems(const InstallerState& installer_state, |
| - const InstallationState& machine_state, |
| - const Version& new_version, |
| - const Product& product, |
| - WorkItemList* work_item_list) { |
| - DCHECK(product.is_chrome_app_host()); |
| - AddCommandWithParameterWorkItems(installer_state, machine_state, new_version, |
| - product, kCmdInstallApp, |
| - installer::kChromeAppHostExe, |
| - ::switches::kInstallFromWebstore, |
| - work_item_list); |
| -} |
| - |
| -void AddInstallExtensionCommandWorkItem(const InstallerState& installer_state, |
| - const InstallationState& machine_state, |
| - const base::FilePath& setup_path, |
| - const Version& new_version, |
| - const Product& product, |
| - WorkItemList* work_item_list) { |
| - DCHECK(product.is_chrome()); |
| - AddCommandWithParameterWorkItems(installer_state, machine_state, new_version, |
| - product, kCmdInstallExtension, |
| - installer::kChromeExe, |
| - ::switches::kLimitedInstallFromWebstore, |
| - work_item_list); |
| +void AddLegacyAppCommandRemovalItem(const InstallerState& installer_state, |
| + BrowserDistribution* distribution, |
| + const wchar_t* name, |
| + WorkItemList* work_item_list) { |
| + // These failures are ignored because this is a clean-up operation that |
| + // shouldn't block an install or update on failing. |
| + work_item_list->AddDeleteRegKeyWorkItem( |
| + installer_state.root_key(), |
| + GetRegCommandKey(product.distribution(), name), |
|
grt (UTC plus 2)
2014/09/30 19:57:24
product.distribution() -> distribution
Devlin
2014/09/30 20:24:12
Whoops, sorry. Done.
|
| + KEY_WOW64_32KEY)->set_ignore_failure(true); |
| } |
| // A callback invoked by |work_item| that adds firewall rules for Chrome. Rules |
| @@ -401,17 +391,13 @@ void AddProductSpecificWorkItems(const InstallationState& original_state, |
| for (Products::const_iterator it = products.begin(); it < products.end(); |
| ++it) { |
| const Product& p = **it; |
| - if (p.is_chrome_app_host()) { |
| - AddInstallAppCommandWorkItems(installer_state, original_state, |
| - new_version, p, list); |
| - } |
| if (p.is_chrome()) { |
| AddOsUpgradeWorkItems(installer_state, setup_path, new_version, p, |
| list); |
| - AddInstallExtensionCommandWorkItem(installer_state, original_state, |
| - setup_path, new_version, p, list); |
| AddFirewallRulesWorkItems( |
| installer_state, p.distribution(), is_new_install, list); |
| + AddLegacyAppCommandRemovalItem( |
| + installer_state, p.distribution(), kLegacyCmdInstallExtension, list); |
| } |
| if (p.is_chrome_binaries()) { |
| AddQueryEULAAcceptanceWorkItems( |
| @@ -1345,6 +1331,14 @@ void AddInstallWorkItems(const InstallationState& original_state, |
| current_version == NULL, |
| install_list); |
| + // Remove the legacy "install-application" commmand from all products. |
|
grt (UTC plus 2)
2014/09/30 19:57:24
suggestion:
// Unconditionally remove the "insta
Devlin
2014/09/30 20:24:11
Done.
|
| + AddLegacyAppCommandRemovalItem( |
| + installer_state, |
| + BrowserDistribution::GetSpecificDistribution( |
| + BrowserDistribution::CHROME_APP_HOST, |
|
grt (UTC plus 2)
2014/09/30 19:57:24
BrowserDistribution::CHROME_APP_HOST, -> BrowserDi
Devlin
2014/09/30 20:24:12
D'oh. Working on Linux, so compilation means a tr
|
| + kLegacyCmdInstallApp, |
| + list); |
| + |
| // Copy over brand, usagestats, and other values. |
| AddGoogleUpdateWorkItems(original_state, installer_state, install_list); |