| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 | 667 |
| 668 installer_state.UpdateStage(installer::FINISHING); | 668 installer_state.UpdateStage(installer::FINISHING); |
| 669 | 669 |
| 670 // Only do Chrome-specific stuff (like launching the browser) if | 670 // Only do Chrome-specific stuff (like launching the browser) if |
| 671 // Chrome was specifically requested (rather than being upgraded as | 671 // Chrome was specifically requested (rather than being upgraded as |
| 672 // part of a multi-install). | 672 // part of a multi-install). |
| 673 const Product* chrome_install = prefs.install_chrome() ? | 673 const Product* chrome_install = prefs.install_chrome() ? |
| 674 installer_state.FindProduct(BrowserDistribution::CHROME_BROWSER) : | 674 installer_state.FindProduct(BrowserDistribution::CHROME_BROWSER) : |
| 675 NULL; | 675 NULL; |
| 676 | 676 |
| 677 bool value = false; | 677 bool do_not_register_for_update_launch = false; |
| 678 if (chrome_install) { | 678 if (chrome_install) { |
| 679 prefs.GetBool( | 679 prefs.GetBool( |
| 680 installer::master_preferences::kDoNotRegisterForUpdateLaunch, | 680 installer::master_preferences::kDoNotRegisterForUpdateLaunch, |
| 681 &value); | 681 &do_not_register_for_update_launch); |
| 682 } else { | 682 } else { |
| 683 value = true; // Never register. | 683 do_not_register_for_update_launch = true; // Never register. |
| 684 } | 684 } |
| 685 | 685 |
| 686 bool write_chrome_launch_string = (!value) && | 686 bool write_chrome_launch_string = |
| 687 (install_status != installer::IN_USE_UPDATED); | 687 (!do_not_register_for_update_launch && |
| 688 install_status != installer::IN_USE_UPDATED); |
| 688 | 689 |
| 689 installer_state.WriteInstallerResult(install_status, install_msg_base, | 690 installer_state.WriteInstallerResult(install_status, install_msg_base, |
| 690 write_chrome_launch_string ? &chrome_exe : NULL); | 691 write_chrome_launch_string ? &chrome_exe : NULL); |
| 691 | 692 |
| 692 if (install_status == installer::FIRST_INSTALL_SUCCESS) { | 693 if (install_status == installer::FIRST_INSTALL_SUCCESS) { |
| 693 VLOG(1) << "First install successful."; | 694 VLOG(1) << "First install successful."; |
| 694 if (chrome_install) { | 695 if (chrome_install) { |
| 695 // We never want to launch Chrome in system level install mode. | 696 // We never want to launch Chrome in system level install mode. |
| 696 bool do_not_launch_chrome = false; | 697 bool do_not_launch_chrome = false; |
| 697 prefs.GetBool( | 698 prefs.GetBool( |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 817 | 818 |
| 818 installer::InstallStatus ShowEULADialog(const std::wstring& inner_frame) { | 819 installer::InstallStatus ShowEULADialog(const std::wstring& inner_frame) { |
| 819 VLOG(1) << "About to show EULA"; | 820 VLOG(1) << "About to show EULA"; |
| 820 std::wstring eula_path = installer::GetLocalizedEulaResource(); | 821 std::wstring eula_path = installer::GetLocalizedEulaResource(); |
| 821 if (eula_path.empty()) { | 822 if (eula_path.empty()) { |
| 822 LOG(ERROR) << "No EULA path available"; | 823 LOG(ERROR) << "No EULA path available"; |
| 823 return installer::EULA_REJECTED; | 824 return installer::EULA_REJECTED; |
| 824 } | 825 } |
| 825 // Newer versions of the caller pass an inner frame parameter that must | 826 // Newer versions of the caller pass an inner frame parameter that must |
| 826 // be given to the html page being launched. | 827 // be given to the html page being launched. |
| 827 if (!inner_frame.empty()) { | 828 installer::EulaHTMLDialog dlg(eula_path, inner_frame); |
| 828 eula_path += L"?innerframe="; | |
| 829 eula_path += inner_frame; | |
| 830 } | |
| 831 installer::EulaHTMLDialog dlg(eula_path); | |
| 832 installer::EulaHTMLDialog::Outcome outcome = dlg.ShowModal(); | 829 installer::EulaHTMLDialog::Outcome outcome = dlg.ShowModal(); |
| 833 if (installer::EulaHTMLDialog::REJECTED == outcome) { | 830 if (installer::EulaHTMLDialog::REJECTED == outcome) { |
| 834 LOG(ERROR) << "EULA rejected or EULA failure"; | 831 LOG(ERROR) << "EULA rejected or EULA failure"; |
| 835 return installer::EULA_REJECTED; | 832 return installer::EULA_REJECTED; |
| 836 } | 833 } |
| 837 if (installer::EulaHTMLDialog::ACCEPTED_OPT_IN == outcome) { | 834 if (installer::EulaHTMLDialog::ACCEPTED_OPT_IN == outcome) { |
| 838 VLOG(1) << "EULA accepted (opt-in)"; | 835 VLOG(1) << "EULA accepted (opt-in)"; |
| 839 return installer::EULA_ACCEPTED_OPT_IN; | 836 return installer::EULA_ACCEPTED_OPT_IN; |
| 840 } | 837 } |
| 841 VLOG(1) << "EULA accepted (no opt-in)"; | 838 VLOG(1) << "EULA accepted (no opt-in)"; |
| (...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1309 if (!(installer_state.is_msi() && is_uninstall)) | 1306 if (!(installer_state.is_msi() && is_uninstall)) |
| 1310 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT | 1307 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT |
| 1311 // to pass through, since this is only returned on uninstall which is | 1308 // to pass through, since this is only returned on uninstall which is |
| 1312 // never invoked directly by Google Update. | 1309 // never invoked directly by Google Update. |
| 1313 return_code = InstallUtil::GetInstallReturnCode(install_status); | 1310 return_code = InstallUtil::GetInstallReturnCode(install_status); |
| 1314 | 1311 |
| 1315 VLOG(1) << "Installation complete, returning: " << return_code; | 1312 VLOG(1) << "Installation complete, returning: " << return_code; |
| 1316 | 1313 |
| 1317 return return_code; | 1314 return return_code; |
| 1318 } | 1315 } |
| OLD | NEW |