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 29 matching lines...) Expand all Loading... | |
40 #include "chrome/installer/util/l10n_string_util.h" | 40 #include "chrome/installer/util/l10n_string_util.h" |
41 #include "chrome/installer/util/product.h" | 41 #include "chrome/installer/util/product.h" |
42 #include "chrome/installer/util/set_reg_value_work_item.h" | 42 #include "chrome/installer/util/set_reg_value_work_item.h" |
43 #include "chrome/installer/util/shell_util.h" | 43 #include "chrome/installer/util/shell_util.h" |
44 #include "chrome/installer/util/util_constants.h" | 44 #include "chrome/installer/util/util_constants.h" |
45 #include "chrome/installer/util/work_item_list.h" | 45 #include "chrome/installer/util/work_item_list.h" |
46 #include "chrome_frame/chrome_tab.h" | 46 #include "chrome_frame/chrome_tab.h" |
47 | 47 |
48 using base::win::RegKey; | 48 using base::win::RegKey; |
49 | 49 |
50 namespace { | |
51 | |
52 // The version identifying the work done by setup.exe --configure-user-settings | |
53 // on user login by way of Active Setup. Increase this value if the work done | |
54 // in setup_main.cc's handling of kConfigureUserSettings changes and should be | |
55 // executed again for all users. | |
56 const wchar_t* kActiveSetupVersion = L"23,0,0,0"; | |
grt (UTC plus 2)
2012/09/02 14:18:19
please make this an array rather than a pointer.
gab
2012/09/02 16:15:12
Agreed 100%. Done.
| |
57 | |
58 } // namespace | |
59 | |
50 namespace installer { | 60 namespace installer { |
51 | 61 |
52 // Local helper to call AddRegisterComDllWorkItems for all DLLs in a set of | 62 // Local helper to call AddRegisterComDllWorkItems for all DLLs in a set of |
53 // products managed by a given package. | 63 // products managed by a given package. |
54 void AddRegisterComDllWorkItemsForPackage(const InstallerState& installer_state, | 64 void AddRegisterComDllWorkItemsForPackage(const InstallerState& installer_state, |
55 const Version* old_version, | 65 const Version* old_version, |
56 const Version& new_version, | 66 const Version& new_version, |
57 WorkItemList* work_item_list) { | 67 WorkItemList* work_item_list) { |
58 // First collect the list of DLLs to be registered from each product. | 68 // First collect the list of DLLs to be registered from each product. |
59 std::vector<FilePath> com_dll_list; | 69 std::vector<FilePath> com_dll_list; |
(...skipping 841 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
901 | 911 |
902 AddUninstallShortcutWorkItems(installer_state, setup_path, new_version, | 912 AddUninstallShortcutWorkItems(installer_state, setup_path, new_version, |
903 install_list, *product); | 913 install_list, *product); |
904 | 914 |
905 AddVersionKeyWorkItems(root, product->distribution(), new_version, | 915 AddVersionKeyWorkItems(root, product->distribution(), new_version, |
906 add_language_identifier, install_list); | 916 add_language_identifier, install_list); |
907 | 917 |
908 AddDelegateExecuteWorkItems(installer_state, src_path, new_version, | 918 AddDelegateExecuteWorkItems(installer_state, src_path, new_version, |
909 *product, install_list); | 919 *product, install_list); |
910 | 920 |
911 // TODO(gab): This is only disabled for M22 as the shortcut CL using Active | |
912 // Setup will not make it in M22. | |
913 #if 0 | |
914 AddActiveSetupWorkItems(installer_state, new_version, *product, | 921 AddActiveSetupWorkItems(installer_state, new_version, *product, |
915 install_list); | 922 install_list); |
916 #endif | |
917 } | 923 } |
918 | 924 |
919 // Add any remaining work items that involve special settings for | 925 // Add any remaining work items that involve special settings for |
920 // each product. | 926 // each product. |
921 AddProductSpecificWorkItems(original_state, installer_state, setup_path, | 927 AddProductSpecificWorkItems(original_state, installer_state, setup_path, |
922 new_version, install_list); | 928 new_version, install_list); |
923 | 929 |
924 // Copy over brand, usagestats, and other values. | 930 // Copy over brand, usagestats, and other values. |
925 AddGoogleUpdateWorkItems(original_state, installer_state, install_list); | 931 AddGoogleUpdateWorkItems(original_state, installer_state, install_list); |
926 | 932 |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1230 } else { | 1236 } else { |
1231 VLOG(1) << "Adding unregistration items for DelegateExecute verb handler."; | 1237 VLOG(1) << "Adding unregistration items for DelegateExecute verb handler."; |
1232 | 1238 |
1233 list->AddDeleteRegKeyWorkItem(root, delegate_execute_path); | 1239 list->AddDeleteRegKeyWorkItem(root, delegate_execute_path); |
1234 list->AddDeleteRegKeyWorkItem(root, typelib_path); | 1240 list->AddDeleteRegKeyWorkItem(root, typelib_path); |
1235 list->AddDeleteRegKeyWorkItem(root, interface_path); | 1241 list->AddDeleteRegKeyWorkItem(root, interface_path); |
1236 } | 1242 } |
1237 } | 1243 } |
1238 | 1244 |
1239 void AddActiveSetupWorkItems(const InstallerState& installer_state, | 1245 void AddActiveSetupWorkItems(const InstallerState& installer_state, |
1246 const FilePath& setup_path, | |
1240 const Version& new_version, | 1247 const Version& new_version, |
1241 const Product& product, | 1248 const Product& product, |
1242 WorkItemList* list) { | 1249 WorkItemList* list) { |
1243 DCHECK(installer_state.operation() != InstallerState::UNINSTALL); | 1250 DCHECK(installer_state.operation() != InstallerState::UNINSTALL); |
1244 BrowserDistribution* distribution = product.distribution(); | 1251 BrowserDistribution* distribution = product.distribution(); |
1245 | 1252 |
1246 if (!product.is_chrome() || !installer_state.system_install()) { | 1253 if (!product.is_chrome() || !installer_state.system_install()) { |
1247 const char* install_level = | 1254 const char* install_level = |
1248 installer_state.system_install() ? "system" : "user"; | 1255 installer_state.system_install() ? "system" : "user"; |
1249 VLOG(1) << "No Active Setup processing to do for " << install_level | 1256 VLOG(1) << "No Active Setup processing to do for " << install_level |
1250 << "-level " << distribution->GetAppShortCutName(); | 1257 << "-level " << distribution->GetAppShortCutName(); |
1251 return; | 1258 return; |
1252 } | 1259 } |
1253 | 1260 |
1254 const HKEY root = HKEY_LOCAL_MACHINE; | 1261 const HKEY root = HKEY_LOCAL_MACHINE; |
1255 const string16 active_setup_path(GetActiveSetupPath(distribution)); | 1262 const string16 active_setup_path(GetActiveSetupPath(distribution)); |
1256 | 1263 |
1257 VLOG(1) << "Adding registration items for Active Setup."; | 1264 VLOG(1) << "Adding registration items for Active Setup."; |
1258 list->AddCreateRegKeyWorkItem(root, active_setup_path); | 1265 list->AddCreateRegKeyWorkItem(root, active_setup_path); |
1259 list->AddSetRegValueWorkItem(root, active_setup_path, L"", | 1266 list->AddSetRegValueWorkItem(root, active_setup_path, L"", |
1260 distribution->GetAppShortCutName(), true); | 1267 distribution->GetAppShortCutName(), true); |
1261 | 1268 |
1262 CommandLine cmd(installer_state.GetInstallerDirectory(new_version). | 1269 CommandLine cmd(installer_state.GetInstallerDirectory(new_version). |
1263 Append(installer::kSetupExe)); | 1270 Append(setup_path.BaseName())); |
1264 cmd.AppendSwitch(installer::switches::kConfigureUserSettings); | 1271 cmd.AppendSwitch(installer::switches::kConfigureUserSettings); |
1265 cmd.AppendSwitch(installer::switches::kVerboseLogging); | 1272 cmd.AppendSwitch(installer::switches::kVerboseLogging); |
1273 cmd.AppendSwitch(installer::switches::kSystemLevel); | |
1274 product.AppendProductFlags(&cmd); | |
1266 list->AddSetRegValueWorkItem(root, active_setup_path, L"StubPath", | 1275 list->AddSetRegValueWorkItem(root, active_setup_path, L"StubPath", |
1267 cmd.GetCommandLineString(), true); | 1276 cmd.GetCommandLineString(), true); |
1268 | 1277 |
1269 // TODO(grt): http://crbug.com/75152 Write a reference to a localized | 1278 // TODO(grt): http://crbug.com/75152 Write a reference to a localized |
1270 // resource. | 1279 // resource. |
1271 list->AddSetRegValueWorkItem(root, active_setup_path, L"Localized Name", | 1280 list->AddSetRegValueWorkItem(root, active_setup_path, L"Localized Name", |
1272 distribution->GetAppShortCutName(), true); | 1281 distribution->GetAppShortCutName(), true); |
1273 | 1282 |
1274 list->AddSetRegValueWorkItem(root, active_setup_path, L"IsInstalled", | 1283 list->AddSetRegValueWorkItem(root, active_setup_path, L"IsInstalled", |
1275 static_cast<DWORD>(1U), true); | 1284 static_cast<DWORD>(1U), true); |
1276 | 1285 |
1277 string16 comma_separated_version(ASCIIToUTF16(new_version.GetString())); | |
1278 ReplaceChars(comma_separated_version, L".", L",", &comma_separated_version); | |
1279 list->AddSetRegValueWorkItem(root, active_setup_path, L"Version", | 1286 list->AddSetRegValueWorkItem(root, active_setup_path, L"Version", |
1280 comma_separated_version, true); | 1287 kActiveSetupVersion, true); |
1281 } | 1288 } |
1282 | 1289 |
1283 namespace { | 1290 namespace { |
1284 | 1291 |
1285 enum ElevationPolicyId { | 1292 enum ElevationPolicyId { |
1286 CURRENT_ELEVATION_POLICY, | 1293 CURRENT_ELEVATION_POLICY, |
1287 OLD_ELEVATION_POLICY, | 1294 OLD_ELEVATION_POLICY, |
1288 }; | 1295 }; |
1289 | 1296 |
1290 // Although the UUID of the ChromeFrame class is used for the "current" value, | 1297 // Although the UUID of the ChromeFrame class is used for the "current" value, |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1587 machine_state, | 1594 machine_state, |
1588 setup_path, | 1595 setup_path, |
1589 new_version, | 1596 new_version, |
1590 work_item_list, | 1597 work_item_list, |
1591 false, // have_child_product | 1598 false, // have_child_product |
1592 cmd_line, | 1599 cmd_line, |
1593 kCmdQuickEnableApplicationHost); | 1600 kCmdQuickEnableApplicationHost); |
1594 } | 1601 } |
1595 | 1602 |
1596 } // namespace installer | 1603 } // namespace installer |
OLD | NEW |