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

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

Issue 6951016: Product-specific flags are no longer required, used, or validated in --rename-chrome-exe command ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 7 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
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 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 new ConditionRunIfFileExists(new_chrome_exe))); 416 new ConditionRunIfFileExists(new_chrome_exe)));
417 in_use_update_work_items->set_log_message("InUseUpdateWorkItemList"); 417 in_use_update_work_items->set_log_message("InUseUpdateWorkItemList");
418 418
419 FilePath installer_path(installer_state.GetInstallerDirectory(new_version) 419 FilePath installer_path(installer_state.GetInstallerDirectory(new_version)
420 .Append(setup_path.BaseName())); 420 .Append(setup_path.BaseName()));
421 421
422 CommandLine rename(installer_path); 422 CommandLine rename(installer_path);
423 rename.AppendSwitch(switches::kRenameChromeExe); 423 rename.AppendSwitch(switches::kRenameChromeExe);
424 if (installer_state.system_install()) 424 if (installer_state.system_install())
425 rename.AppendSwitch(switches::kSystemLevel); 425 rename.AppendSwitch(switches::kSystemLevel);
426 if (installer_state.is_multi_install())
427 rename.AppendSwitch(switches::kMultiInstall);
426 428
427 if (installer_state.verbose_logging()) 429 if (installer_state.verbose_logging())
428 rename.AppendSwitch(switches::kVerboseLogging); 430 rename.AppendSwitch(switches::kVerboseLogging);
429 431
430 std::wstring version_key; 432 std::wstring version_key;
431 for (size_t i = 0; i < products.size(); ++i) { 433 for (size_t i = 0; i < products.size(); ++i) {
432 BrowserDistribution* dist = products[i]->distribution(); 434 BrowserDistribution* dist = products[i]->distribution();
433 version_key = dist->GetVersionKey(); 435 version_key = dist->GetVersionKey();
434 436
435 if (current_version != NULL) { 437 if (current_version != NULL) {
436 in_use_update_work_items->AddSetRegValueWorkItem(root, version_key, 438 in_use_update_work_items->AddSetRegValueWorkItem(root, version_key,
437 google_update::kRegOldVersionField, 439 google_update::kRegOldVersionField,
438 UTF8ToWide(current_version->GetString()), true); 440 UTF8ToWide(current_version->GetString()), true);
439 } 441 }
440 442
441 // Adding this registry entry for all products is overkill. 443 // Adding this registry entry for all products is overkill.
442 // However, as it stands, we don't have a way to know which distribution 444 // However, as it stands, we don't have a way to know which distribution
443 // will check the key and run the command, so we add it for all. 445 // will check the key and run the command, so we add it for all. The
444 // After the first run, the subsequent runs should just be noops. 446 // first to run it will perform the operation and clean up the other
445 // (see upgrade_utils::SwapNewChromeExeIfPresent). 447 // values.
446 CommandLine product_rename_cmd(rename);
447 products[i]->AppendProductFlags(&product_rename_cmd);
448 in_use_update_work_items->AddSetRegValueWorkItem( 448 in_use_update_work_items->AddSetRegValueWorkItem(
449 root, 449 root,
450 version_key, 450 version_key,
451 google_update::kRegRenameCmdField, 451 google_update::kRegRenameCmdField,
452 product_rename_cmd.command_line_string(), 452 rename.command_line_string(),
453 true); 453 true);
454 } 454 }
455 455
456 if (current_version != NULL && installer_state.is_multi_install()) { 456 if (current_version != NULL && installer_state.is_multi_install()) {
457 BrowserDistribution* dist = 457 BrowserDistribution* dist =
458 installer_state.multi_package_binaries_distribution(); 458 installer_state.multi_package_binaries_distribution();
459 in_use_update_work_items->AddSetRegValueWorkItem( 459 in_use_update_work_items->AddSetRegValueWorkItem(
460 root, 460 root,
461 dist->GetVersionKey(), 461 dist->GetVersionKey(),
462 google_update::kRegOldVersionField, 462 google_update::kRegOldVersionField,
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
1038 } else { 1038 } else {
1039 DCHECK(operation == REMOVE_COMMAND); 1039 DCHECK(operation == REMOVE_COMMAND);
1040 work_item_list->AddDeleteRegKeyWorkItem(installer_state.root_key(), 1040 work_item_list->AddDeleteRegKeyWorkItem(installer_state.root_key(),
1041 cmd_key)->set_log_message( 1041 cmd_key)->set_log_message(
1042 "removing quick-enable-cf command"); 1042 "removing quick-enable-cf command");
1043 } 1043 }
1044 } 1044 }
1045 } 1045 }
1046 1046
1047 } // namespace installer 1047 } // namespace installer
OLDNEW
« no previous file with comments | « no previous file | chrome/installer/setup/setup_main.cc » ('j') | chrome/installer/setup/setup_main.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698