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

Side by Side Diff: chrome/installer/setup/install_worker.cc

Issue 612093007: Remove kCmdInstallExtension and kCmdInstallApp from Installer code (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months 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 unified diff | Download patch
OLDNEW
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
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
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,
grt (UTC plus 2) 2014/09/30 18:30:32 since this specifically removes an app command, ho
Devlin 2014/09/30 18:51:01 It actually removes anything that's passed in via
grt (UTC plus 2) 2014/09/30 18:59:26 name collision! "AppCommand" is the generic term f
Devlin 2014/09/30 19:10:12 Ahh, gotcha. Done.
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 base::string16 full_cmd_key(
grt (UTC plus 2) 2014/09/30 18:30:32 nit: get rid of this local var and call GetRegComm
Devlin 2014/09/30 18:51:01 Done.
238 DCHECK(product.is_chrome_app_host()); 243 GetRegCommandKey(product.distribution(), name));
239 AddCommandWithParameterWorkItems(installer_state, machine_state, new_version, 244 work_item_list->AddDeleteRegKeyWorkItem(
grt (UTC plus 2) 2014/09/30 18:30:32 please add a comment stating that failures are ign
Devlin 2014/09/30 18:51:02 Done.
240 product, kCmdInstallApp, 245 installer_state.root_key(),
241 installer::kChromeAppHostExe, 246 full_cmd_key,
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
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);
Devlin 2014/09/30 18:03:01 I think in your email you recommended adding this
grt (UTC plus 2) 2014/09/30 18:30:32 To be safe, I think so. I can't say for sure that
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 1233 matching lines...) Expand 10 before | Expand all | Expand 10 after
1658 // Unconditionally remove the legacy Quick Enable command from the binaries. 1646 // 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 1647 // Do this even if multi-install Chrome isn't installed to ensure that it is
1660 // not left behind in any case. 1648 // not left behind in any case.
1661 work_item_list->AddDeleteRegKeyWorkItem( 1649 work_item_list->AddDeleteRegKeyWorkItem(
1662 installer_state.root_key(), cmd_key, KEY_WOW64_32KEY) 1650 installer_state.root_key(), cmd_key, KEY_WOW64_32KEY)
1663 ->set_log_message("removing " + base::UTF16ToASCII(kCmdQuickEnableCf) + 1651 ->set_log_message("removing " + base::UTF16ToASCII(kCmdQuickEnableCf) +
1664 " command"); 1652 " command");
1665 } 1653 }
1666 1654
1667 } // namespace installer 1655 } // namespace installer
OLDNEW
« no previous file with comments | « no previous file | chrome/installer/util/installation_validator.h » ('j') | chrome/installer/util/installation_validator.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698