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

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

Issue 6541029: Add product-specific flags to the rename command in the registry. This fixes... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <shlobj.h> 10 #include <shlobj.h>
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 { 423 {
424 scoped_ptr<WorkItemList> in_use_update_work_items( 424 scoped_ptr<WorkItemList> in_use_update_work_items(
425 WorkItem::CreateConditionalWorkItemList( 425 WorkItem::CreateConditionalWorkItemList(
426 new ConditionRunIfFileExists(new_chrome_exe))); 426 new ConditionRunIfFileExists(new_chrome_exe)));
427 in_use_update_work_items->set_log_message("InUseUpdateWorkItemList"); 427 in_use_update_work_items->set_log_message("InUseUpdateWorkItemList");
428 428
429 FilePath installer_path(installer_state.GetInstallerDirectory(new_version) 429 FilePath installer_path(installer_state.GetInstallerDirectory(new_version)
430 .Append(setup_path.BaseName())); 430 .Append(setup_path.BaseName()));
431 431
432 CommandLine rename(installer_path); 432 CommandLine rename(installer_path);
433 rename.AppendSwitch(installer::switches::kRenameChromeExe); 433 rename.AppendSwitch(switches::kRenameChromeExe);
434 if (installer_state.system_install()) 434 if (installer_state.system_install())
435 rename.AppendSwitch(installer::switches::kSystemLevel); 435 rename.AppendSwitch(switches::kSystemLevel);
436 436
437 if (InstallUtil::IsChromeSxSProcess()) 437 if (installer_state.verbose_logging())
438 rename.AppendSwitch(installer::switches::kChromeSxS); 438 rename.AppendSwitch(switches::kVerboseLogging);
tommi (sloooow) - chröme 2011/02/18 18:23:38 why are we removing the sxs and multi-install swit
grt (UTC plus 2) 2011/02/18 18:30:06 They're added by the ProductOperations subclasses.
tommi (sloooow) - chröme 2011/02/18 18:23:38 nice
grt (UTC plus 2) 2011/02/18 18:30:06 Thanks.
439
440 if (installer_state.is_multi_install())
441 rename.AppendSwitch(installer::switches::kMultiInstall);
442 439
443 std::wstring version_key; 440 std::wstring version_key;
444 for (size_t i = 0; i < products.size(); ++i) { 441 for (size_t i = 0; i < products.size(); ++i) {
445 BrowserDistribution* dist = products[i]->distribution(); 442 BrowserDistribution* dist = products[i]->distribution();
446 version_key = dist->GetVersionKey(); 443 version_key = dist->GetVersionKey();
447 444
448 if (current_version != NULL) { 445 if (current_version != NULL) {
449 in_use_update_work_items->AddSetRegValueWorkItem(root, version_key, 446 in_use_update_work_items->AddSetRegValueWorkItem(root, version_key,
450 google_update::kRegOldVersionField, 447 google_update::kRegOldVersionField,
451 UTF8ToWide(current_version->GetString()), true); 448 UTF8ToWide(current_version->GetString()), true);
452 } 449 }
453 450
454 // Adding this registry entry for all products is overkill. 451 // Adding this registry entry for all products is overkill.
455 // However, as it stands, we don't have a way to know which distribution 452 // However, as it stands, we don't have a way to know which distribution
456 // will check the key and run the command, so we add it for all. 453 // will check the key and run the command, so we add it for all.
457 // After the first run, the subsequent runs should just be noops. 454 // After the first run, the subsequent runs should just be noops.
458 // (see Upgrade::SwapNewChromeExeIfPresent). 455 // (see Upgrade::SwapNewChromeExeIfPresent).
456 CommandLine product_rename_cmd(rename);
457 products[i]->AppendProductFlags(&product_rename_cmd);
459 in_use_update_work_items->AddSetRegValueWorkItem( 458 in_use_update_work_items->AddSetRegValueWorkItem(
460 root, 459 root,
461 version_key, 460 version_key,
462 google_update::kRegRenameCmdField, 461 google_update::kRegRenameCmdField,
463 rename.command_line_string(), 462 product_rename_cmd.command_line_string(),
464 true); 463 true);
465 } 464 }
466 465
467 if (current_version != NULL && installer_state.is_multi_install()) { 466 if (current_version != NULL && installer_state.is_multi_install()) {
468 BrowserDistribution* dist = 467 BrowserDistribution* dist =
469 installer_state.multi_package_binaries_distribution(); 468 installer_state.multi_package_binaries_distribution();
470 in_use_update_work_items->AddSetRegValueWorkItem( 469 in_use_update_work_items->AddSetRegValueWorkItem(
471 root, 470 root,
472 dist->GetVersionKey(), 471 dist->GetVersionKey(),
473 google_update::kRegOldVersionField, 472 google_update::kRegOldVersionField,
(...skipping 426 matching lines...) Expand 10 before | Expand all | Expand 10 after
900 VLOG(1) << kIERefreshPolicy << " not supported."; 899 VLOG(1) << kIERefreshPolicy << " not supported.";
901 } 900 }
902 901
903 FreeLibrary(ieframe); 902 FreeLibrary(ieframe);
904 } else { 903 } else {
905 VLOG(1) << "Cannot load " << kIEFrameDll; 904 VLOG(1) << "Cannot load " << kIEFrameDll;
906 } 905 }
907 } 906 }
908 907
909 } // namespace installer 908 } // namespace installer
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698