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 #include "chrome/installer/setup/setup_main.h" | 5 #include "chrome/installer/setup/setup_main.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <msi.h> | 8 #include <msi.h> |
9 #include <shellapi.h> | 9 #include <shellapi.h> |
10 #include <shlobj.h> | 10 #include <shlobj.h> |
(...skipping 27 matching lines...) Expand all Loading... |
38 #include "base/win/scoped_handle.h" | 38 #include "base/win/scoped_handle.h" |
39 #include "base/win/win_util.h" | 39 #include "base/win/win_util.h" |
40 #include "base/win/windows_version.h" | 40 #include "base/win/windows_version.h" |
41 #include "chrome/common/chrome_constants.h" | 41 #include "chrome/common/chrome_constants.h" |
42 #include "chrome/common/chrome_paths.h" | 42 #include "chrome/common/chrome_paths.h" |
43 #include "chrome/common/chrome_switches.h" | 43 #include "chrome/common/chrome_switches.h" |
44 #include "chrome/installer/setup/archive_patch_helper.h" | 44 #include "chrome/installer/setup/archive_patch_helper.h" |
45 #include "chrome/installer/setup/install.h" | 45 #include "chrome/installer/setup/install.h" |
46 #include "chrome/installer/setup/install_worker.h" | 46 #include "chrome/installer/setup/install_worker.h" |
47 #include "chrome/installer/setup/installer_crash_reporting.h" | 47 #include "chrome/installer/setup/installer_crash_reporting.h" |
| 48 #include "chrome/installer/setup/installer_metrics.h" |
48 #include "chrome/installer/setup/setup_constants.h" | 49 #include "chrome/installer/setup/setup_constants.h" |
49 #include "chrome/installer/setup/setup_util.h" | 50 #include "chrome/installer/setup/setup_util.h" |
50 #include "chrome/installer/setup/uninstall.h" | 51 #include "chrome/installer/setup/uninstall.h" |
51 #include "chrome/installer/util/browser_distribution.h" | 52 #include "chrome/installer/util/browser_distribution.h" |
52 #include "chrome/installer/util/delete_after_reboot_helper.h" | 53 #include "chrome/installer/util/delete_after_reboot_helper.h" |
53 #include "chrome/installer/util/delete_tree_work_item.h" | 54 #include "chrome/installer/util/delete_tree_work_item.h" |
54 #include "chrome/installer/util/google_update_constants.h" | 55 #include "chrome/installer/util/google_update_constants.h" |
55 #include "chrome/installer/util/google_update_settings.h" | 56 #include "chrome/installer/util/google_update_settings.h" |
56 #include "chrome/installer/util/google_update_util.h" | 57 #include "chrome/installer/util/google_update_util.h" |
57 #include "chrome/installer/util/helper.h" | 58 #include "chrome/installer/util/helper.h" |
58 #include "chrome/installer/util/html_dialog.h" | 59 #include "chrome/installer/util/html_dialog.h" |
59 #include "chrome/installer/util/install_util.h" | 60 #include "chrome/installer/util/install_util.h" |
60 #include "chrome/installer/util/installation_state.h" | 61 #include "chrome/installer/util/installation_state.h" |
61 #include "chrome/installer/util/installation_validator.h" | 62 #include "chrome/installer/util/installation_validator.h" |
62 #include "chrome/installer/util/installer_state.h" | 63 #include "chrome/installer/util/installer_state.h" |
63 #include "chrome/installer/util/installer_util_strings.h" | 64 #include "chrome/installer/util/installer_util_strings.h" |
64 #include "chrome/installer/util/l10n_string_util.h" | 65 #include "chrome/installer/util/l10n_string_util.h" |
65 #include "chrome/installer/util/logging_installer.h" | 66 #include "chrome/installer/util/logging_installer.h" |
66 #include "chrome/installer/util/lzma_util.h" | 67 #include "chrome/installer/util/lzma_util.h" |
67 #include "chrome/installer/util/master_preferences.h" | 68 #include "chrome/installer/util/master_preferences.h" |
68 #include "chrome/installer/util/master_preferences_constants.h" | 69 #include "chrome/installer/util/master_preferences_constants.h" |
69 #include "chrome/installer/util/self_cleaning_temp_dir.h" | 70 #include "chrome/installer/util/self_cleaning_temp_dir.h" |
70 #include "chrome/installer/util/shell_util.h" | 71 #include "chrome/installer/util/shell_util.h" |
71 #include "chrome/installer/util/user_experiment.h" | 72 #include "chrome/installer/util/user_experiment.h" |
| 73 #include "chrome/installer/util/util_constants.h" |
72 #include "components/crash/content/app/crash_switches.h" | 74 #include "components/crash/content/app/crash_switches.h" |
73 #include "components/crash/content/app/run_as_crashpad_handler_win.h" | 75 #include "components/crash/content/app/run_as_crashpad_handler_win.h" |
74 #include "content/public/common/content_switches.h" | 76 #include "content/public/common/content_switches.h" |
75 | 77 |
76 #if defined(GOOGLE_CHROME_BUILD) | 78 #if defined(GOOGLE_CHROME_BUILD) |
77 #include "chrome/installer/util/updating_app_registration_data.h" | 79 #include "chrome/installer/util/updating_app_registration_data.h" |
78 #endif | 80 #endif |
79 | 81 |
80 using installer::InstallerState; | 82 using installer::InstallerState; |
81 using installer::InstallationState; | 83 using installer::InstallationState; |
(...skipping 1535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1617 } // namespace installer | 1619 } // namespace installer |
1618 | 1620 |
1619 int WINAPI wWinMain(HINSTANCE instance, HINSTANCE prev_instance, | 1621 int WINAPI wWinMain(HINSTANCE instance, HINSTANCE prev_instance, |
1620 wchar_t* command_line, int show_command) { | 1622 wchar_t* command_line, int show_command) { |
1621 // Check to see if the CPU is supported before doing anything else. There's | 1623 // Check to see if the CPU is supported before doing anything else. There's |
1622 // very little than can safely be accomplished if the CPU isn't supported | 1624 // very little than can safely be accomplished if the CPU isn't supported |
1623 // since dependent libraries (e.g., base) may use invalid instructions. | 1625 // since dependent libraries (e.g., base) may use invalid instructions. |
1624 if (!installer::IsProcessorSupported()) | 1626 if (!installer::IsProcessorSupported()) |
1625 return installer::CPU_NOT_SUPPORTED; | 1627 return installer::CPU_NOT_SUPPORTED; |
1626 | 1628 |
| 1629 // Persist histograms so they can be uploaded later. |
| 1630 installer::BeginPersistentHistogramStorage(); |
| 1631 |
1627 // The exit manager is in charge of calling the dtors of singletons. | 1632 // The exit manager is in charge of calling the dtors of singletons. |
1628 base::AtExitManager exit_manager; | 1633 base::AtExitManager exit_manager; |
1629 base::CommandLine::Init(0, NULL); | 1634 base::CommandLine::Init(0, NULL); |
1630 | 1635 |
1631 std::string process_type = | 1636 std::string process_type = |
1632 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 1637 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
1633 switches::kProcessType); | 1638 switches::kProcessType); |
1634 | 1639 |
1635 if (process_type == crash_reporter::switches::kCrashpadHandler) { | 1640 if (process_type == crash_reporter::switches::kCrashpadHandler) { |
1636 return crash_reporter::RunAsCrashpadHandler( | 1641 return crash_reporter::RunAsCrashpadHandler( |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1775 // MSI demands that custom actions always return 0 (ERROR_SUCCESS) or it will | 1780 // MSI demands that custom actions always return 0 (ERROR_SUCCESS) or it will |
1776 // rollback the action. If we're uninstalling we want to avoid this, so always | 1781 // rollback the action. If we're uninstalling we want to avoid this, so always |
1777 // report success, squashing any more informative return codes. | 1782 // report success, squashing any more informative return codes. |
1778 if (!(installer_state.is_msi() && is_uninstall)) { | 1783 if (!(installer_state.is_msi() && is_uninstall)) { |
1779 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT | 1784 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT |
1780 // to pass through, since this is only returned on uninstall which is | 1785 // to pass through, since this is only returned on uninstall which is |
1781 // never invoked directly by Google Update. | 1786 // never invoked directly by Google Update. |
1782 return_code = InstallUtil::GetInstallReturnCode(install_status); | 1787 return_code = InstallUtil::GetInstallReturnCode(install_status); |
1783 } | 1788 } |
1784 | 1789 |
| 1790 installer::EndPersistentHistogramStorage(installer_state.target_path()); |
1785 VLOG(1) << "Installation complete, returning: " << return_code; | 1791 VLOG(1) << "Installation complete, returning: " << return_code; |
1786 | 1792 |
1787 return return_code; | 1793 return return_code; |
1788 } | 1794 } |
OLD | NEW |