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

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: Created 4 years, 6 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
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/installer/util/install_util.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 211 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 installer_state.system_install(), 222 installer_state.system_install(),
223 dist, 223 dist,
224 installer_state.target_path().Append(kChromeExe), 224 installer_state.target_path().Append(kChromeExe),
225 is_new_install)); 225 is_new_install));
226 } 226 }
227 227
228 void AddProductSpecificWorkItems(const InstallationState& original_state, 228 void AddProductSpecificWorkItems(const InstallationState& original_state,
229 const InstallerState& installer_state, 229 const InstallerState& installer_state,
230 const base::FilePath& setup_path, 230 const base::FilePath& setup_path,
231 const Version& new_version, 231 const Version& new_version,
232 bool is_new_install, 232 const Version* current_version,
233 bool add_language_identifier, 233 bool add_language_identifier,
234 WorkItemList* list) { 234 WorkItemList* list) {
235 const Products& products = installer_state.products(); 235 const Products& products = installer_state.products();
236 for (Products::const_iterator it = products.begin(); it < products.end(); 236 for (Products::const_iterator it = products.begin(); it < products.end();
237 ++it) { 237 ++it) {
238 const Product& p = **it; 238 const Product& p = **it;
239 if (p.is_chrome()) { 239 if (p.is_chrome()) {
240 AddOsUpgradeWorkItems(installer_state, setup_path, new_version, p, 240 AddOsUpgradeWorkItems(installer_state, setup_path, new_version, p,
241 list); 241 list);
242 AddFirewallRulesWorkItems( 242 AddFirewallRulesWorkItems(installer_state, p.distribution(),
243 installer_state, p.distribution(), is_new_install, list); 243 current_version == nullptr, list);
244 244
245 #if defined(GOOGLE_CHROME_BUILD) 245 #if defined(GOOGLE_CHROME_BUILD)
246 if (!InstallUtil::IsChromeSxSProcess()) { 246 if (!InstallUtil::IsChromeSxSProcess()) {
247 // Add items to set up the App Launcher's version key if Google Chrome 247 // Add items to set up the App Launcher's version key if Google Chrome
248 // is being installed or updated. 248 // is being installed or updated.
249 AddAppLauncherVersionKeyWorkItems(installer_state.root_key(), 249 AddAppLauncherVersionKeyWorkItems(installer_state.root_key(),
250 new_version, add_language_identifier, list); 250 new_version, add_language_identifier, list);
251 } 251 }
252 #endif // GOOGLE_CHROME_BUILD 252 #endif // GOOGLE_CHROME_BUILD
253 InstallUtil::AddUpdateDowngradeVersionItem(
254 installer_state.system_install(), current_version, new_version,
255 p.distribution(), list);
253 } 256 }
254 if (p.is_chrome_binaries()) 257 if (p.is_chrome_binaries())
255 AddQuickEnableChromeFrameWorkItems(installer_state, list); 258 AddQuickEnableChromeFrameWorkItems(installer_state, list);
256 } 259 }
257 } 260 }
258 261
259 // This is called when an MSI installation is run. It may be that a user is 262 // This is called when an MSI installation is run. It may be that a user is
260 // attempting to install the MSI on top of a non-MSI managed installation. If 263 // attempting to install the MSI on top of a non-MSI managed installation. If
261 // so, try and remove any existing "Add/Remove Programs" entry, as we want the 264 // so, try and remove any existing "Add/Remove Programs" entry, as we want the
262 // uninstall to be managed entirely by the MSI machinery (accessible via the 265 // uninstall to be managed entirely by the MSI machinery (accessible via the
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after
1120 KEY_WOW64_32KEY); 1123 KEY_WOW64_32KEY);
1121 } 1124 }
1122 1125
1123 #if defined(GOOGLE_CHROME_BUILD) 1126 #if defined(GOOGLE_CHROME_BUILD)
1124 if (!InstallUtil::IsChromeSxSProcess()) 1127 if (!InstallUtil::IsChromeSxSProcess())
1125 AddRemoveLegacyAppCommandsWorkItems(installer_state, install_list); 1128 AddRemoveLegacyAppCommandsWorkItems(installer_state, install_list);
1126 #endif // GOOGLE_CHROME_BUILD 1129 #endif // GOOGLE_CHROME_BUILD
1127 1130
1128 // Add any remaining work items that involve special settings for 1131 // Add any remaining work items that involve special settings for
1129 // each product. 1132 // each product.
1130 AddProductSpecificWorkItems(original_state, 1133 AddProductSpecificWorkItems(original_state, installer_state, setup_path,
1131 installer_state, 1134 new_version, current_version,
1132 setup_path, 1135 add_language_identifier, install_list);
1133 new_version,
1134 current_version == NULL,
1135 add_language_identifier,
1136 install_list);
1137 1136
1138 // Copy over brand, usagestats, and other values. 1137 // Copy over brand, usagestats, and other values.
1139 AddGoogleUpdateWorkItems(original_state, installer_state, install_list); 1138 AddGoogleUpdateWorkItems(original_state, installer_state, install_list);
1140 1139
1141 // Migrate usagestats back to Chrome. 1140 // Migrate usagestats back to Chrome.
1142 AddMigrateUsageStatesWorkItems(original_state, installer_state, install_list); 1141 AddMigrateUsageStatesWorkItems(original_state, installer_state, install_list);
1143 1142
1144 // Append the tasks that run after the installation. 1143 // Append the tasks that run after the installation.
1145 AppendPostInstallTasks(installer_state, 1144 AppendPostInstallTasks(installer_state,
1146 setup_path, 1145 setup_path,
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
1362 // Unconditionally remove the legacy Quick Enable command from the binaries. 1361 // Unconditionally remove the legacy Quick Enable command from the binaries.
1363 // Do this even if multi-install Chrome isn't installed to ensure that it is 1362 // Do this even if multi-install Chrome isn't installed to ensure that it is
1364 // not left behind in any case. 1363 // not left behind in any case.
1365 work_item_list->AddDeleteRegKeyWorkItem( 1364 work_item_list->AddDeleteRegKeyWorkItem(
1366 installer_state.root_key(), cmd_key, KEY_WOW64_32KEY) 1365 installer_state.root_key(), cmd_key, KEY_WOW64_32KEY)
1367 ->set_log_message("removing " + base::UTF16ToASCII(kCmdQuickEnableCf) + 1366 ->set_log_message("removing " + base::UTF16ToASCII(kCmdQuickEnableCf) +
1368 " command"); 1367 " command");
1369 } 1368 }
1370 1369
1371 } // namespace installer 1370 } // namespace installer
OLDNEW
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | chrome/installer/util/install_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698