Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 // | 4 // |
| 5 // This file contains the definitions of the installer functions that build | 5 // This file contains the definitions of the installer functions that build |
| 6 // the WorkItemList used to install the application. | 6 // the WorkItemList used to install the application. |
| 7 | 7 |
| 8 #include "chrome/installer/setup/install_worker.h" | 8 #include "chrome/installer/setup/install_worker.h" |
| 9 | 9 |
| 10 #include <oaidl.h> | 10 #include <oaidl.h> |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 64 // Although the UUID of the ChromeFrame class is used for the "current" value, | 64 // Although the UUID of the ChromeFrame class is used for the "current" value, |
| 65 // this is done only as a convenience; there is no need for the GUID of the Low | 65 // this is done only as a convenience; there is no need for the GUID of the Low |
| 66 // Rights policies to match the ChromeFrame class's GUID. Hence, it is safe to | 66 // Rights policies to match the ChromeFrame class's GUID. Hence, it is safe to |
| 67 // use this completely unrelated GUID for the "old" policies. | 67 // use this completely unrelated GUID for the "old" policies. |
| 68 const wchar_t kIELowRightsPolicyOldGuid[] = | 68 const wchar_t kIELowRightsPolicyOldGuid[] = |
| 69 L"{6C288DD7-76FB-4721-B628-56FAC252E199}"; | 69 L"{6C288DD7-76FB-4721-B628-56FAC252E199}"; |
| 70 | 70 |
| 71 const wchar_t kElevationPolicyKeyPath[] = | 71 const wchar_t kElevationPolicyKeyPath[] = |
| 72 L"SOFTWARE\\Microsoft\\Internet Explorer\\Low Rights\\ElevationPolicy\\"; | 72 L"SOFTWARE\\Microsoft\\Internet Explorer\\Low Rights\\ElevationPolicy\\"; |
| 73 | 73 |
| 74 // The legacy command ids for installing an application or extension. These are | |
| 75 // only here so they can be removed from the registry. | |
| 76 const wchar_t kLegacyCmdInstallApp[] = L"install-application"; | |
| 77 const wchar_t kLegacyCmdInstallExtension[] = L"install-extension"; | |
| 78 | |
| 74 void GetOldIELowRightsElevationPolicyKeyPath(base::string16* key_path) { | 79 void GetOldIELowRightsElevationPolicyKeyPath(base::string16* key_path) { |
| 75 key_path->assign(kElevationPolicyKeyPath, | 80 key_path->assign(kElevationPolicyKeyPath, |
| 76 arraysize(kElevationPolicyKeyPath) - 1); | 81 arraysize(kElevationPolicyKeyPath) - 1); |
| 77 key_path->append(kIELowRightsPolicyOldGuid, | 82 key_path->append(kIELowRightsPolicyOldGuid, |
| 78 arraysize(kIELowRightsPolicyOldGuid)- 1); | 83 arraysize(kIELowRightsPolicyOldGuid)- 1); |
| 79 } | 84 } |
| 80 | 85 |
| 81 // Local helper to call AddRegisterComDllWorkItems for all DLLs in a set of | 86 // Local helper to call AddRegisterComDllWorkItems for all DLLs in a set of |
| 82 // products managed by a given package. | 87 // products managed by a given package. |
| 83 // |old_version| can be NULL to indicate no Chrome is currently installed. | 88 // |old_version| can be NULL to indicate no Chrome is currently installed. |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 223 cmd_line.AppendSwitchASCII(command_with_parameter, "%1"); | 228 cmd_line.AppendSwitchASCII(command_with_parameter, "%1"); |
| 224 | 229 |
| 225 AppCommand cmd(cmd_line.GetCommandLineString()); | 230 AppCommand cmd(cmd_line.GetCommandLineString()); |
| 226 cmd.set_sends_pings(true); | 231 cmd.set_sends_pings(true); |
| 227 cmd.set_is_web_accessible(true); | 232 cmd.set_is_web_accessible(true); |
| 228 cmd.set_is_run_as_user(true); | 233 cmd.set_is_run_as_user(true); |
| 229 cmd.AddWorkItems(installer_state.root_key(), full_cmd_key, work_item_list); | 234 cmd.AddWorkItems(installer_state.root_key(), full_cmd_key, work_item_list); |
| 230 } | 235 } |
| 231 } | 236 } |
| 232 | 237 |
| 233 void AddInstallAppCommandWorkItems(const InstallerState& installer_state, | 238 void AddLegacyRemovalItem(const InstallerState& installer_state, |
| 234 const InstallationState& machine_state, | 239 const Product& product, |
| 235 const Version& new_version, | 240 const wchar_t* name, |
| 236 const Product& product, | 241 WorkItemList* work_item_list) { |
| 237 WorkItemList* work_item_list) { | 242 // These failures are ignored because this is a clean-up operation that |
| 238 DCHECK(product.is_chrome_app_host()); | 243 // shouldn't block an install or update on failing. |
| 239 AddCommandWithParameterWorkItems(installer_state, machine_state, new_version, | 244 work_item_list->AddDeleteRegKeyWorkItem( |
| 240 product, kCmdInstallApp, | 245 installer_state.root_key(), |
| 241 installer::kChromeAppHostExe, | 246 GetRegCommandKey(product.distribution(), name), |
| 242 ::switches::kInstallFromWebstore, | 247 KEY_WOW64_32KEY)->set_ignore_failure(true); |
| 243 work_item_list); | |
| 244 } | |
| 245 | |
| 246 void AddInstallExtensionCommandWorkItem(const InstallerState& installer_state, | |
| 247 const InstallationState& machine_state, | |
| 248 const base::FilePath& setup_path, | |
| 249 const Version& new_version, | |
| 250 const Product& product, | |
| 251 WorkItemList* work_item_list) { | |
| 252 DCHECK(product.is_chrome()); | |
| 253 AddCommandWithParameterWorkItems(installer_state, machine_state, new_version, | |
| 254 product, kCmdInstallExtension, | |
| 255 installer::kChromeExe, | |
| 256 ::switches::kLimitedInstallFromWebstore, | |
| 257 work_item_list); | |
| 258 } | 248 } |
| 259 | 249 |
| 260 // A callback invoked by |work_item| that adds firewall rules for Chrome. Rules | 250 // A callback invoked by |work_item| that adds firewall rules for Chrome. Rules |
| 261 // are left in-place on rollback unless |remove_on_rollback| is true. This is | 251 // are left in-place on rollback unless |remove_on_rollback| is true. This is |
| 262 // the case for new installs only. Updates and overinstalls leave the rule | 252 // the case for new installs only. Updates and overinstalls leave the rule |
| 263 // in-place on rollback since a previous install of Chrome will be used in that | 253 // in-place on rollback since a previous install of Chrome will be used in that |
| 264 // case. | 254 // case. |
| 265 bool AddFirewallRulesCallback(bool system_level, | 255 bool AddFirewallRulesCallback(bool system_level, |
| 266 BrowserDistribution* dist, | 256 BrowserDistribution* dist, |
| 267 const base::FilePath& chrome_path, | 257 const base::FilePath& chrome_path, |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 394 void AddProductSpecificWorkItems(const InstallationState& original_state, | 384 void AddProductSpecificWorkItems(const InstallationState& original_state, |
| 395 const InstallerState& installer_state, | 385 const InstallerState& installer_state, |
| 396 const base::FilePath& setup_path, | 386 const base::FilePath& setup_path, |
| 397 const Version& new_version, | 387 const Version& new_version, |
| 398 bool is_new_install, | 388 bool is_new_install, |
| 399 WorkItemList* list) { | 389 WorkItemList* list) { |
| 400 const Products& products = installer_state.products(); | 390 const Products& products = installer_state.products(); |
| 401 for (Products::const_iterator it = products.begin(); it < products.end(); | 391 for (Products::const_iterator it = products.begin(); it < products.end(); |
| 402 ++it) { | 392 ++it) { |
| 403 const Product& p = **it; | 393 const Product& p = **it; |
| 404 if (p.is_chrome_app_host()) { | 394 if (p.is_chrome_app_host()) |
| 405 AddInstallAppCommandWorkItems(installer_state, original_state, | 395 AddLegacyRemovalItem(installer_state, p, kLegacyCmdInstallApp, list); |
| 406 new_version, p, list); | |
| 407 } | |
| 408 if (p.is_chrome()) { | 396 if (p.is_chrome()) { |
| 409 AddOsUpgradeWorkItems(installer_state, setup_path, new_version, p, | 397 AddOsUpgradeWorkItems(installer_state, setup_path, new_version, p, |
| 410 list); | 398 list); |
| 411 AddInstallExtensionCommandWorkItem(installer_state, original_state, | |
| 412 setup_path, new_version, p, list); | |
| 413 AddFirewallRulesWorkItems( | 399 AddFirewallRulesWorkItems( |
| 414 installer_state, p.distribution(), is_new_install, list); | 400 installer_state, p.distribution(), is_new_install, list); |
| 401 AddLegacyRemovalItem( | |
| 402 installer_state, p, kLegacyCmdInstallExtension, list); | |
| 415 } | 403 } |
| 416 if (p.is_chrome_binaries()) { | 404 if (p.is_chrome_binaries()) { |
| 417 AddQueryEULAAcceptanceWorkItems( | 405 AddQueryEULAAcceptanceWorkItems( |
| 418 installer_state, setup_path, new_version, p, list); | 406 installer_state, setup_path, new_version, p, list); |
| 419 AddQuickEnableChromeFrameWorkItems(installer_state, list); | 407 AddQuickEnableChromeFrameWorkItems(installer_state, list); |
| 420 AddQuickEnableApplicationLauncherWorkItems( | 408 AddQuickEnableApplicationLauncherWorkItems( |
| 421 installer_state, original_state, setup_path, new_version, list); | 409 installer_state, original_state, setup_path, new_version, list); |
| 422 } | 410 } |
| 423 } | 411 } |
| 424 } | 412 } |
| (...skipping 913 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1338 | 1326 |
| 1339 // Add any remaining work items that involve special settings for | 1327 // Add any remaining work items that involve special settings for |
| 1340 // each product. | 1328 // each product. |
| 1341 AddProductSpecificWorkItems(original_state, | 1329 AddProductSpecificWorkItems(original_state, |
| 1342 installer_state, | 1330 installer_state, |
| 1343 setup_path, | 1331 setup_path, |
| 1344 new_version, | 1332 new_version, |
| 1345 current_version == NULL, | 1333 current_version == NULL, |
| 1346 install_list); | 1334 install_list); |
| 1347 | 1335 |
| 1336 // Remove the legacy "install-application" commmand from all products. | |
|
grt (UTC plus 2)
2014/09/30 18:59:26
this isn't quite right. the kCmdInstallApp will on
Devlin
2014/09/30 19:10:12
Done.
| |
| 1337 for (Products::const_iterator it = products.begin(); it < products.end(); | |
| 1338 ++it) { | |
| 1339 AddLegacyRemovalItem(installer_state, **p, kLegacyCmdInstallApp, list); | |
| 1340 } | |
| 1341 | |
| 1348 // Copy over brand, usagestats, and other values. | 1342 // Copy over brand, usagestats, and other values. |
| 1349 AddGoogleUpdateWorkItems(original_state, installer_state, install_list); | 1343 AddGoogleUpdateWorkItems(original_state, installer_state, install_list); |
| 1350 | 1344 |
| 1351 // Append the tasks that run after the installation. | 1345 // Append the tasks that run after the installation. |
| 1352 AppendPostInstallTasks(installer_state, | 1346 AppendPostInstallTasks(installer_state, |
| 1353 setup_path, | 1347 setup_path, |
| 1354 current_version, | 1348 current_version, |
| 1355 new_version, | 1349 new_version, |
| 1356 temp_path, | 1350 temp_path, |
| 1357 install_list); | 1351 install_list); |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1658 // Unconditionally remove the legacy Quick Enable command from the binaries. | 1652 // Unconditionally remove the legacy Quick Enable command from the binaries. |
| 1659 // Do this even if multi-install Chrome isn't installed to ensure that it is | 1653 // Do this even if multi-install Chrome isn't installed to ensure that it is |
| 1660 // not left behind in any case. | 1654 // not left behind in any case. |
| 1661 work_item_list->AddDeleteRegKeyWorkItem( | 1655 work_item_list->AddDeleteRegKeyWorkItem( |
| 1662 installer_state.root_key(), cmd_key, KEY_WOW64_32KEY) | 1656 installer_state.root_key(), cmd_key, KEY_WOW64_32KEY) |
| 1663 ->set_log_message("removing " + base::UTF16ToASCII(kCmdQuickEnableCf) + | 1657 ->set_log_message("removing " + base::UTF16ToASCII(kCmdQuickEnableCf) + |
| 1664 " command"); | 1658 " command"); |
| 1665 } | 1659 } |
| 1666 | 1660 |
| 1667 } // namespace installer | 1661 } // namespace installer |
| OLD | NEW |