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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 221 installer_state.system_install(), | 221 installer_state.system_install(), |
| 222 dist, | 222 dist, |
| 223 installer_state.target_path().Append(kChromeExe), | 223 installer_state.target_path().Append(kChromeExe), |
| 224 is_new_install)); | 224 is_new_install)); |
| 225 } | 225 } |
| 226 | 226 |
| 227 void AddProductSpecificWorkItems(const InstallationState& original_state, | 227 void AddProductSpecificWorkItems(const InstallationState& original_state, |
| 228 const InstallerState& installer_state, | 228 const InstallerState& installer_state, |
| 229 const base::FilePath& setup_path, | 229 const base::FilePath& setup_path, |
| 230 const Version& new_version, | 230 const Version& new_version, |
| 231 bool is_new_install, | 231 const Version* current_version, |
| 232 bool add_language_identifier, | 232 bool add_language_identifier, |
| 233 WorkItemList* list) { | 233 WorkItemList* list) { |
| 234 const Products& products = installer_state.products(); | 234 const Products& products = installer_state.products(); |
| 235 for (Products::const_iterator it = products.begin(); it < products.end(); | 235 for (Products::const_iterator it = products.begin(); it < products.end(); |
| 236 ++it) { | 236 ++it) { |
| 237 const Product& p = **it; | 237 const Product& p = **it; |
| 238 if (p.is_chrome()) { | 238 if (p.is_chrome()) { |
| 239 AddOsUpgradeWorkItems(installer_state, setup_path, new_version, p, | 239 AddOsUpgradeWorkItems(installer_state, setup_path, new_version, p, |
| 240 list); | 240 list); |
| 241 AddFirewallRulesWorkItems( | 241 AddFirewallRulesWorkItems(installer_state, p.distribution(), |
| 242 installer_state, p.distribution(), is_new_install, list); | 242 current_version == nullptr, list); |
| 243 | 243 |
| 244 #if defined(GOOGLE_CHROME_BUILD) | 244 #if defined(GOOGLE_CHROME_BUILD) |
| 245 if (!InstallUtil::IsChromeSxSProcess()) { | 245 if (!InstallUtil::IsChromeSxSProcess()) { |
| 246 // Add items to set up the App Launcher's version key if Google Chrome | 246 // Add items to set up the App Launcher's version key if Google Chrome |
| 247 // is being installed or updated. | 247 // is being installed or updated. |
| 248 AddAppLauncherVersionKeyWorkItems(installer_state.root_key(), | 248 AddAppLauncherVersionKeyWorkItems(installer_state.root_key(), |
| 249 new_version, add_language_identifier, list); | 249 new_version, add_language_identifier, list); |
| 250 } | 250 } |
| 251 #endif // GOOGLE_CHROME_BUILD | 251 #endif // GOOGLE_CHROME_BUILD |
| 252 InstallUtil::AddUpdateDowngradeVersionItem(installer_state.root_key(), | |
| 253 *current_version, new_version, | |
|
grt (UTC plus 2)
2016/05/20 15:25:05
|current_version| is null on a new install, so you
zmin
2016/05/20 16:33:05
make sense, I'll update it.
| |
| 254 p.distribution(), list); | |
| 252 } | 255 } |
| 253 if (p.is_chrome_binaries()) | 256 if (p.is_chrome_binaries()) |
| 254 AddQuickEnableChromeFrameWorkItems(installer_state, list); | 257 AddQuickEnableChromeFrameWorkItems(installer_state, list); |
| 255 } | 258 } |
| 256 } | 259 } |
| 257 | 260 |
| 258 // This is called when an MSI installation is run. It may be that a user is | 261 // This is called when an MSI installation is run. It may be that a user is |
| 259 // attempting to install the MSI on top of a non-MSI managed installation. If | 262 // attempting to install the MSI on top of a non-MSI managed installation. If |
| 260 // so, try and remove any existing "Add/Remove Programs" entry, as we want the | 263 // so, try and remove any existing "Add/Remove Programs" entry, as we want the |
| 261 // uninstall to be managed entirely by the MSI machinery (accessible via the | 264 // uninstall to be managed entirely by the MSI machinery (accessible via the |
| (...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1112 KEY_WOW64_32KEY); | 1115 KEY_WOW64_32KEY); |
| 1113 } | 1116 } |
| 1114 | 1117 |
| 1115 #if defined(GOOGLE_CHROME_BUILD) | 1118 #if defined(GOOGLE_CHROME_BUILD) |
| 1116 if (!InstallUtil::IsChromeSxSProcess()) | 1119 if (!InstallUtil::IsChromeSxSProcess()) |
| 1117 AddRemoveLegacyAppCommandsWorkItems(installer_state, install_list); | 1120 AddRemoveLegacyAppCommandsWorkItems(installer_state, install_list); |
| 1118 #endif // GOOGLE_CHROME_BUILD | 1121 #endif // GOOGLE_CHROME_BUILD |
| 1119 | 1122 |
| 1120 // Add any remaining work items that involve special settings for | 1123 // Add any remaining work items that involve special settings for |
| 1121 // each product. | 1124 // each product. |
| 1122 AddProductSpecificWorkItems(original_state, | 1125 AddProductSpecificWorkItems(original_state, installer_state, setup_path, |
| 1123 installer_state, | 1126 new_version, current_version, |
| 1124 setup_path, | 1127 add_language_identifier, install_list); |
| 1125 new_version, | |
| 1126 current_version == NULL, | |
| 1127 add_language_identifier, | |
| 1128 install_list); | |
| 1129 | 1128 |
| 1130 // Copy over brand, usagestats, and other values. | 1129 // Copy over brand, usagestats, and other values. |
| 1131 AddGoogleUpdateWorkItems(original_state, installer_state, install_list); | 1130 AddGoogleUpdateWorkItems(original_state, installer_state, install_list); |
| 1132 | 1131 |
| 1133 // Migrate usagestats back to Chrome. | 1132 // Migrate usagestats back to Chrome. |
| 1134 AddMigrateUsageStatesWorkItems(original_state, installer_state, install_list); | 1133 AddMigrateUsageStatesWorkItems(original_state, installer_state, install_list); |
| 1135 | 1134 |
| 1136 // Append the tasks that run after the installation. | 1135 // Append the tasks that run after the installation. |
| 1137 AppendPostInstallTasks(installer_state, | 1136 AppendPostInstallTasks(installer_state, |
| 1138 setup_path, | 1137 setup_path, |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1354 // Unconditionally remove the legacy Quick Enable command from the binaries. | 1353 // Unconditionally remove the legacy Quick Enable command from the binaries. |
| 1355 // Do this even if multi-install Chrome isn't installed to ensure that it is | 1354 // Do this even if multi-install Chrome isn't installed to ensure that it is |
| 1356 // not left behind in any case. | 1355 // not left behind in any case. |
| 1357 work_item_list->AddDeleteRegKeyWorkItem( | 1356 work_item_list->AddDeleteRegKeyWorkItem( |
| 1358 installer_state.root_key(), cmd_key, KEY_WOW64_32KEY) | 1357 installer_state.root_key(), cmd_key, KEY_WOW64_32KEY) |
| 1359 ->set_log_message("removing " + base::UTF16ToASCII(kCmdQuickEnableCf) + | 1358 ->set_log_message("removing " + base::UTF16ToASCII(kCmdQuickEnableCf) + |
| 1360 " command"); | 1359 " command"); |
| 1361 } | 1360 } |
| 1362 | 1361 |
| 1363 } // namespace installer | 1362 } // namespace installer |
| OLD | NEW |