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 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 const InstallerState& installer_state, | 285 const InstallerState& installer_state, |
286 const FilePath& setup_path, | 286 const FilePath& setup_path, |
287 const Version& new_version, | 287 const Version& new_version, |
288 WorkItemList* list) { | 288 WorkItemList* list) { |
289 const Products& products = installer_state.products(); | 289 const Products& products = installer_state.products(); |
290 for (size_t i = 0; i < products.size(); ++i) { | 290 for (size_t i = 0; i < products.size(); ++i) { |
291 const Product& p = *products[i]; | 291 const Product& p = *products[i]; |
292 if (p.is_chrome_frame()) { | 292 if (p.is_chrome_frame()) { |
293 AddChromeFrameWorkItems(original_state, installer_state, setup_path, | 293 AddChromeFrameWorkItems(original_state, installer_state, setup_path, |
294 new_version, p, list); | 294 new_version, p, list); |
295 } else if (p.is_chrome()) { | |
296 AddChromeWorkItems(original_state, installer_state, setup_path, | |
297 new_version, p, list); | |
298 } | 295 } |
299 } | 296 } |
300 } | 297 } |
301 | 298 |
302 // Mirror oeminstall the first time anything is installed multi. There is no | 299 // Mirror oeminstall the first time anything is installed multi. There is no |
303 // need to update the value on future install/update runs since this value never | 300 // need to update the value on future install/update runs since this value never |
304 // changes. Note that the value is removed by Google Update after EULA | 301 // changes. Note that the value is removed by Google Update after EULA |
305 // acceptance is processed. | 302 // acceptance is processed. |
306 void AddOemInstallWorkItems(const InstallationState& original_state, | 303 void AddOemInstallWorkItems(const InstallationState& original_state, |
307 const InstallerState& installer_state, | 304 const InstallerState& installer_state, |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
818 | 815 |
819 const Products& products = installer_state.products(); | 816 const Products& products = installer_state.products(); |
820 for (size_t i = 0; i < products.size(); ++i) { | 817 for (size_t i = 0; i < products.size(); ++i) { |
821 const Product* product = products[i]; | 818 const Product* product = products[i]; |
822 | 819 |
823 AddUninstallShortcutWorkItems(installer_state, setup_path, new_version, | 820 AddUninstallShortcutWorkItems(installer_state, setup_path, new_version, |
824 install_list, *product); | 821 install_list, *product); |
825 | 822 |
826 AddVersionKeyWorkItems(root, product->distribution(), new_version, | 823 AddVersionKeyWorkItems(root, product->distribution(), new_version, |
827 add_language_identifier, install_list); | 824 add_language_identifier, install_list); |
| 825 |
| 826 AddDelegateExecuteWorkItems(original_state, installer_state, setup_path, |
| 827 new_version, *product, install_list); |
828 } | 828 } |
829 | 829 |
830 if (installer_state.is_multi_install()) { | 830 if (installer_state.is_multi_install()) { |
831 AddMultiUninstallWorkItems(installer_state, setup_path, new_version, | 831 AddMultiUninstallWorkItems(installer_state, setup_path, new_version, |
832 install_list); | 832 install_list); |
833 | 833 |
834 AddVersionKeyWorkItems(root, | 834 AddVersionKeyWorkItems(root, |
835 installer_state.multi_package_binaries_distribution(), new_version, | 835 installer_state.multi_package_binaries_distribution(), new_version, |
836 add_language_identifier, install_list); | 836 add_language_identifier, install_list); |
837 } | 837 } |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1023 BrowserDistribution::CHROME_BROWSER)); | 1023 BrowserDistribution::CHROME_BROWSER)); |
1024 chrome.InitializeFromUninstallCommand(chrome_state->uninstall_command()); | 1024 chrome.InitializeFromUninstallCommand(chrome_state->uninstall_command()); |
1025 AddUninstallShortcutWorkItems(installer_state, setup_path, | 1025 AddUninstallShortcutWorkItems(installer_state, setup_path, |
1026 chrome_state->version(), list, chrome); | 1026 chrome_state->version(), list, chrome); |
1027 } else { | 1027 } else { |
1028 NOTREACHED() << "What happened to Chrome?"; | 1028 NOTREACHED() << "What happened to Chrome?"; |
1029 } | 1029 } |
1030 } | 1030 } |
1031 } | 1031 } |
1032 | 1032 |
1033 void AddChromeWorkItems(const InstallationState& original_state, | 1033 void AddDelegateExecuteWorkItems(const InstallationState& original_state, |
1034 const InstallerState& installer_state, | 1034 const InstallerState& installer_state, |
1035 const FilePath& setup_path, | 1035 const FilePath& setup_path, |
1036 const Version& new_version, | 1036 const Version& new_version, |
1037 const Product& product, | 1037 const Product& product, |
1038 WorkItemList* list) { | 1038 WorkItemList* list) { |
1039 // For the moment, this function adds work items to perform COM registration | 1039 string16 handler_class_uuid; |
1040 // specific to the Windows 8 delegate. If more work needs to be done in the | 1040 string16 type_lib_uuid; |
1041 // future, pull this into its own function called by AddChromeWorkItems. | 1041 string16 type_lib_version; |
1042 DCHECK(product.is_chrome()); | 1042 string16 interface_uuid; |
| 1043 BrowserDistribution* distribution = product.distribution(); |
| 1044 if (!distribution->GetDelegateExecuteHandlerData( |
| 1045 &handler_class_uuid, &type_lib_uuid, &type_lib_version, |
| 1046 &interface_uuid)) { |
| 1047 VLOG(1) << "No DelegateExecute verb handler processing to do for " |
| 1048 << distribution->GetAppShortCutName(); |
| 1049 return; |
| 1050 } |
| 1051 |
| 1052 VLOG(1) << "DelegateExecute verb handler COM registration."; |
| 1053 |
1043 HKEY root = installer_state.root_key(); | 1054 HKEY root = installer_state.root_key(); |
1044 const bool is_install = | 1055 const bool is_install = |
1045 (installer_state.operation() != InstallerState::UNINSTALL); | 1056 (installer_state.operation() != InstallerState::UNINSTALL); |
1046 string16 delegate_execute_path(L"Software\\Classes\\CLSID\\"); | 1057 string16 delegate_execute_path(L"Software\\Classes\\CLSID\\"); |
1047 delegate_execute_path.append(kCommandExecuteImplUuid); | 1058 delegate_execute_path.append(handler_class_uuid); |
1048 string16 typelib_path(L"Software\\Classes\\TypeLib\\"); | 1059 string16 typelib_path(L"Software\\Classes\\TypeLib\\"); |
1049 typelib_path.append(kDelegateExecuteLibUuid); | 1060 typelib_path.append(type_lib_uuid); |
1050 string16 interface_path(L"Software\\Classes\\Interface\\"); | 1061 string16 interface_path(L"Software\\Classes\\Interface\\"); |
1051 interface_path.append(kICommandExecuteImplUuid); | 1062 interface_path.append(interface_uuid); |
1052 | 1063 |
1053 if (is_install) { | 1064 if (is_install) { |
1054 // The path to the exe (in the version directory). | 1065 // The path to the exe (in the version directory). |
1055 FilePath delegate_execute( | 1066 FilePath delegate_execute( |
1056 installer_state.target_path().AppendASCII(new_version.GetString())); | 1067 installer_state.target_path().AppendASCII(new_version.GetString())); |
1057 delegate_execute = delegate_execute.Append(kDelegateExecuteExe); | 1068 delegate_execute = delegate_execute.Append(kDelegateExecuteExe); |
1058 | 1069 |
1059 // Command-line featuring the quoted path to the exe. | 1070 // Command-line featuring the quoted path to the exe. |
1060 string16 command(1, L'"'); | 1071 string16 command(1, L'"'); |
1061 command.append(delegate_execute.value()).append(1, L'"'); | 1072 command.append(delegate_execute.value()).append(1, L'"'); |
1062 | 1073 |
1063 // Register the CommandExecuteImpl class at | 1074 // Register the CommandExecuteImpl class at |
1064 // Software\Classes\CLSID\{5C65F4B0-3651-4514-B207-D10CB699B14B} | 1075 // Software\Classes\CLSID\{5C65F4B0-3651-4514-B207-D10CB699B14B} |
1065 list->AddCreateRegKeyWorkItem(root, delegate_execute_path); | 1076 list->AddCreateRegKeyWorkItem(root, delegate_execute_path); |
1066 list->AddSetRegValueWorkItem(root, delegate_execute_path, L"", | 1077 list->AddSetRegValueWorkItem(root, delegate_execute_path, L"", |
1067 L"CommandExecuteImpl Class", true); | 1078 L"CommandExecuteImpl Class", true); |
1068 string16 subkey(delegate_execute_path); | 1079 string16 subkey(delegate_execute_path); |
1069 subkey.append(L"\\LocalServer32"); | 1080 subkey.append(L"\\LocalServer32"); |
1070 list->AddCreateRegKeyWorkItem(root, subkey); | 1081 list->AddCreateRegKeyWorkItem(root, subkey); |
1071 list->AddSetRegValueWorkItem(root, subkey, L"", command, true); | 1082 list->AddSetRegValueWorkItem(root, subkey, L"", command, true); |
1072 list->AddSetRegValueWorkItem(root, subkey, L"ServerExecutable", | 1083 list->AddSetRegValueWorkItem(root, subkey, L"ServerExecutable", |
1073 delegate_execute.value(), true); | 1084 delegate_execute.value(), true); |
1074 | 1085 |
1075 subkey.assign(delegate_execute_path).append(L"\\Programmable"); | 1086 subkey.assign(delegate_execute_path).append(L"\\Programmable"); |
1076 list->AddCreateRegKeyWorkItem(root, subkey); | 1087 list->AddCreateRegKeyWorkItem(root, subkey); |
1077 | 1088 |
1078 subkey.assign(delegate_execute_path).append(L"\\TypeLib"); | 1089 subkey.assign(delegate_execute_path).append(L"\\TypeLib"); |
1079 list->AddCreateRegKeyWorkItem(root, subkey); | 1090 list->AddCreateRegKeyWorkItem(root, subkey); |
1080 list->AddSetRegValueWorkItem(root, subkey, L"", kDelegateExecuteLibUuid, | 1091 list->AddSetRegValueWorkItem(root, subkey, L"", type_lib_uuid, true); |
1081 true); | |
1082 | 1092 |
1083 subkey.assign(delegate_execute_path).append(L"\\Version"); | 1093 subkey.assign(delegate_execute_path).append(L"\\Version"); |
1084 list->AddCreateRegKeyWorkItem(root, subkey); | 1094 list->AddCreateRegKeyWorkItem(root, subkey); |
1085 list->AddSetRegValueWorkItem(root, subkey, L"", kDelegateExecuteLibVersion, | 1095 list->AddSetRegValueWorkItem(root, subkey, L"", type_lib_version, true); |
1086 true); | |
1087 | 1096 |
1088 // Register the DelegateExecuteLib type library at | 1097 // Register the DelegateExecuteLib type library at |
1089 // Software\Classes\TypeLib\{4E805ED8-EBA0-4601-9681-12815A56EBFD} | 1098 // Software\Classes\TypeLib\{4E805ED8-EBA0-4601-9681-12815A56EBFD} |
1090 list->AddCreateRegKeyWorkItem(root, typelib_path); | 1099 list->AddCreateRegKeyWorkItem(root, typelib_path); |
1091 | 1100 |
1092 string16 version_key(typelib_path); | 1101 string16 version_key(typelib_path); |
1093 version_key.append(1, L'\\').append(kDelegateExecuteLibVersion); | 1102 version_key.append(1, L'\\').append(type_lib_version); |
1094 list->AddCreateRegKeyWorkItem(root, version_key); | 1103 list->AddCreateRegKeyWorkItem(root, version_key); |
1095 list->AddSetRegValueWorkItem(root, version_key, L"", kDelegateExecuteLib, | 1104 list->AddSetRegValueWorkItem(root, version_key, L"", L"DelegateExecuteLib", |
1096 true); | 1105 true); |
1097 | 1106 |
1098 subkey.assign(version_key).append(L"\\FLAGS"); | 1107 subkey.assign(version_key).append(L"\\FLAGS"); |
1099 const DWORD flags = LIBFLAG_FRESTRICTED | LIBFLAG_FCONTROL; | 1108 const DWORD flags = LIBFLAG_FRESTRICTED | LIBFLAG_FCONTROL; |
1100 list->AddCreateRegKeyWorkItem(root, subkey); | 1109 list->AddCreateRegKeyWorkItem(root, subkey); |
1101 list->AddSetRegValueWorkItem(root, subkey, L"", flags, true); | 1110 list->AddSetRegValueWorkItem(root, subkey, L"", flags, true); |
1102 | 1111 |
1103 subkey.assign(version_key).append(L"\\0"); | 1112 subkey.assign(version_key).append(L"\\0"); |
1104 list->AddCreateRegKeyWorkItem(root, subkey); | 1113 list->AddCreateRegKeyWorkItem(root, subkey); |
1105 | 1114 |
1106 subkey.append(L"\\win32"); | 1115 subkey.append(L"\\win32"); |
1107 list->AddCreateRegKeyWorkItem(root, subkey); | 1116 list->AddCreateRegKeyWorkItem(root, subkey); |
1108 list->AddSetRegValueWorkItem(root, subkey, L"", delegate_execute.value(), | 1117 list->AddSetRegValueWorkItem(root, subkey, L"", delegate_execute.value(), |
1109 true); | 1118 true); |
1110 | 1119 |
1111 subkey.assign(version_key).append(L"\\HELPDIR"); | 1120 subkey.assign(version_key).append(L"\\HELPDIR"); |
1112 list->AddCreateRegKeyWorkItem(root, subkey); | 1121 list->AddCreateRegKeyWorkItem(root, subkey); |
1113 list->AddSetRegValueWorkItem(root, subkey, L"", | 1122 list->AddSetRegValueWorkItem(root, subkey, L"", |
1114 delegate_execute.DirName().value(), true); | 1123 delegate_execute.DirName().value(), true); |
1115 | 1124 |
1116 // Register to ICommandExecuteImpl interface at | 1125 // Register to ICommandExecuteImpl interface at |
1117 // Software\Classes\Interface\{0BA0D4E9-2259-4963-B9AE-A839F7CB7544} | 1126 // Software\Classes\Interface\{0BA0D4E9-2259-4963-B9AE-A839F7CB7544} |
1118 list->AddCreateRegKeyWorkItem(root, interface_path); | 1127 list->AddCreateRegKeyWorkItem(root, interface_path); |
1119 list->AddSetRegValueWorkItem(root, interface_path, L"", | 1128 list->AddSetRegValueWorkItem(root, interface_path, L"", |
1120 kICommandExecuteImpl, true); | 1129 L"ICommandExecuteImpl", true); |
1121 | 1130 |
1122 subkey.assign(interface_path).append(L"\\ProxyStubClsid32"); | 1131 subkey.assign(interface_path).append(L"\\ProxyStubClsid32"); |
1123 list->AddCreateRegKeyWorkItem(root, subkey); | 1132 list->AddCreateRegKeyWorkItem(root, subkey); |
1124 list->AddSetRegValueWorkItem(root, subkey, L"", kPSOAInterfaceUuid, true); | 1133 list->AddSetRegValueWorkItem(root, subkey, L"", kPSOAInterfaceUuid, true); |
1125 | 1134 |
1126 subkey.assign(interface_path).append(L"\\TypeLib"); | 1135 subkey.assign(interface_path).append(L"\\TypeLib"); |
1127 list->AddCreateRegKeyWorkItem(root, subkey); | 1136 list->AddCreateRegKeyWorkItem(root, subkey); |
1128 list->AddSetRegValueWorkItem(root, subkey, L"", kDelegateExecuteLibUuid, | 1137 list->AddSetRegValueWorkItem(root, subkey, L"", type_lib_uuid, true); |
| 1138 list->AddSetRegValueWorkItem(root, subkey, L"Version", type_lib_version, |
1129 true); | 1139 true); |
1130 list->AddSetRegValueWorkItem(root, subkey, L"Version", | |
1131 kDelegateExecuteLibVersion, true); | |
1132 | 1140 |
1133 } else { | 1141 } else { |
1134 list->AddDeleteRegKeyWorkItem(root, delegate_execute_path); | 1142 list->AddDeleteRegKeyWorkItem(root, delegate_execute_path); |
1135 list->AddDeleteRegKeyWorkItem(root, typelib_path); | 1143 list->AddDeleteRegKeyWorkItem(root, typelib_path); |
1136 list->AddDeleteRegKeyWorkItem(root, interface_path); | 1144 list->AddDeleteRegKeyWorkItem(root, interface_path); |
1137 } | 1145 } |
1138 } | 1146 } |
1139 | 1147 |
1140 namespace { | 1148 namespace { |
1141 | 1149 |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1377 } else { | 1385 } else { |
1378 DCHECK(operation == REMOVE_COMMAND); | 1386 DCHECK(operation == REMOVE_COMMAND); |
1379 work_item_list->AddDeleteRegKeyWorkItem(installer_state.root_key(), | 1387 work_item_list->AddDeleteRegKeyWorkItem(installer_state.root_key(), |
1380 cmd_key)->set_log_message( | 1388 cmd_key)->set_log_message( |
1381 "removing quick-enable-cf command"); | 1389 "removing quick-enable-cf command"); |
1382 } | 1390 } |
1383 } | 1391 } |
1384 } | 1392 } |
1385 | 1393 |
1386 } // namespace installer | 1394 } // namespace installer |
OLD | NEW |