Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: chrome/installer/setup/install_worker.cc

Issue 1986823002: Reset user data directory and disk cache directory after downgrade. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cr Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 if (*current_version > new_version) {
253 InstallUtil::AddSetDowngradeVersionItem(installer_state.root_key(),
grt (UTC plus 2) 2016/05/19 23:39:28 if you collapse these two functions into one AddDo
zmin 2016/05/20 00:52:25 Done.
254 *current_version, list);
255 } else if (*current_version < new_version) {
256 InstallUtil::AddRemoveDowngradeVersionItem(installer_state.root_key(),
257 new_version, list);
258 }
252 } 259 }
253 if (p.is_chrome_binaries()) 260 if (p.is_chrome_binaries())
254 AddQuickEnableChromeFrameWorkItems(installer_state, list); 261 AddQuickEnableChromeFrameWorkItems(installer_state, list);
255 } 262 }
256 } 263 }
257 264
258 // This is called when an MSI installation is run. It may be that a user is 265 // 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 266 // 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 267 // 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 268 // uninstall to be managed entirely by the MSI machinery (accessible via the
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after
1112 KEY_WOW64_32KEY); 1119 KEY_WOW64_32KEY);
1113 } 1120 }
1114 1121
1115 #if defined(GOOGLE_CHROME_BUILD) 1122 #if defined(GOOGLE_CHROME_BUILD)
1116 if (!InstallUtil::IsChromeSxSProcess()) 1123 if (!InstallUtil::IsChromeSxSProcess())
1117 AddRemoveLegacyAppCommandsWorkItems(installer_state, install_list); 1124 AddRemoveLegacyAppCommandsWorkItems(installer_state, install_list);
1118 #endif // GOOGLE_CHROME_BUILD 1125 #endif // GOOGLE_CHROME_BUILD
1119 1126
1120 // Add any remaining work items that involve special settings for 1127 // Add any remaining work items that involve special settings for
1121 // each product. 1128 // each product.
1122 AddProductSpecificWorkItems(original_state, 1129 AddProductSpecificWorkItems(original_state, installer_state, setup_path,
1123 installer_state, 1130 new_version, current_version,
1124 setup_path, 1131 add_language_identifier, install_list);
1125 new_version,
1126 current_version == NULL,
1127 add_language_identifier,
1128 install_list);
1129 1132
1130 // Copy over brand, usagestats, and other values. 1133 // Copy over brand, usagestats, and other values.
1131 AddGoogleUpdateWorkItems(original_state, installer_state, install_list); 1134 AddGoogleUpdateWorkItems(original_state, installer_state, install_list);
1132 1135
1133 // Migrate usagestats back to Chrome. 1136 // Migrate usagestats back to Chrome.
1134 AddMigrateUsageStatesWorkItems(original_state, installer_state, install_list); 1137 AddMigrateUsageStatesWorkItems(original_state, installer_state, install_list);
1135 1138
1136 // Append the tasks that run after the installation. 1139 // Append the tasks that run after the installation.
1137 AppendPostInstallTasks(installer_state, 1140 AppendPostInstallTasks(installer_state,
1138 setup_path, 1141 setup_path,
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
1354 // Unconditionally remove the legacy Quick Enable command from the binaries. 1357 // 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 1358 // Do this even if multi-install Chrome isn't installed to ensure that it is
1356 // not left behind in any case. 1359 // not left behind in any case.
1357 work_item_list->AddDeleteRegKeyWorkItem( 1360 work_item_list->AddDeleteRegKeyWorkItem(
1358 installer_state.root_key(), cmd_key, KEY_WOW64_32KEY) 1361 installer_state.root_key(), cmd_key, KEY_WOW64_32KEY)
1359 ->set_log_message("removing " + base::UTF16ToASCII(kCmdQuickEnableCf) + 1362 ->set_log_message("removing " + base::UTF16ToASCII(kCmdQuickEnableCf) +
1360 " command"); 1363 " command");
1361 } 1364 }
1362 1365
1363 } // namespace installer 1366 } // namespace installer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698