| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include <windows.h> | 5 #include <windows.h> |
| 6 #include <msi.h> | 6 #include <msi.h> |
| 7 #include <shellapi.h> | 7 #include <shellapi.h> |
| 8 #include <shlobj.h> | 8 #include <shlobj.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 697 } | 697 } |
| 698 | 698 |
| 699 private: | 699 private: |
| 700 bool initialized_; | 700 bool initialized_; |
| 701 }; | 701 }; |
| 702 | 702 |
| 703 bool PopulateInstallations(const MasterPreferences& prefs, | 703 bool PopulateInstallations(const MasterPreferences& prefs, |
| 704 ProductPackageMapping* installations) { | 704 ProductPackageMapping* installations) { |
| 705 DCHECK(installations); | 705 DCHECK(installations); |
| 706 bool success = true; | 706 bool success = true; |
| 707 if (prefs.install_chrome()) { | 707 |
| 708 bool implicit_chrome_install = false; |
| 709 bool implicit_gcf_install = false; |
| 710 |
| 711 if (prefs.is_multi_install()) { |
| 712 // See what products are already installed in multi mode. |
| 713 // When we do multi installs, we must upgrade all installations |
| 714 // in sync since they share the binaries. |
| 715 struct CheckInstall { |
| 716 bool* installed; |
| 717 BrowserDistribution::Type type; |
| 718 } product_checks[] = { |
| 719 {&implicit_chrome_install, BrowserDistribution::CHROME_BROWSER}, |
| 720 {&implicit_gcf_install, BrowserDistribution::CHROME_FRAME}, |
| 721 }; |
| 722 |
| 723 for (size_t i = 0; i < arraysize(product_checks); ++i) { |
| 724 BrowserDistribution* dist = BrowserDistribution::GetSpecificDistribution( |
| 725 product_checks[i].type, prefs); |
| 726 *product_checks[i].installed = installer::IsInstalledAsMulti( |
| 727 installations->system_level(), dist); |
| 728 LOG_IF(INFO, *product_checks[i].installed) |
| 729 << "Product already installed and must be included: " |
| 730 << dist->GetApplicationName(); |
| 731 } |
| 732 } |
| 733 |
| 734 if (prefs.install_chrome() || implicit_chrome_install) { |
| 708 VLOG(1) << "Install distribution: Chrome"; | 735 VLOG(1) << "Install distribution: Chrome"; |
| 709 success = installations->AddDistribution( | 736 success = installations->AddDistribution( |
| 710 BrowserDistribution::CHROME_BROWSER, prefs); | 737 BrowserDistribution::CHROME_BROWSER, prefs); |
| 711 } | 738 } |
| 712 | 739 |
| 713 if (success && prefs.install_chrome_frame()) { | 740 if (success && (prefs.install_chrome_frame() || implicit_gcf_install)) { |
| 714 VLOG(1) << "Install distribution: Chrome Frame"; | 741 VLOG(1) << "Install distribution: Chrome Frame"; |
| 715 success = installations->AddDistribution( | 742 success = installations->AddDistribution( |
| 716 BrowserDistribution::CHROME_FRAME, prefs); | 743 BrowserDistribution::CHROME_FRAME, prefs); |
| 717 } | 744 } |
| 718 return success; | 745 return success; |
| 719 } | 746 } |
| 720 | 747 |
| 721 // Returns the Custom information for the client identified by the exe path | 748 // Returns the Custom information for the client identified by the exe path |
| 722 // passed in. This information is used for crash reporting. | 749 // passed in. This information is used for crash reporting. |
| 723 google_breakpad::CustomClientInfo* GetCustomInfo(const wchar_t* exe_path) { | 750 google_breakpad::CustomClientInfo* GetCustomInfo(const wchar_t* exe_path) { |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 928 // to pass through, since this is only returned on uninstall which is | 955 // to pass through, since this is only returned on uninstall which is |
| 929 // never invoked directly by Google Update. | 956 // never invoked directly by Google Update. |
| 930 return_code = InstallUtil::GetInstallReturnCode(install_status); | 957 return_code = InstallUtil::GetInstallReturnCode(install_status); |
| 931 } | 958 } |
| 932 } | 959 } |
| 933 | 960 |
| 934 VLOG(1) << "Installation complete, returning: " << return_code; | 961 VLOG(1) << "Installation complete, returning: " << return_code; |
| 935 | 962 |
| 936 return return_code; | 963 return return_code; |
| 937 } | 964 } |
| OLD | NEW |