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 <windows.h> // NOLINT | 10 #include <windows.h> // NOLINT |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 25 #include "base/logging.h" | 25 #include "base/logging.h" |
| 26 #include "base/macros.h" | 26 #include "base/macros.h" |
| 27 #include "base/path_service.h" | 27 #include "base/path_service.h" |
| 28 #include "base/strings/string_util.h" | 28 #include "base/strings/string_util.h" |
| 29 #include "base/strings/utf_string_conversions.h" | 29 #include "base/strings/utf_string_conversions.h" |
| 30 #include "base/version.h" | 30 #include "base/version.h" |
| 31 #include "base/win/registry.h" | 31 #include "base/win/registry.h" |
| 32 #include "base/win/windows_version.h" | 32 #include "base/win/windows_version.h" |
| 33 #include "chrome/common/chrome_constants.h" | 33 #include "chrome/common/chrome_constants.h" |
| 34 #include "chrome/common/chrome_switches.h" | 34 #include "chrome/common/chrome_switches.h" |
| 35 #include "chrome/install_static/install_details.h" | |
| 35 #include "chrome/installer/setup/app_launcher_installer.h" | 36 #include "chrome/installer/setup/app_launcher_installer.h" |
| 37 #include "chrome/installer/setup/brand_constants.h" | |
| 36 #include "chrome/installer/setup/install.h" | 38 #include "chrome/installer/setup/install.h" |
| 37 #include "chrome/installer/setup/persistent_histogram_storage.h" | 39 #include "chrome/installer/setup/persistent_histogram_storage.h" |
| 38 #include "chrome/installer/setup/setup_constants.h" | 40 #include "chrome/installer/setup/setup_constants.h" |
| 39 #include "chrome/installer/setup/setup_util.h" | 41 #include "chrome/installer/setup/setup_util.h" |
| 40 #include "chrome/installer/setup/update_active_setup_version_work_item.h" | 42 #include "chrome/installer/setup/update_active_setup_version_work_item.h" |
| 41 #include "chrome/installer/util/app_registration_data.h" | 43 #include "chrome/installer/util/app_registration_data.h" |
| 42 #include "chrome/installer/util/browser_distribution.h" | 44 #include "chrome/installer/util/browser_distribution.h" |
| 43 #include "chrome/installer/util/callback_work_item.h" | 45 #include "chrome/installer/util/callback_work_item.h" |
| 44 #include "chrome/installer/util/conditional_work_item_list.h" | 46 #include "chrome/installer/util/conditional_work_item_list.h" |
| 45 #include "chrome/installer/util/create_reg_key_work_item.h" | 47 #include "chrome/installer/util/create_reg_key_work_item.h" |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 238 for (Products::const_iterator it = products.begin(); it < products.end(); | 240 for (Products::const_iterator it = products.begin(); it < products.end(); |
| 239 ++it) { | 241 ++it) { |
| 240 const Product& p = **it; | 242 const Product& p = **it; |
| 241 if (p.is_chrome()) { | 243 if (p.is_chrome()) { |
| 242 AddOsUpgradeWorkItems(installer_state, setup_path, new_version, p, | 244 AddOsUpgradeWorkItems(installer_state, setup_path, new_version, p, |
| 243 list); | 245 list); |
| 244 AddFirewallRulesWorkItems(installer_state, p.distribution(), | 246 AddFirewallRulesWorkItems(installer_state, p.distribution(), |
| 245 current_version == nullptr, list); | 247 current_version == nullptr, list); |
| 246 | 248 |
| 247 #if defined(GOOGLE_CHROME_BUILD) | 249 #if defined(GOOGLE_CHROME_BUILD) |
| 248 if (!InstallUtil::IsChromeSxSProcess()) { | 250 if (GetBrandConstants().supported_app_launcher) { |
| 249 // Remove the app launcher key as it has been deprecated. | 251 // Remove the app launcher key as it has been deprecated. |
| 250 RemoveAppLauncherVersionKey(installer_state.root_key()); | 252 RemoveAppLauncherVersionKey(installer_state.root_key()); |
| 251 } | 253 } |
| 252 #endif // GOOGLE_CHROME_BUILD | 254 #endif // GOOGLE_CHROME_BUILD |
| 253 InstallUtil::AddUpdateDowngradeVersionItem( | 255 InstallUtil::AddUpdateDowngradeVersionItem( |
| 254 installer_state.system_install(), current_version, new_version, | 256 installer_state.system_install(), current_version, new_version, |
| 255 p.distribution(), list); | 257 p.distribution(), list); |
| 256 } | 258 } |
| 257 if (p.is_chrome_binaries()) | 259 if (p.is_chrome_binaries()) |
| 258 AddQuickEnableChromeFrameWorkItems(installer_state, list); | 260 AddQuickEnableChromeFrameWorkItems(installer_state, list); |
| (...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 877 // Migrates the usagestats value from the binaries to Chrome when migrating | 879 // Migrates the usagestats value from the binaries to Chrome when migrating |
| 878 // multi-install Chrome to single-install. | 880 // multi-install Chrome to single-install. |
| 879 void AddMigrateUsageStatesWorkItems(const InstallationState& original_state, | 881 void AddMigrateUsageStatesWorkItems(const InstallationState& original_state, |
| 880 const InstallerState& installer_state, | 882 const InstallerState& installer_state, |
| 881 WorkItemList* install_list) { | 883 WorkItemList* install_list) { |
| 882 // Ensure that a non-multi install or update is being processed (i.e., | 884 // Ensure that a non-multi install or update is being processed (i.e., |
| 883 // no "--multi-install" on the command line). | 885 // no "--multi-install" on the command line). |
| 884 if (installer_state.is_multi_install()) | 886 if (installer_state.is_multi_install()) |
| 885 return; | 887 return; |
| 886 | 888 |
| 887 // This operation doesn't apply to SxS Chrome. | 889 // This operation doesn't apply to modes that don't support multi-install. |
| 888 if (InstallUtil::IsChromeSxSProcess()) | 890 if (!install_static::InstallDetails::Get().supports_multi_install()) |
| 889 return; | 891 return; |
| 890 | 892 |
| 891 // Ensure that Chrome is the product being installed or updated (there are no | 893 // Ensure that Chrome is the product being installed or updated (there are no |
| 892 // other products, so it is especially unexpected for this to fail). | 894 // other products, so it is especially unexpected for this to fail). |
| 893 const Product* chrome_product = | 895 const Product* chrome_product = |
| 894 installer_state.FindProduct(BrowserDistribution::CHROME_BROWSER); | 896 installer_state.FindProduct(BrowserDistribution::CHROME_BROWSER); |
| 895 if (!chrome_product) { | 897 if (!chrome_product) { |
| 896 LOG(DFATAL) << "Not operating on Chrome while migrating to single-install."; | 898 LOG(DFATAL) << "Not operating on Chrome while migrating to single-install."; |
| 897 return; | 899 return; |
| 898 } | 900 } |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1120 archive_path, | 1122 archive_path, |
| 1121 src_path, | 1123 src_path, |
| 1122 temp_path, | 1124 temp_path, |
| 1123 current_version, | 1125 current_version, |
| 1124 new_version, | 1126 new_version, |
| 1125 install_list); | 1127 install_list); |
| 1126 } | 1128 } |
| 1127 | 1129 |
| 1128 #if defined(GOOGLE_CHROME_BUILD) | 1130 #if defined(GOOGLE_CHROME_BUILD) |
| 1129 // For Chrome, unconditionally remove the legacy app_host.exe. | 1131 // For Chrome, unconditionally remove the legacy app_host.exe. |
| 1130 if (!InstallUtil::IsChromeSxSProcess()) | 1132 if (GetBrandConstants().supported_app_launcher) |
| 1131 AddRemoveLegacyAppHostExeWorkItems(target_path, temp_path, install_list); | 1133 AddRemoveLegacyAppHostExeWorkItems(target_path, temp_path, install_list); |
| 1132 #endif // GOOGLE_CHROME_BUILD | 1134 #endif // GOOGLE_CHROME_BUILD |
| 1133 | 1135 |
| 1134 // Copy installer in install directory | 1136 // Copy installer in install directory |
| 1135 AddInstallerCopyTasks(installer_state, setup_path, archive_path, temp_path, | 1137 AddInstallerCopyTasks(installer_state, setup_path, archive_path, temp_path, |
| 1136 new_version, install_list); | 1138 new_version, install_list); |
| 1137 | 1139 |
| 1138 const HKEY root = installer_state.root_key(); | 1140 const HKEY root = installer_state.root_key(); |
| 1139 // Only set "lang" for user-level installs since for system-level, the install | 1141 // Only set "lang" for user-level installs since for system-level, the install |
| 1140 // language may not be related to a given user's runtime language. | 1142 // language may not be related to a given user's runtime language. |
| (...skipping 15 matching lines...) Expand all Loading... | |
| 1156 add_language_identifier, | 1158 add_language_identifier, |
| 1157 install_list); | 1159 install_list); |
| 1158 | 1160 |
| 1159 AddCleanupDelegateExecuteWorkItems(installer_state, product, install_list); | 1161 AddCleanupDelegateExecuteWorkItems(installer_state, product, install_list); |
| 1160 AddCleanupDeprecatedPerUserRegistrationsWorkItems(product, install_list); | 1162 AddCleanupDeprecatedPerUserRegistrationsWorkItems(product, install_list); |
| 1161 | 1163 |
| 1162 AddActiveSetupWorkItems(installer_state, new_version, product, | 1164 AddActiveSetupWorkItems(installer_state, new_version, product, |
| 1163 install_list); | 1165 install_list); |
| 1164 } | 1166 } |
| 1165 | 1167 |
| 1166 // Ensure that the Clients key for the binaries is gone for single installs | 1168 // Ensure that the Clients key for the binaries is gone for single installs of |
| 1167 // (but not for SxS Chrome). | 1169 // multi-capable products. |
| 1168 if (!installer_state.is_multi_install() && | 1170 if (install_static::InstallDetails::Get().supports_multi_install() && |
| 1169 !InstallUtil::IsChromeSxSProcess()) { | 1171 !installer_state.is_multi_install()) { |
| 1170 BrowserDistribution* binaries_dist = | 1172 BrowserDistribution* binaries_dist = |
| 1171 BrowserDistribution::GetSpecificDistribution( | 1173 BrowserDistribution::GetSpecificDistribution( |
| 1172 BrowserDistribution::CHROME_BINARIES); | 1174 BrowserDistribution::CHROME_BINARIES); |
| 1173 install_list->AddDeleteRegKeyWorkItem(root, | 1175 install_list->AddDeleteRegKeyWorkItem(root, |
| 1174 binaries_dist->GetVersionKey(), | 1176 binaries_dist->GetVersionKey(), |
| 1175 KEY_WOW64_32KEY); | 1177 KEY_WOW64_32KEY); |
| 1176 } | 1178 } |
| 1177 | 1179 |
| 1178 #if defined(GOOGLE_CHROME_BUILD) | 1180 #if defined(GOOGLE_CHROME_BUILD) |
| 1179 if (!InstallUtil::IsChromeSxSProcess()) | 1181 if (GetBrandConstants().supported_app_launcher) |
|
robertshield
2016/11/04 12:50:35
I don't have a suggestion, more of an observation:
grt (UTC plus 2)
2016/11/08 13:02:13
I wouldn't object to resolving it now somehow. Her
robertshield
2016/11/08 22:03:40
Thought about this for a bit and I'm not sure if t
grt (UTC plus 2)
2016/11/10 15:18:03
Now is as good a time as any. WDYT?
| |
| 1180 AddRemoveLegacyAppCommandsWorkItems(installer_state, install_list); | 1182 AddRemoveLegacyAppCommandsWorkItems(installer_state, install_list); |
| 1181 #endif // GOOGLE_CHROME_BUILD | 1183 #endif // GOOGLE_CHROME_BUILD |
| 1182 | 1184 |
| 1183 // Add any remaining work items that involve special settings for | 1185 // Add any remaining work items that involve special settings for |
| 1184 // each product. | 1186 // each product. |
| 1185 AddProductSpecificWorkItems(original_state, installer_state, setup_path, | 1187 AddProductSpecificWorkItems(original_state, installer_state, setup_path, |
| 1186 new_version, current_version, | 1188 new_version, current_version, |
| 1187 add_language_identifier, install_list); | 1189 add_language_identifier, install_list); |
| 1188 | 1190 |
| 1189 // Copy over brand, usagestats, and other values. | 1191 // Copy over brand, usagestats, and other values. |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1413 // Unconditionally remove the legacy Quick Enable command from the binaries. | 1415 // Unconditionally remove the legacy Quick Enable command from the binaries. |
| 1414 // Do this even if multi-install Chrome isn't installed to ensure that it is | 1416 // Do this even if multi-install Chrome isn't installed to ensure that it is |
| 1415 // not left behind in any case. | 1417 // not left behind in any case. |
| 1416 work_item_list->AddDeleteRegKeyWorkItem( | 1418 work_item_list->AddDeleteRegKeyWorkItem( |
| 1417 installer_state.root_key(), cmd_key, KEY_WOW64_32KEY) | 1419 installer_state.root_key(), cmd_key, KEY_WOW64_32KEY) |
| 1418 ->set_log_message("removing " + base::UTF16ToASCII(kCmdQuickEnableCf) + | 1420 ->set_log_message("removing " + base::UTF16ToASCII(kCmdQuickEnableCf) + |
| 1419 " command"); | 1421 " command"); |
| 1420 } | 1422 } |
| 1421 | 1423 |
| 1422 } // namespace installer | 1424 } // namespace installer |
| OLD | NEW |