| OLD | NEW |
| 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 377 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 if (current_version != NULL) { | 388 if (current_version != NULL) { |
| 389 in_use_update_work_items->AddSetRegValueWorkItem(root, version_key, | 389 in_use_update_work_items->AddSetRegValueWorkItem(root, version_key, |
| 390 google_update::kRegOldVersionField, | 390 google_update::kRegOldVersionField, |
| 391 UTF8ToWide(current_version->GetString()), true); | 391 UTF8ToWide(current_version->GetString()), true); |
| 392 } | 392 } |
| 393 | 393 |
| 394 // Adding this registry entry for all products is overkill. | 394 // Adding this registry entry for all products is overkill. |
| 395 // However, as it stands, we don't have a way to know which distribution | 395 // However, as it stands, we don't have a way to know which distribution |
| 396 // will check the key and run the command, so we add it for all. | 396 // will check the key and run the command, so we add it for all. |
| 397 // After the first run, the subsequent runs should just be noops. | 397 // After the first run, the subsequent runs should just be noops. |
| 398 // (see upgrade_utils::SwapNewChromeExeIfPresent). | 398 // (see Upgrade::SwapNewChromeExeIfPresent). |
| 399 CommandLine product_rename_cmd(rename); | 399 CommandLine product_rename_cmd(rename); |
| 400 products[i]->AppendProductFlags(&product_rename_cmd); | 400 products[i]->AppendProductFlags(&product_rename_cmd); |
| 401 in_use_update_work_items->AddSetRegValueWorkItem( | 401 in_use_update_work_items->AddSetRegValueWorkItem( |
| 402 root, | 402 root, |
| 403 version_key, | 403 version_key, |
| 404 google_update::kRegRenameCmdField, | 404 google_update::kRegRenameCmdField, |
| 405 product_rename_cmd.command_line_string(), | 405 product_rename_cmd.command_line_string(), |
| 406 true); | 406 true); |
| 407 } | 407 } |
| 408 | 408 |
| 409 if (current_version != NULL && installer_state.is_multi_install()) { | 409 if (current_version != NULL && installer_state.is_multi_install()) { |
| 410 BrowserDistribution* dist = | 410 BrowserDistribution* dist = |
| 411 installer_state.multi_package_binaries_distribution(); | 411 installer_state.multi_package_binaries_distribution(); |
| 412 in_use_update_work_items->AddSetRegValueWorkItem( | 412 in_use_update_work_items->AddSetRegValueWorkItem( |
| 413 root, | 413 root, |
| 414 dist->GetVersionKey(), | 414 dist->GetVersionKey(), |
| 415 google_update::kRegOldVersionField, | 415 google_update::kRegOldVersionField, |
| 416 UTF8ToWide(current_version->GetString()), | 416 UTF8ToWide(current_version->GetString()), |
| 417 true); | 417 true); |
| 418 // TODO(tommi): We should move the rename command here. We also need to | 418 // TODO(tommi): We should move the rename command here. We also need to |
| 419 // update upgrade_utils::SwapNewChromeExeIfPresent. | 419 // update Upgrade::SwapNewChromeExeIfPresent. |
| 420 } | 420 } |
| 421 | 421 |
| 422 post_install_task_list->AddWorkItem(in_use_update_work_items.release()); | 422 post_install_task_list->AddWorkItem(in_use_update_work_items.release()); |
| 423 } | 423 } |
| 424 | 424 |
| 425 // Append work items that will be executed if this was NOT an in-use update. | 425 // Append work items that will be executed if this was NOT an in-use update. |
| 426 { | 426 { |
| 427 scoped_ptr<WorkItemList> regular_update_work_items( | 427 scoped_ptr<WorkItemList> regular_update_work_items( |
| 428 WorkItem::CreateConditionalWorkItemList( | 428 WorkItem::CreateConditionalWorkItemList( |
| 429 new Not(new ConditionRunIfFileExists(new_chrome_exe)))); | 429 new Not(new ConditionRunIfFileExists(new_chrome_exe)))); |
| (...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 990 } else { | 990 } else { |
| 991 DCHECK(operation == REMOVE_COMMAND); | 991 DCHECK(operation == REMOVE_COMMAND); |
| 992 work_item_list->AddDeleteRegKeyWorkItem(installer_state.root_key(), | 992 work_item_list->AddDeleteRegKeyWorkItem(installer_state.root_key(), |
| 993 cmd_key)->set_log_message( | 993 cmd_key)->set_log_message( |
| 994 "removing quick-enable-cf command"); | 994 "removing quick-enable-cf command"); |
| 995 } | 995 } |
| 996 } | 996 } |
| 997 } | 997 } |
| 998 | 998 |
| 999 } // namespace installer | 999 } // namespace installer |
| OLD | NEW |