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 1093 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1104 | 1104 |
1105 AddUninstallShortcutWorkItems(installer_state, setup_path, new_version, | 1105 AddUninstallShortcutWorkItems(installer_state, setup_path, new_version, |
1106 product, install_list); | 1106 product, install_list); |
1107 | 1107 |
1108 AddVersionKeyWorkItems(root, product.distribution(), new_version, | 1108 AddVersionKeyWorkItems(root, product.distribution(), new_version, |
1109 add_language_identifier, install_list); | 1109 add_language_identifier, install_list); |
1110 | 1110 |
1111 AddDelegateExecuteWorkItems(installer_state, target_path, new_version, | 1111 AddDelegateExecuteWorkItems(installer_state, target_path, new_version, |
1112 product, install_list); | 1112 product, install_list); |
1113 | 1113 |
1114 AddActiveSetupWorkItems(installer_state, setup_path, new_version, product, | 1114 AddActiveSetupWorkItems(installer_state, setup_path, temp_path, new_version, |
1115 install_list); | 1115 product, install_list); |
1116 } | 1116 } |
1117 | 1117 |
1118 // Add any remaining work items that involve special settings for | 1118 // Add any remaining work items that involve special settings for |
1119 // each product. | 1119 // each product. |
1120 AddProductSpecificWorkItems(original_state, installer_state, setup_path, | 1120 AddProductSpecificWorkItems(original_state, installer_state, setup_path, |
1121 new_version, install_list); | 1121 new_version, install_list); |
1122 | 1122 |
1123 // Copy over brand, usagestats, and other values. | 1123 // Copy over brand, usagestats, and other values. |
1124 AddGoogleUpdateWorkItems(original_state, installer_state, install_list); | 1124 AddGoogleUpdateWorkItems(original_state, installer_state, install_list); |
1125 | 1125 |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1380 list->AddSetRegValueWorkItem(root, subkey, L"ServerExecutable", | 1380 list->AddSetRegValueWorkItem(root, subkey, L"ServerExecutable", |
1381 delegate_execute.value(), true); | 1381 delegate_execute.value(), true); |
1382 | 1382 |
1383 subkey.assign(delegate_execute_path).append(L"\\Programmable"); | 1383 subkey.assign(delegate_execute_path).append(L"\\Programmable"); |
1384 list->AddCreateRegKeyWorkItem(root, subkey); | 1384 list->AddCreateRegKeyWorkItem(root, subkey); |
1385 } | 1385 } |
1386 } | 1386 } |
1387 | 1387 |
1388 void AddActiveSetupWorkItems(const InstallerState& installer_state, | 1388 void AddActiveSetupWorkItems(const InstallerState& installer_state, |
1389 const FilePath& setup_path, | 1389 const FilePath& setup_path, |
1390 const FilePath& temp_path, | |
1390 const Version& new_version, | 1391 const Version& new_version, |
1391 const Product& product, | 1392 const Product& product, |
1392 WorkItemList* list) { | 1393 WorkItemList* list) { |
1393 DCHECK(installer_state.operation() != InstallerState::UNINSTALL); | 1394 DCHECK(installer_state.operation() != InstallerState::UNINSTALL); |
1394 BrowserDistribution* distribution = product.distribution(); | 1395 BrowserDistribution* distribution = product.distribution(); |
1395 | 1396 |
1396 if (!product.is_chrome() || !installer_state.system_install()) { | 1397 if (!product.is_chrome() || !installer_state.system_install()) { |
1397 const char* install_level = | 1398 const char* install_level = |
1398 installer_state.system_install() ? "system" : "user"; | 1399 installer_state.system_install() ? "system" : "user"; |
1399 VLOG(1) << "No Active Setup processing to do for " << install_level | 1400 VLOG(1) << "No Active Setup processing to do for " << install_level |
1400 << "-level " << distribution->GetAppShortCutName(); | 1401 << "-level " << distribution->GetAppShortCutName(); |
1401 return; | 1402 return; |
1402 } | 1403 } |
1403 | 1404 |
1404 const HKEY root = HKEY_LOCAL_MACHINE; | 1405 const HKEY root = HKEY_LOCAL_MACHINE; |
1405 const string16 active_setup_path( | 1406 const string16 active_setup_path( |
1406 InstallUtil::GetActiveSetupPath(distribution)); | 1407 InstallUtil::GetActiveSetupPath(distribution)); |
1407 | 1408 |
1409 FilePath active_setup_exe(installer_state.GetInstallerDirectory(new_version) | |
1410 .Append(kActiveSetupExe)); | |
1411 VLOG(1) << "Adding copy items for " << active_setup_exe.value(); | |
1412 list->AddCopyTreeWorkItem(setup_path.value(), active_setup_exe.value(), | |
grt (UTC plus 2)
2013/01/09 14:13:15
AddActiveSetupWorkItems is called once for each pr
gab
2013/01/09 15:39:42
The early return at the top of this method takes c
| |
1413 temp_path.value(), WorkItem::ALWAYS); | |
1414 | |
1408 VLOG(1) << "Adding registration items for Active Setup."; | 1415 VLOG(1) << "Adding registration items for Active Setup."; |
1409 list->AddCreateRegKeyWorkItem(root, active_setup_path); | 1416 list->AddCreateRegKeyWorkItem(root, active_setup_path); |
1410 list->AddSetRegValueWorkItem(root, active_setup_path, L"", | 1417 list->AddSetRegValueWorkItem(root, active_setup_path, L"", |
1411 distribution->GetAppShortCutName(), true); | 1418 distribution->GetAppShortCutName(), true); |
1412 | 1419 |
1413 CommandLine cmd(installer_state.GetInstallerDirectory(new_version). | 1420 CommandLine cmd(active_setup_exe); |
1414 Append(setup_path.BaseName())); | |
1415 cmd.AppendSwitch(installer::switches::kConfigureUserSettings); | 1421 cmd.AppendSwitch(installer::switches::kConfigureUserSettings); |
1416 cmd.AppendSwitch(installer::switches::kVerboseLogging); | 1422 cmd.AppendSwitch(installer::switches::kVerboseLogging); |
1417 cmd.AppendSwitch(installer::switches::kSystemLevel); | 1423 cmd.AppendSwitch(installer::switches::kSystemLevel); |
1418 product.AppendProductFlags(&cmd); | 1424 product.AppendProductFlags(&cmd); |
1419 list->AddSetRegValueWorkItem(root, active_setup_path, L"StubPath", | 1425 list->AddSetRegValueWorkItem(root, active_setup_path, L"StubPath", |
1420 cmd.GetCommandLineString(), true); | 1426 cmd.GetCommandLineString(), true); |
1421 | 1427 |
1422 // TODO(grt): http://crbug.com/75152 Write a reference to a localized | 1428 // TODO(grt): http://crbug.com/75152 Write a reference to a localized |
1423 // resource. | 1429 // resource. |
1424 list->AddSetRegValueWorkItem(root, active_setup_path, L"Localized Name", | 1430 list->AddSetRegValueWorkItem(root, active_setup_path, L"Localized Name", |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1620 // Log everything for now. | 1626 // Log everything for now. |
1621 cmd_line.AppendSwitch(installer::switches::kVerboseLogging); | 1627 cmd_line.AppendSwitch(installer::switches::kVerboseLogging); |
1622 | 1628 |
1623 AppCommand cmd(cmd_line.GetCommandLineString()); | 1629 AppCommand cmd(cmd_line.GetCommandLineString()); |
1624 cmd.set_is_auto_run_on_os_upgrade(true); | 1630 cmd.set_is_auto_run_on_os_upgrade(true); |
1625 cmd.AddWorkItems(installer_state.root_key(), cmd_key, install_list); | 1631 cmd.AddWorkItems(installer_state.root_key(), cmd_key, install_list); |
1626 } | 1632 } |
1627 } | 1633 } |
1628 | 1634 |
1629 } // namespace installer | 1635 } // namespace installer |
OLD | NEW |