Chromium Code Reviews| 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(&handler_class_uuid, | |
| 1045 &type_lib_uuid, &type_lib_version, &interface_uuid)) { | |
|
robertshield
2012/04/17 14:51:19
indent + 4
grt (UTC plus 2)
2012/04/17 15:27:33
Done.
| |
| 1046 VLOG(1) << "No DelegateExecute verb handler processing to do for " | |
| 1047 << distribution->GetAppShortCutName(); | |
| 1048 return; | |
| 1049 } | |
| 1050 | |
| 1051 VLOG(1) << "DelegateExecute verb handler COM registration."; | |
| 1052 | |
| 1043 HKEY root = installer_state.root_key(); | 1053 HKEY root = installer_state.root_key(); |
| 1044 const bool is_install = | 1054 const bool is_install = |
| 1045 (installer_state.operation() != InstallerState::UNINSTALL); | 1055 (installer_state.operation() != InstallerState::UNINSTALL); |
| 1046 string16 delegate_execute_path(L"Software\\Classes\\CLSID\\"); | 1056 string16 delegate_execute_path(L"Software\\Classes\\CLSID\\"); |
| 1047 delegate_execute_path.append(kCommandExecuteImplUuid); | 1057 delegate_execute_path.append(handler_class_uuid); |
| 1048 string16 typelib_path(L"Software\\Classes\\TypeLib\\"); | 1058 string16 typelib_path(L"Software\\Classes\\TypeLib\\"); |
| 1049 typelib_path.append(kDelegateExecuteLibUuid); | 1059 typelib_path.append(type_lib_uuid); |
| 1050 string16 interface_path(L"Software\\Classes\\Interface\\"); | 1060 string16 interface_path(L"Software\\Classes\\Interface\\"); |
| 1051 interface_path.append(kICommandExecuteImplUuid); | 1061 interface_path.append(interface_uuid); |
| 1052 | 1062 |
| 1053 if (is_install) { | 1063 if (is_install) { |
| 1054 // The path to the exe (in the version directory). | 1064 // The path to the exe (in the version directory). |
| 1055 FilePath delegate_execute( | 1065 FilePath delegate_execute( |
| 1056 installer_state.target_path().AppendASCII(new_version.GetString())); | 1066 installer_state.target_path().AppendASCII(new_version.GetString())); |
| 1057 delegate_execute = delegate_execute.Append(kDelegateExecuteExe); | 1067 delegate_execute = delegate_execute.Append(kDelegateExecuteExe); |
| 1058 | 1068 |
| 1059 // Command-line featuring the quoted path to the exe. | 1069 // Command-line featuring the quoted path to the exe. |
| 1060 string16 command(1, L'"'); | 1070 string16 command(1, L'"'); |
| 1061 command.append(delegate_execute.value()).append(1, L'"'); | 1071 command.append(delegate_execute.value()).append(1, L'"'); |
| 1062 | 1072 |
| 1063 // Register the CommandExecuteImpl class at | 1073 // Register the CommandExecuteImpl class at |
| 1064 // Software\Classes\CLSID\{5C65F4B0-3651-4514-B207-D10CB699B14B} | 1074 // Software\Classes\CLSID\{5C65F4B0-3651-4514-B207-D10CB699B14B} |
| 1065 list->AddCreateRegKeyWorkItem(root, delegate_execute_path); | 1075 list->AddCreateRegKeyWorkItem(root, delegate_execute_path); |
| 1066 list->AddSetRegValueWorkItem(root, delegate_execute_path, L"", | 1076 list->AddSetRegValueWorkItem(root, delegate_execute_path, L"", |
| 1067 L"CommandExecuteImpl Class", true); | 1077 L"CommandExecuteImpl Class", true); |
| 1068 string16 subkey(delegate_execute_path); | 1078 string16 subkey(delegate_execute_path); |
| 1069 subkey.append(L"\\LocalServer32"); | 1079 subkey.append(L"\\LocalServer32"); |
| 1070 list->AddCreateRegKeyWorkItem(root, subkey); | 1080 list->AddCreateRegKeyWorkItem(root, subkey); |
| 1071 list->AddSetRegValueWorkItem(root, subkey, L"", command, true); | 1081 list->AddSetRegValueWorkItem(root, subkey, L"", command, true); |
| 1072 list->AddSetRegValueWorkItem(root, subkey, L"ServerExecutable", | 1082 list->AddSetRegValueWorkItem(root, subkey, L"ServerExecutable", |
| 1073 delegate_execute.value(), true); | 1083 delegate_execute.value(), true); |
| 1074 | 1084 |
| 1075 subkey.assign(delegate_execute_path).append(L"\\Programmable"); | 1085 subkey.assign(delegate_execute_path).append(L"\\Programmable"); |
| 1076 list->AddCreateRegKeyWorkItem(root, subkey); | 1086 list->AddCreateRegKeyWorkItem(root, subkey); |
| 1077 | 1087 |
| 1078 subkey.assign(delegate_execute_path).append(L"\\TypeLib"); | 1088 subkey.assign(delegate_execute_path).append(L"\\TypeLib"); |
| 1079 list->AddCreateRegKeyWorkItem(root, subkey); | 1089 list->AddCreateRegKeyWorkItem(root, subkey); |
| 1080 list->AddSetRegValueWorkItem(root, subkey, L"", kDelegateExecuteLibUuid, | 1090 list->AddSetRegValueWorkItem(root, subkey, L"", type_lib_uuid, true); |
| 1081 true); | |
| 1082 | 1091 |
| 1083 subkey.assign(delegate_execute_path).append(L"\\Version"); | 1092 subkey.assign(delegate_execute_path).append(L"\\Version"); |
| 1084 list->AddCreateRegKeyWorkItem(root, subkey); | 1093 list->AddCreateRegKeyWorkItem(root, subkey); |
| 1085 list->AddSetRegValueWorkItem(root, subkey, L"", kDelegateExecuteLibVersion, | 1094 list->AddSetRegValueWorkItem(root, subkey, L"", type_lib_version, true); |
| 1086 true); | |
| 1087 | 1095 |
| 1088 // Register the DelegateExecuteLib type library at | 1096 // Register the DelegateExecuteLib type library at |
| 1089 // Software\Classes\TypeLib\{4E805ED8-EBA0-4601-9681-12815A56EBFD} | 1097 // Software\Classes\TypeLib\{4E805ED8-EBA0-4601-9681-12815A56EBFD} |
| 1090 list->AddCreateRegKeyWorkItem(root, typelib_path); | 1098 list->AddCreateRegKeyWorkItem(root, typelib_path); |
| 1091 | 1099 |
| 1092 string16 version_key(typelib_path); | 1100 string16 version_key(typelib_path); |
| 1093 version_key.append(1, L'\\').append(kDelegateExecuteLibVersion); | 1101 version_key.append(1, L'\\').append(type_lib_version); |
| 1094 list->AddCreateRegKeyWorkItem(root, version_key); | 1102 list->AddCreateRegKeyWorkItem(root, version_key); |
| 1095 list->AddSetRegValueWorkItem(root, version_key, L"", kDelegateExecuteLib, | 1103 list->AddSetRegValueWorkItem(root, version_key, L"", L"DelegateExecuteLib", |
| 1096 true); | 1104 true); |
| 1097 | 1105 |
| 1098 subkey.assign(version_key).append(L"\\FLAGS"); | 1106 subkey.assign(version_key).append(L"\\FLAGS"); |
| 1099 const DWORD flags = LIBFLAG_FRESTRICTED | LIBFLAG_FCONTROL; | 1107 const DWORD flags = LIBFLAG_FRESTRICTED | LIBFLAG_FCONTROL; |
| 1100 list->AddCreateRegKeyWorkItem(root, subkey); | 1108 list->AddCreateRegKeyWorkItem(root, subkey); |
| 1101 list->AddSetRegValueWorkItem(root, subkey, L"", flags, true); | 1109 list->AddSetRegValueWorkItem(root, subkey, L"", flags, true); |
| 1102 | 1110 |
| 1103 subkey.assign(version_key).append(L"\\0"); | 1111 subkey.assign(version_key).append(L"\\0"); |
| 1104 list->AddCreateRegKeyWorkItem(root, subkey); | 1112 list->AddCreateRegKeyWorkItem(root, subkey); |
| 1105 | 1113 |
| 1106 subkey.append(L"\\win32"); | 1114 subkey.append(L"\\win32"); |
| 1107 list->AddCreateRegKeyWorkItem(root, subkey); | 1115 list->AddCreateRegKeyWorkItem(root, subkey); |
| 1108 list->AddSetRegValueWorkItem(root, subkey, L"", delegate_execute.value(), | 1116 list->AddSetRegValueWorkItem(root, subkey, L"", delegate_execute.value(), |
| 1109 true); | 1117 true); |
| 1110 | 1118 |
| 1111 subkey.assign(version_key).append(L"\\HELPDIR"); | 1119 subkey.assign(version_key).append(L"\\HELPDIR"); |
| 1112 list->AddCreateRegKeyWorkItem(root, subkey); | 1120 list->AddCreateRegKeyWorkItem(root, subkey); |
| 1113 list->AddSetRegValueWorkItem(root, subkey, L"", | 1121 list->AddSetRegValueWorkItem(root, subkey, L"", |
| 1114 delegate_execute.DirName().value(), true); | 1122 delegate_execute.DirName().value(), true); |
| 1115 | 1123 |
| 1116 // Register to ICommandExecuteImpl interface at | 1124 // Register to ICommandExecuteImpl interface at |
| 1117 // Software\Classes\Interface\{0BA0D4E9-2259-4963-B9AE-A839F7CB7544} | 1125 // Software\Classes\Interface\{0BA0D4E9-2259-4963-B9AE-A839F7CB7544} |
| 1118 list->AddCreateRegKeyWorkItem(root, interface_path); | 1126 list->AddCreateRegKeyWorkItem(root, interface_path); |
| 1119 list->AddSetRegValueWorkItem(root, interface_path, L"", | 1127 list->AddSetRegValueWorkItem(root, interface_path, L"", |
| 1120 kICommandExecuteImpl, true); | 1128 L"ICommandExecuteImpl", true); |
| 1121 | 1129 |
| 1122 subkey.assign(interface_path).append(L"\\ProxyStubClsid32"); | 1130 subkey.assign(interface_path).append(L"\\ProxyStubClsid32"); |
| 1123 list->AddCreateRegKeyWorkItem(root, subkey); | 1131 list->AddCreateRegKeyWorkItem(root, subkey); |
| 1124 list->AddSetRegValueWorkItem(root, subkey, L"", kPSOAInterfaceUuid, true); | 1132 list->AddSetRegValueWorkItem(root, subkey, L"", kPSOAInterfaceUuid, true); |
| 1125 | 1133 |
| 1126 subkey.assign(interface_path).append(L"\\TypeLib"); | 1134 subkey.assign(interface_path).append(L"\\TypeLib"); |
| 1127 list->AddCreateRegKeyWorkItem(root, subkey); | 1135 list->AddCreateRegKeyWorkItem(root, subkey); |
| 1128 list->AddSetRegValueWorkItem(root, subkey, L"", kDelegateExecuteLibUuid, | 1136 list->AddSetRegValueWorkItem(root, subkey, L"", type_lib_uuid, true); |
| 1137 list->AddSetRegValueWorkItem(root, subkey, L"Version", type_lib_version, | |
| 1129 true); | 1138 true); |
| 1130 list->AddSetRegValueWorkItem(root, subkey, L"Version", | |
| 1131 kDelegateExecuteLibVersion, true); | |
| 1132 | 1139 |
| 1133 } else { | 1140 } else { |
| 1134 list->AddDeleteRegKeyWorkItem(root, delegate_execute_path); | 1141 list->AddDeleteRegKeyWorkItem(root, delegate_execute_path); |
| 1135 list->AddDeleteRegKeyWorkItem(root, typelib_path); | 1142 list->AddDeleteRegKeyWorkItem(root, typelib_path); |
| 1136 list->AddDeleteRegKeyWorkItem(root, interface_path); | 1143 list->AddDeleteRegKeyWorkItem(root, interface_path); |
| 1137 } | 1144 } |
| 1138 } | 1145 } |
| 1139 | 1146 |
| 1140 namespace { | 1147 namespace { |
| 1141 | 1148 |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1377 } else { | 1384 } else { |
| 1378 DCHECK(operation == REMOVE_COMMAND); | 1385 DCHECK(operation == REMOVE_COMMAND); |
| 1379 work_item_list->AddDeleteRegKeyWorkItem(installer_state.root_key(), | 1386 work_item_list->AddDeleteRegKeyWorkItem(installer_state.root_key(), |
| 1380 cmd_key)->set_log_message( | 1387 cmd_key)->set_log_message( |
| 1381 "removing quick-enable-cf command"); | 1388 "removing quick-enable-cf command"); |
| 1382 } | 1389 } |
| 1383 } | 1390 } |
| 1384 } | 1391 } |
| 1385 | 1392 |
| 1386 } // namespace installer | 1393 } // namespace installer |
| OLD | NEW |