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