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

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

Issue 1666363002: Delete old files after an update. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix return type Created 4 years, 9 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 22 matching lines...) Expand all
33 #include "chrome/installer/setup/app_launcher_installer.h" 33 #include "chrome/installer/setup/app_launcher_installer.h"
34 #include "chrome/installer/setup/install.h" 34 #include "chrome/installer/setup/install.h"
35 #include "chrome/installer/setup/setup_constants.h" 35 #include "chrome/installer/setup/setup_constants.h"
36 #include "chrome/installer/setup/setup_util.h" 36 #include "chrome/installer/setup/setup_util.h"
37 #include "chrome/installer/setup/update_active_setup_version_work_item.h" 37 #include "chrome/installer/setup/update_active_setup_version_work_item.h"
38 #include "chrome/installer/util/app_registration_data.h" 38 #include "chrome/installer/util/app_registration_data.h"
39 #include "chrome/installer/util/browser_distribution.h" 39 #include "chrome/installer/util/browser_distribution.h"
40 #include "chrome/installer/util/callback_work_item.h" 40 #include "chrome/installer/util/callback_work_item.h"
41 #include "chrome/installer/util/conditional_work_item_list.h" 41 #include "chrome/installer/util/conditional_work_item_list.h"
42 #include "chrome/installer/util/create_reg_key_work_item.h" 42 #include "chrome/installer/util/create_reg_key_work_item.h"
43 #include "chrome/installer/util/delete_old_versions.h"
43 #include "chrome/installer/util/firewall_manager_win.h" 44 #include "chrome/installer/util/firewall_manager_win.h"
44 #include "chrome/installer/util/google_update_constants.h" 45 #include "chrome/installer/util/google_update_constants.h"
45 #include "chrome/installer/util/helper.h" 46 #include "chrome/installer/util/helper.h"
46 #include "chrome/installer/util/install_util.h" 47 #include "chrome/installer/util/install_util.h"
47 #include "chrome/installer/util/installation_state.h" 48 #include "chrome/installer/util/installation_state.h"
48 #include "chrome/installer/util/installer_state.h" 49 #include "chrome/installer/util/installer_state.h"
49 #include "chrome/installer/util/l10n_string_util.h" 50 #include "chrome/installer/util/l10n_string_util.h"
50 #include "chrome/installer/util/product.h" 51 #include "chrome/installer/util/product.h"
51 #include "chrome/installer/util/set_reg_value_work_item.h" 52 #include "chrome/installer/util/set_reg_value_work_item.h"
52 #include "chrome/installer/util/shell_util.h" 53 #include "chrome/installer/util/shell_util.h"
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after
1001 regular_update_work_items->AddDeleteRegValueWorkItem( 1002 regular_update_work_items->AddDeleteRegValueWorkItem(
1002 root, 1003 root,
1003 version_key, 1004 version_key,
1004 KEY_WOW64_32KEY, 1005 KEY_WOW64_32KEY,
1005 google_update::kRegRenameCmdField); 1006 google_update::kRegRenameCmdField);
1006 } 1007 }
1007 1008
1008 post_install_task_list->AddWorkItem(regular_update_work_items.release()); 1009 post_install_task_list->AddWorkItem(regular_update_work_items.release());
1009 } 1010 }
1010 1011
1012 // If this is a regular update (chrome.exe not in use), this step will try to
1013 // delete files from all versions except the one that was just installed.
1014 // Otherwise, it will try to delete files from all versions except the one
1015 // that is in use and the one that was just installed.
1016 AddDeleteOldVersionsWorkItem(installer_state, post_install_task_list);
1017
1011 AddRegisterComDllWorkItemsForPackage(installer_state, current_version, 1018 AddRegisterComDllWorkItemsForPackage(installer_state, current_version,
1012 new_version, post_install_task_list); 1019 new_version, post_install_task_list);
1013 1020
1014 // If we're told that we're an MSI install, make sure to set the marker 1021 // If we're told that we're an MSI install, make sure to set the marker
1015 // in the client state key so that future updates do the right thing. 1022 // in the client state key so that future updates do the right thing.
1016 if (installer_state.is_msi()) { 1023 if (installer_state.is_msi()) {
1017 for (size_t i = 0; i < products.size(); ++i) { 1024 for (size_t i = 0; i < products.size(); ++i) {
1018 const Product* product = products[i]; 1025 const Product* product = products[i];
1019 AddSetMsiMarkerWorkItem(installer_state, product->distribution(), true, 1026 AddSetMsiMarkerWorkItem(installer_state, product->distribution(), true,
1020 post_install_task_list); 1027 post_install_task_list);
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
1354 // Unconditionally remove the legacy Quick Enable command from the binaries. 1361 // 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 1362 // Do this even if multi-install Chrome isn't installed to ensure that it is
1356 // not left behind in any case. 1363 // not left behind in any case.
1357 work_item_list->AddDeleteRegKeyWorkItem( 1364 work_item_list->AddDeleteRegKeyWorkItem(
1358 installer_state.root_key(), cmd_key, KEY_WOW64_32KEY) 1365 installer_state.root_key(), cmd_key, KEY_WOW64_32KEY)
1359 ->set_log_message("removing " + base::UTF16ToASCII(kCmdQuickEnableCf) + 1366 ->set_log_message("removing " + base::UTF16ToASCII(kCmdQuickEnableCf) +
1360 " command"); 1367 " command");
1361 } 1368 }
1362 1369
1363 } // namespace installer 1370 } // namespace installer
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698