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

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

Issue 109673004: Revert "Update all users of base::Version to explicitly specify the namespace, and clean up the hea… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 | Annotate | Revision Log
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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 } else { 107 } else {
108 key_path->append(kIELowRightsPolicyOldGuid, 108 key_path->append(kIELowRightsPolicyOldGuid,
109 arraysize(kIELowRightsPolicyOldGuid)- 1); 109 arraysize(kIELowRightsPolicyOldGuid)- 1);
110 } 110 }
111 } 111 }
112 112
113 // Local helper to call AddRegisterComDllWorkItems for all DLLs in a set of 113 // Local helper to call AddRegisterComDllWorkItems for all DLLs in a set of
114 // products managed by a given package. 114 // products managed by a given package.
115 // |old_version| can be NULL to indicate no Chrome is currently installed. 115 // |old_version| can be NULL to indicate no Chrome is currently installed.
116 void AddRegisterComDllWorkItemsForPackage(const InstallerState& installer_state, 116 void AddRegisterComDllWorkItemsForPackage(const InstallerState& installer_state,
117 const base::Version* old_version, 117 const Version* old_version,
118 const base::Version& new_version, 118 const Version& new_version,
119 WorkItemList* work_item_list) { 119 WorkItemList* work_item_list) {
120 // First collect the list of DLLs to be registered from each product. 120 // First collect the list of DLLs to be registered from each product.
121 std::vector<base::FilePath> com_dll_list; 121 std::vector<base::FilePath> com_dll_list;
122 installer_state.AddComDllList(&com_dll_list); 122 installer_state.AddComDllList(&com_dll_list);
123 123
124 // Then, if we got some, attempt to unregister the DLLs from the old 124 // Then, if we got some, attempt to unregister the DLLs from the old
125 // version directory and then re-register them in the new one. 125 // version directory and then re-register them in the new one.
126 // Note that if we are migrating the install directory then we will not 126 // Note that if we are migrating the install directory then we will not
127 // successfully unregister the old DLLs. 127 // successfully unregister the old DLLs.
128 // TODO(robertshield): See whether we need to fix the migration case. 128 // TODO(robertshield): See whether we need to fix the migration case.
(...skipping 21 matching lines...) Expand all
150 true, // Register 150 true, // Register
151 false, // Must succeed. 151 false, // Must succeed.
152 work_item_list); 152 work_item_list);
153 } 153 }
154 } 154 }
155 155
156 void AddInstallerCopyTasks(const InstallerState& installer_state, 156 void AddInstallerCopyTasks(const InstallerState& installer_state,
157 const base::FilePath& setup_path, 157 const base::FilePath& setup_path,
158 const base::FilePath& archive_path, 158 const base::FilePath& archive_path,
159 const base::FilePath& temp_path, 159 const base::FilePath& temp_path,
160 const base::Version& new_version, 160 const Version& new_version,
161 WorkItemList* install_list) { 161 WorkItemList* install_list) {
162 DCHECK(install_list); 162 DCHECK(install_list);
163 base::FilePath installer_dir( 163 base::FilePath installer_dir(
164 installer_state.GetInstallerDirectory(new_version)); 164 installer_state.GetInstallerDirectory(new_version));
165 install_list->AddCreateDirWorkItem(installer_dir); 165 install_list->AddCreateDirWorkItem(installer_dir);
166 166
167 base::FilePath exe_dst(installer_dir.Append(setup_path.BaseName())); 167 base::FilePath exe_dst(installer_dir.Append(setup_path.BaseName()));
168 168
169 if (exe_dst != setup_path) { 169 if (exe_dst != setup_path) {
170 install_list->AddCopyTreeWorkItem(setup_path.value(), exe_dst.value(), 170 install_list->AddCopyTreeWorkItem(setup_path.value(), exe_dst.value(),
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 } 223 }
224 224
225 // Adds work items to create (or delete if uninstalling) app commands to launch 225 // Adds work items to create (or delete if uninstalling) app commands to launch
226 // the app with a switch. The following criteria should be true: 226 // the app with a switch. The following criteria should be true:
227 // 1. The switch takes one parameter. 227 // 1. The switch takes one parameter.
228 // 2. The command send pings. 228 // 2. The command send pings.
229 // 3. The command is web accessible. 229 // 3. The command is web accessible.
230 // 4. The command is run as the user. 230 // 4. The command is run as the user.
231 void AddCommandWithParameterWorkItems(const InstallerState& installer_state, 231 void AddCommandWithParameterWorkItems(const InstallerState& installer_state,
232 const InstallationState& machine_state, 232 const InstallationState& machine_state,
233 const base::Version& new_version, 233 const Version& new_version,
234 const Product& product, 234 const Product& product,
235 const wchar_t* command_key, 235 const wchar_t* command_key,
236 const wchar_t* app, 236 const wchar_t* app,
237 const char* command_with_parameter, 237 const char* command_with_parameter,
238 WorkItemList* work_item_list) { 238 WorkItemList* work_item_list) {
239 DCHECK(command_key); 239 DCHECK(command_key);
240 DCHECK(app); 240 DCHECK(app);
241 DCHECK(command_with_parameter); 241 DCHECK(command_with_parameter);
242 DCHECK(work_item_list); 242 DCHECK(work_item_list);
243 243
(...skipping 11 matching lines...) Expand all
255 AppCommand cmd(cmd_line.GetCommandLineString()); 255 AppCommand cmd(cmd_line.GetCommandLineString());
256 cmd.set_sends_pings(true); 256 cmd.set_sends_pings(true);
257 cmd.set_is_web_accessible(true); 257 cmd.set_is_web_accessible(true);
258 cmd.set_is_run_as_user(true); 258 cmd.set_is_run_as_user(true);
259 cmd.AddWorkItems(installer_state.root_key(), full_cmd_key, work_item_list); 259 cmd.AddWorkItems(installer_state.root_key(), full_cmd_key, work_item_list);
260 } 260 }
261 } 261 }
262 262
263 void AddInstallAppCommandWorkItems(const InstallerState& installer_state, 263 void AddInstallAppCommandWorkItems(const InstallerState& installer_state,
264 const InstallationState& machine_state, 264 const InstallationState& machine_state,
265 const base::Version& new_version, 265 const Version& new_version,
266 const Product& product, 266 const Product& product,
267 WorkItemList* work_item_list) { 267 WorkItemList* work_item_list) {
268 DCHECK(product.is_chrome_app_host()); 268 DCHECK(product.is_chrome_app_host());
269 AddCommandWithParameterWorkItems(installer_state, machine_state, new_version, 269 AddCommandWithParameterWorkItems(installer_state, machine_state, new_version,
270 product, kCmdInstallApp, 270 product, kCmdInstallApp,
271 installer::kChromeAppHostExe, 271 installer::kChromeAppHostExe,
272 ::switches::kInstallFromWebstore, 272 ::switches::kInstallFromWebstore,
273 work_item_list); 273 work_item_list);
274 } 274 }
275 275
276 void AddInstallExtensionCommandWorkItem(const InstallerState& installer_state, 276 void AddInstallExtensionCommandWorkItem(const InstallerState& installer_state,
277 const InstallationState& machine_state, 277 const InstallationState& machine_state,
278 const base::FilePath& setup_path, 278 const base::FilePath& setup_path,
279 const base::Version& new_version, 279 const Version& new_version,
280 const Product& product, 280 const Product& product,
281 WorkItemList* work_item_list) { 281 WorkItemList* work_item_list) {
282 DCHECK(product.is_chrome()); 282 DCHECK(product.is_chrome());
283 AddCommandWithParameterWorkItems(installer_state, machine_state, new_version, 283 AddCommandWithParameterWorkItems(installer_state, machine_state, new_version,
284 product, kCmdInstallExtension, 284 product, kCmdInstallExtension,
285 installer::kChromeExe, 285 installer::kChromeExe,
286 ::switches::kLimitedInstallFromWebstore, 286 ::switches::kLimitedInstallFromWebstore,
287 work_item_list); 287 work_item_list);
288 } 288 }
289 289
290 // Returns the basic CommandLine to setup.exe for a quick-enable operation on 290 // Returns the basic CommandLine to setup.exe for a quick-enable operation on
291 // the binaries. This will unconditionally include --multi-install as well as 291 // the binaries. This will unconditionally include --multi-install as well as
292 // --verbose-logging if the current installation was launched with 292 // --verbose-logging if the current installation was launched with
293 // --verbose-logging. |setup_path| and |new_version| are optional only when 293 // --verbose-logging. |setup_path| and |new_version| are optional only when
294 // the operation is an uninstall. 294 // the operation is an uninstall.
295 CommandLine GetGenericQuickEnableCommand( 295 CommandLine GetGenericQuickEnableCommand(
296 const InstallerState& installer_state, 296 const InstallerState& installer_state,
297 const InstallationState& machine_state, 297 const InstallationState& machine_state,
298 const base::FilePath& setup_path, 298 const base::FilePath& setup_path,
299 const base::Version& new_version) { 299 const Version& new_version) {
300 // Only valid for multi-install operations. 300 // Only valid for multi-install operations.
301 DCHECK(installer_state.is_multi_install()); 301 DCHECK(installer_state.is_multi_install());
302 // Only valid when Chrome Binaries aren't being uninstalled. 302 // Only valid when Chrome Binaries aren't being uninstalled.
303 DCHECK(installer_state.operation() != InstallerState::UNINSTALL || 303 DCHECK(installer_state.operation() != InstallerState::UNINSTALL ||
304 !installer_state.FindProduct(BrowserDistribution::CHROME_BINARIES)); 304 !installer_state.FindProduct(BrowserDistribution::CHROME_BINARIES));
305 // setup_path and new_version are required when not uninstalling. 305 // setup_path and new_version are required when not uninstalling.
306 DCHECK(installer_state.operation() == InstallerState::UNINSTALL || 306 DCHECK(installer_state.operation() == InstallerState::UNINSTALL ||
307 (!setup_path.empty() && new_version.IsValid())); 307 (!setup_path.empty() && new_version.IsValid()));
308 308
309 // The path to setup.exe contains the version of the Chrome Binaries, so it 309 // The path to setup.exe contains the version of the Chrome Binaries, so it
(...skipping 24 matching lines...) Expand all
334 } 334 }
335 335
336 // Adds work items to add the "quick-enable-application-host" command to the 336 // Adds work items to add the "quick-enable-application-host" command to the
337 // multi-installer binaries' version key on the basis of the current operation 337 // multi-installer binaries' version key on the basis of the current operation
338 // (represented in |installer_state|) and the pre-existing machine configuration 338 // (represented in |installer_state|) and the pre-existing machine configuration
339 // (represented in |machine_state|). 339 // (represented in |machine_state|).
340 void AddQuickEnableApplicationLauncherWorkItems( 340 void AddQuickEnableApplicationLauncherWorkItems(
341 const InstallerState& installer_state, 341 const InstallerState& installer_state,
342 const InstallationState& machine_state, 342 const InstallationState& machine_state,
343 const base::FilePath& setup_path, 343 const base::FilePath& setup_path,
344 const base::Version& new_version, 344 const Version& new_version,
345 WorkItemList* work_item_list) { 345 WorkItemList* work_item_list) {
346 DCHECK(work_item_list); 346 DCHECK(work_item_list);
347 347
348 bool will_have_chrome_binaries = 348 bool will_have_chrome_binaries =
349 WillProductBePresentAfterSetup(installer_state, machine_state, 349 WillProductBePresentAfterSetup(installer_state, machine_state,
350 BrowserDistribution::CHROME_BINARIES); 350 BrowserDistribution::CHROME_BINARIES);
351 351
352 // For system-level binaries there is no way to keep the command state in sync 352 // For system-level binaries there is no way to keep the command state in sync
353 // with the installation/uninstallation of the Application Launcher (which is 353 // with the installation/uninstallation of the Application Launcher (which is
354 // always at user-level). So we do not try to remove the command, i.e., it 354 // always at user-level). So we do not try to remove the command, i.e., it
(...skipping 14 matching lines...) Expand all
369 cmd.set_sends_pings(true); 369 cmd.set_sends_pings(true);
370 cmd.set_is_web_accessible(true); 370 cmd.set_is_web_accessible(true);
371 cmd.set_is_run_as_user(true); 371 cmd.set_is_run_as_user(true);
372 cmd.AddWorkItems(installer_state.root_key(), cmd_key, work_item_list); 372 cmd.AddWorkItems(installer_state.root_key(), cmd_key, work_item_list);
373 } 373 }
374 } 374 }
375 375
376 void AddProductSpecificWorkItems(const InstallationState& original_state, 376 void AddProductSpecificWorkItems(const InstallationState& original_state,
377 const InstallerState& installer_state, 377 const InstallerState& installer_state,
378 const base::FilePath& setup_path, 378 const base::FilePath& setup_path,
379 const base::Version& new_version, 379 const Version& new_version,
380 WorkItemList* list) { 380 WorkItemList* list) {
381 const Products& products = installer_state.products(); 381 const Products& products = installer_state.products();
382 for (Products::const_iterator it = products.begin(); it < products.end(); 382 for (Products::const_iterator it = products.begin(); it < products.end();
383 ++it) { 383 ++it) {
384 const Product& p = **it; 384 const Product& p = **it;
385 if (p.is_chrome_app_host()) { 385 if (p.is_chrome_app_host()) {
386 AddInstallAppCommandWorkItems(installer_state, original_state, 386 AddInstallAppCommandWorkItems(installer_state, original_state,
387 new_version, p, list); 387 new_version, p, list);
388 } 388 }
389 if (p.is_chrome()) { 389 if (p.is_chrome()) {
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 } 450 }
451 451
452 // Adds Chrome specific install work items to |install_list|. 452 // Adds Chrome specific install work items to |install_list|.
453 // |current_version| can be NULL to indicate no Chrome is currently installed. 453 // |current_version| can be NULL to indicate no Chrome is currently installed.
454 void AddChromeWorkItems(const InstallationState& original_state, 454 void AddChromeWorkItems(const InstallationState& original_state,
455 const InstallerState& installer_state, 455 const InstallerState& installer_state,
456 const base::FilePath& setup_path, 456 const base::FilePath& setup_path,
457 const base::FilePath& archive_path, 457 const base::FilePath& archive_path,
458 const base::FilePath& src_path, 458 const base::FilePath& src_path,
459 const base::FilePath& temp_path, 459 const base::FilePath& temp_path,
460 const base::Version* current_version, 460 const Version* current_version,
461 const base::Version& new_version, 461 const Version& new_version,
462 WorkItemList* install_list) { 462 WorkItemList* install_list) {
463 const base::FilePath& target_path = installer_state.target_path(); 463 const base::FilePath& target_path = installer_state.target_path();
464 464
465 if (current_version) { 465 if (current_version) {
466 // Delete the archive from an existing install to save some disk space. We 466 // Delete the archive from an existing install to save some disk space. We
467 // make this an unconditional work item since there's no need to roll this 467 // make this an unconditional work item since there's no need to roll this
468 // back; if installation fails we'll be moved to the "-full" channel anyway. 468 // back; if installation fails we'll be moved to the "-full" channel anyway.
469 base::FilePath old_installer_dir( 469 base::FilePath old_installer_dir(
470 installer_state.GetInstallerDirectory(*current_version)); 470 installer_state.GetInstallerDirectory(*current_version));
471 base::FilePath old_archive( 471 base::FilePath old_archive(
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 } 654 }
655 } 655 }
656 656
657 } // namespace 657 } // namespace
658 658
659 // This method adds work items to create (or update) Chrome uninstall entry in 659 // This method adds work items to create (or update) Chrome uninstall entry in
660 // either the Control Panel->Add/Remove Programs list or in the Omaha client 660 // either the Control Panel->Add/Remove Programs list or in the Omaha client
661 // state key if running under an MSI installer. 661 // state key if running under an MSI installer.
662 void AddUninstallShortcutWorkItems(const InstallerState& installer_state, 662 void AddUninstallShortcutWorkItems(const InstallerState& installer_state,
663 const base::FilePath& setup_path, 663 const base::FilePath& setup_path,
664 const base::Version& new_version, 664 const Version& new_version,
665 const Product& product, 665 const Product& product,
666 WorkItemList* install_list) { 666 WorkItemList* install_list) {
667 HKEY reg_root = installer_state.root_key(); 667 HKEY reg_root = installer_state.root_key();
668 BrowserDistribution* browser_dist = product.distribution(); 668 BrowserDistribution* browser_dist = product.distribution();
669 DCHECK(browser_dist); 669 DCHECK(browser_dist);
670 670
671 // When we are installed via an MSI, we need to store our uninstall strings 671 // When we are installed via an MSI, we need to store our uninstall strings
672 // in the Google Update client state key. We do this even for non-MSI 672 // in the Google Update client state key. We do this even for non-MSI
673 // managed installs to avoid breaking the edge case whereby an MSI-managed 673 // managed installs to avoid breaking the edge case whereby an MSI-managed
674 // install is updated by a non-msi installer (which would confuse the MSI 674 // install is updated by a non-msi installer (which would confuse the MSI
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg, 752 install_list->AddSetRegValueWorkItem(reg_root, uninstall_reg,
753 L"VersionMinor", static_cast<DWORD>(version_components[3]), true); 753 L"VersionMinor", static_cast<DWORD>(version_components[3]), true);
754 } 754 }
755 } 755 }
756 } 756 }
757 757
758 // Create Version key for a product (if not already present) and sets the new 758 // Create Version key for a product (if not already present) and sets the new
759 // product version as the last step. 759 // product version as the last step.
760 void AddVersionKeyWorkItems(HKEY root, 760 void AddVersionKeyWorkItems(HKEY root,
761 BrowserDistribution* dist, 761 BrowserDistribution* dist,
762 const base::Version& new_version, 762 const Version& new_version,
763 bool add_language_identifier, 763 bool add_language_identifier,
764 WorkItemList* list) { 764 WorkItemList* list) {
765 // Create Version key for each distribution (if not already present) and set 765 // Create Version key for each distribution (if not already present) and set
766 // the new product version as the last step. 766 // the new product version as the last step.
767 base::string16 version_key(dist->GetVersionKey()); 767 base::string16 version_key(dist->GetVersionKey());
768 list->AddCreateRegKeyWorkItem(root, version_key); 768 list->AddCreateRegKeyWorkItem(root, version_key);
769 769
770 base::string16 product_name(dist->GetDisplayName()); 770 base::string16 product_name(dist->GetDisplayName());
771 list->AddSetRegValueWorkItem(root, version_key, google_update::kRegNameField, 771 list->AddSetRegValueWorkItem(root, version_key, google_update::kRegNameField,
772 product_name, true); // overwrite name also 772 product_name, true); // overwrite name also
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
998 google_update::kRegUsageStatsField); 998 google_update::kRegUsageStatsField);
999 } 999 }
1000 install_list->AddDeleteRegValueWorkItem( 1000 install_list->AddDeleteRegValueWorkItem(
1001 root_key, dist->GetStateKey(), google_update::kRegUsageStatsField); 1001 root_key, dist->GetStateKey(), google_update::kRegUsageStatsField);
1002 } 1002 }
1003 } 1003 }
1004 } 1004 }
1005 1005
1006 bool AppendPostInstallTasks(const InstallerState& installer_state, 1006 bool AppendPostInstallTasks(const InstallerState& installer_state,
1007 const base::FilePath& setup_path, 1007 const base::FilePath& setup_path,
1008 const base::Version* current_version, 1008 const Version* current_version,
1009 const base::Version& new_version, 1009 const Version& new_version,
1010 const base::FilePath& temp_path, 1010 const base::FilePath& temp_path,
1011 WorkItemList* post_install_task_list) { 1011 WorkItemList* post_install_task_list) {
1012 DCHECK(post_install_task_list); 1012 DCHECK(post_install_task_list);
1013 1013
1014 HKEY root = installer_state.root_key(); 1014 HKEY root = installer_state.root_key();
1015 const Products& products = installer_state.products(); 1015 const Products& products = installer_state.products();
1016 base::FilePath new_chrome_exe( 1016 base::FilePath new_chrome_exe(
1017 installer_state.target_path().Append(installer::kChromeNewExe)); 1017 installer_state.target_path().Append(installer::kChromeNewExe));
1018 1018
1019 // Append work items that will only be executed if this was an update. 1019 // Append work items that will only be executed if this was an update.
1020 // We update the 'opv' value with the current version that is active, 1020 // We update the 'opv' value with the current version that is active,
1021 // the 'cpv' value with the critical update version (if present), and the 1021 // the 'cpv' value with the critical update version (if present), and the
1022 // 'cmd' value with the rename command to run. 1022 // 'cmd' value with the rename command to run.
1023 { 1023 {
1024 scoped_ptr<WorkItemList> in_use_update_work_items( 1024 scoped_ptr<WorkItemList> in_use_update_work_items(
1025 WorkItem::CreateConditionalWorkItemList( 1025 WorkItem::CreateConditionalWorkItemList(
1026 new ConditionRunIfFileExists(new_chrome_exe))); 1026 new ConditionRunIfFileExists(new_chrome_exe)));
1027 in_use_update_work_items->set_log_message("InUseUpdateWorkItemList"); 1027 in_use_update_work_items->set_log_message("InUseUpdateWorkItemList");
1028 1028
1029 // |critical_version| will be valid only if this in-use update includes a 1029 // |critical_version| will be valid only if this in-use update includes a
1030 // version considered critical relative to the version being updated. 1030 // version considered critical relative to the version being updated.
1031 base::Version critical_version(installer_state.DetermineCriticalVersion( 1031 Version critical_version(installer_state.DetermineCriticalVersion(
1032 current_version, new_version)); 1032 current_version, new_version));
1033 base::FilePath installer_path( 1033 base::FilePath installer_path(
1034 installer_state.GetInstallerDirectory(new_version).Append( 1034 installer_state.GetInstallerDirectory(new_version).Append(
1035 setup_path.BaseName())); 1035 setup_path.BaseName()));
1036 1036
1037 CommandLine rename(installer_path); 1037 CommandLine rename(installer_path);
1038 rename.AppendSwitch(switches::kRenameChromeExe); 1038 rename.AppendSwitch(switches::kRenameChromeExe);
1039 if (installer_state.system_install()) 1039 if (installer_state.system_install())
1040 rename.AppendSwitch(switches::kSystemLevel); 1040 rename.AppendSwitch(switches::kSystemLevel);
1041 1041
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
1125 1125
1126 return true; 1126 return true;
1127 } 1127 }
1128 1128
1129 void AddInstallWorkItems(const InstallationState& original_state, 1129 void AddInstallWorkItems(const InstallationState& original_state,
1130 const InstallerState& installer_state, 1130 const InstallerState& installer_state,
1131 const base::FilePath& setup_path, 1131 const base::FilePath& setup_path,
1132 const base::FilePath& archive_path, 1132 const base::FilePath& archive_path,
1133 const base::FilePath& src_path, 1133 const base::FilePath& src_path,
1134 const base::FilePath& temp_path, 1134 const base::FilePath& temp_path,
1135 const base::Version* current_version, 1135 const Version* current_version,
1136 const base::Version& new_version, 1136 const Version& new_version,
1137 WorkItemList* install_list) { 1137 WorkItemList* install_list) {
1138 DCHECK(install_list); 1138 DCHECK(install_list);
1139 1139
1140 const base::FilePath& target_path = installer_state.target_path(); 1140 const base::FilePath& target_path = installer_state.target_path();
1141 1141
1142 // A temp directory that work items need and the actual install directory. 1142 // A temp directory that work items need and the actual install directory.
1143 install_list->AddCreateDirWorkItem(temp_path); 1143 install_list->AddCreateDirWorkItem(temp_path);
1144 install_list->AddCreateDirWorkItem(target_path); 1144 install_list->AddCreateDirWorkItem(target_path);
1145 1145
1146 if (installer_state.FindProduct(BrowserDistribution::CHROME_BROWSER) || 1146 if (installer_state.FindProduct(BrowserDistribution::CHROME_BROWSER) ||
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
1254 WorkItem* set_msi_work_item = work_item_list->AddSetRegValueWorkItem( 1254 WorkItem* set_msi_work_item = work_item_list->AddSetRegValueWorkItem(
1255 installer_state.root_key(), dist->GetStateKey(), 1255 installer_state.root_key(), dist->GetStateKey(),
1256 google_update::kRegMSIField, msi_value, true); 1256 google_update::kRegMSIField, msi_value, true);
1257 DCHECK(set_msi_work_item); 1257 DCHECK(set_msi_work_item);
1258 set_msi_work_item->set_ignore_failure(true); 1258 set_msi_work_item->set_ignore_failure(true);
1259 set_msi_work_item->set_log_message("Could not write MSI marker!"); 1259 set_msi_work_item->set_log_message("Could not write MSI marker!");
1260 } 1260 }
1261 1261
1262 void AddDelegateExecuteWorkItems(const InstallerState& installer_state, 1262 void AddDelegateExecuteWorkItems(const InstallerState& installer_state,
1263 const base::FilePath& target_path, 1263 const base::FilePath& target_path,
1264 const base::Version& new_version, 1264 const Version& new_version,
1265 const Product& product, 1265 const Product& product,
1266 WorkItemList* list) { 1266 WorkItemList* list) {
1267 base::string16 handler_class_uuid; 1267 base::string16 handler_class_uuid;
1268 BrowserDistribution* dist = product.distribution(); 1268 BrowserDistribution* dist = product.distribution();
1269 if (!dist->GetCommandExecuteImplClsid(&handler_class_uuid)) { 1269 if (!dist->GetCommandExecuteImplClsid(&handler_class_uuid)) {
1270 if (InstallUtil::IsChromeSxSProcess()) { 1270 if (InstallUtil::IsChromeSxSProcess()) {
1271 CleanupBadCanaryDelegateExecuteRegistration(target_path, list); 1271 CleanupBadCanaryDelegateExecuteRegistration(target_path, list);
1272 } else { 1272 } else {
1273 VLOG(1) << "No DelegateExecute verb handler processing to do for " 1273 VLOG(1) << "No DelegateExecute verb handler processing to do for "
1274 << dist->GetDisplayName(); 1274 << dist->GetDisplayName();
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
1316 list->AddSetRegValueWorkItem(root, subkey, L"ServerExecutable", 1316 list->AddSetRegValueWorkItem(root, subkey, L"ServerExecutable",
1317 delegate_execute.value(), true); 1317 delegate_execute.value(), true);
1318 1318
1319 subkey.assign(delegate_execute_path).append(L"\\Programmable"); 1319 subkey.assign(delegate_execute_path).append(L"\\Programmable");
1320 list->AddCreateRegKeyWorkItem(root, subkey); 1320 list->AddCreateRegKeyWorkItem(root, subkey);
1321 } 1321 }
1322 } 1322 }
1323 1323
1324 void AddActiveSetupWorkItems(const InstallerState& installer_state, 1324 void AddActiveSetupWorkItems(const InstallerState& installer_state,
1325 const base::FilePath& setup_path, 1325 const base::FilePath& setup_path,
1326 const base::Version& new_version, 1326 const Version& new_version,
1327 const Product& product, 1327 const Product& product,
1328 WorkItemList* list) { 1328 WorkItemList* list) {
1329 DCHECK(installer_state.operation() != InstallerState::UNINSTALL); 1329 DCHECK(installer_state.operation() != InstallerState::UNINSTALL);
1330 BrowserDistribution* dist = product.distribution(); 1330 BrowserDistribution* dist = product.distribution();
1331 1331
1332 if (!product.is_chrome() || !installer_state.system_install()) { 1332 if (!product.is_chrome() || !installer_state.system_install()) {
1333 const char* install_level = 1333 const char* install_level =
1334 installer_state.system_install() ? "system" : "user"; 1334 installer_state.system_install() ? "system" : "user";
1335 VLOG(1) << "No Active Setup processing to do for " << install_level 1335 VLOG(1) << "No Active Setup processing to do for " << install_level
1336 << "-level " << dist->GetDisplayName(); 1336 << "-level " << dist->GetDisplayName();
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
1412 } 1412 }
1413 1413
1414 FreeLibrary(ieframe); 1414 FreeLibrary(ieframe);
1415 } else { 1415 } else {
1416 VLOG(1) << "Cannot load " << kIEFrameDll; 1416 VLOG(1) << "Cannot load " << kIEFrameDll;
1417 } 1417 }
1418 } 1418 }
1419 1419
1420 void AddOsUpgradeWorkItems(const InstallerState& installer_state, 1420 void AddOsUpgradeWorkItems(const InstallerState& installer_state,
1421 const base::FilePath& setup_path, 1421 const base::FilePath& setup_path,
1422 const base::Version& new_version, 1422 const Version& new_version,
1423 const Product& product, 1423 const Product& product,
1424 WorkItemList* install_list) { 1424 WorkItemList* install_list) {
1425 const HKEY root_key = installer_state.root_key(); 1425 const HKEY root_key = installer_state.root_key();
1426 base::string16 cmd_key( 1426 base::string16 cmd_key(
1427 GetRegCommandKey(product.distribution(), kCmdOnOsUpgrade)); 1427 GetRegCommandKey(product.distribution(), kCmdOnOsUpgrade));
1428 1428
1429 if (installer_state.operation() == InstallerState::UNINSTALL) { 1429 if (installer_state.operation() == InstallerState::UNINSTALL) {
1430 install_list->AddDeleteRegKeyWorkItem(root_key, cmd_key)-> 1430 install_list->AddDeleteRegKeyWorkItem(root_key, cmd_key)->
1431 set_log_message("Removing OS upgrade command"); 1431 set_log_message("Removing OS upgrade command");
1432 } else { 1432 } else {
(...skipping 12 matching lines...) Expand all
1445 cmd_line.AppendSwitch(installer::switches::kVerboseLogging); 1445 cmd_line.AppendSwitch(installer::switches::kVerboseLogging);
1446 1446
1447 AppCommand cmd(cmd_line.GetCommandLineString()); 1447 AppCommand cmd(cmd_line.GetCommandLineString());
1448 cmd.set_is_auto_run_on_os_upgrade(true); 1448 cmd.set_is_auto_run_on_os_upgrade(true);
1449 cmd.AddWorkItems(installer_state.root_key(), cmd_key, install_list); 1449 cmd.AddWorkItems(installer_state.root_key(), cmd_key, install_list);
1450 } 1450 }
1451 } 1451 }
1452 1452
1453 void AddQueryEULAAcceptanceWorkItems(const InstallerState& installer_state, 1453 void AddQueryEULAAcceptanceWorkItems(const InstallerState& installer_state,
1454 const base::FilePath& setup_path, 1454 const base::FilePath& setup_path,
1455 const base::Version& new_version, 1455 const Version& new_version,
1456 const Product& product, 1456 const Product& product,
1457 WorkItemList* work_item_list) { 1457 WorkItemList* work_item_list) {
1458 const HKEY root_key = installer_state.root_key(); 1458 const HKEY root_key = installer_state.root_key();
1459 base::string16 cmd_key( 1459 base::string16 cmd_key(
1460 GetRegCommandKey(product.distribution(), kCmdQueryEULAAcceptance)); 1460 GetRegCommandKey(product.distribution(), kCmdQueryEULAAcceptance));
1461 if (installer_state.operation() == InstallerState::UNINSTALL) { 1461 if (installer_state.operation() == InstallerState::UNINSTALL) {
1462 work_item_list->AddDeleteRegKeyWorkItem(root_key, cmd_key)-> 1462 work_item_list->AddDeleteRegKeyWorkItem(root_key, cmd_key)->
1463 set_log_message("Removing query EULA acceptance command"); 1463 set_log_message("Removing query EULA acceptance command");
1464 } else { 1464 } else {
1465 CommandLine cmd_line(installer_state 1465 CommandLine cmd_line(installer_state
(...skipping 23 matching lines...) Expand all
1489 // Unconditionally remove the legacy Quick Enable command from the binaries. 1489 // Unconditionally remove the legacy Quick Enable command from the binaries.
1490 // Do this even if multi-install Chrome isn't installed to ensure that it is 1490 // Do this even if multi-install Chrome isn't installed to ensure that it is
1491 // not left behind in any case. 1491 // not left behind in any case.
1492 work_item_list->AddDeleteRegKeyWorkItem( 1492 work_item_list->AddDeleteRegKeyWorkItem(
1493 installer_state.root_key(), cmd_key)->set_log_message( 1493 installer_state.root_key(), cmd_key)->set_log_message(
1494 "removing " + WideToASCII(kCmdQuickEnableCf) + " command"); 1494 "removing " + WideToASCII(kCmdQuickEnableCf) + " command");
1495 1495
1496 } 1496 }
1497 1497
1498 } // namespace installer 1498 } // namespace installer
OLDNEW
« no previous file with comments | « chrome/installer/setup/install_unittest.cc ('k') | chrome/installer/setup/install_worker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698