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

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

Issue 1387963006: Adding error handlers to setup.exe (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix lint errors/warnings Created 5 years, 2 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
« no previous file with comments | « chrome/chrome_exe.gypi ('k') | chrome/nacl/DEPS » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #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>
11 11
12 #include <string> 12 #include <string>
13 13
14 #include "base/at_exit.h" 14 #include "base/at_exit.h"
15 #include "base/basictypes.h" 15 #include "base/basictypes.h"
16 #include "base/command_line.h" 16 #include "base/command_line.h"
17 #include "base/file_version_info.h" 17 #include "base/file_version_info.h"
18 #include "base/files/file_path.h" 18 #include "base/files/file_path.h"
19 #include "base/files/file_util.h" 19 #include "base/files/file_util.h"
20 #include "base/files/scoped_temp_dir.h" 20 #include "base/files/scoped_temp_dir.h"
21 #include "base/memory/scoped_ptr.h" 21 #include "base/memory/scoped_ptr.h"
22 #include "base/path_service.h" 22 #include "base/path_service.h"
23 #include "base/process/launch.h" 23 #include "base/process/launch.h"
24 #include "base/process/memory.h"
24 #include "base/strings/string16.h" 25 #include "base/strings/string16.h"
25 #include "base/strings/string_number_conversions.h" 26 #include "base/strings/string_number_conversions.h"
26 #include "base/strings/string_util.h" 27 #include "base/strings/string_util.h"
27 #include "base/strings/stringprintf.h" 28 #include "base/strings/stringprintf.h"
28 #include "base/strings/utf_string_conversions.h" 29 #include "base/strings/utf_string_conversions.h"
29 #include "base/values.h" 30 #include "base/values.h"
30 #include "base/version.h" 31 #include "base/version.h"
32 #include "base/win/process_startup_helper.h"
31 #include "base/win/registry.h" 33 #include "base/win/registry.h"
32 #include "base/win/scoped_com_initializer.h" 34 #include "base/win/scoped_com_initializer.h"
33 #include "base/win/scoped_comptr.h" 35 #include "base/win/scoped_comptr.h"
34 #include "base/win/scoped_handle.h" 36 #include "base/win/scoped_handle.h"
35 #include "base/win/win_util.h" 37 #include "base/win/win_util.h"
36 #include "base/win/windows_version.h" 38 #include "base/win/windows_version.h"
37 #include "breakpad/src/client/windows/handler/exception_handler.h" 39 #include "breakpad/src/client/windows/handler/exception_handler.h"
38 #include "chrome/common/chrome_constants.h" 40 #include "chrome/common/chrome_constants.h"
39 #include "chrome/common/chrome_paths.h" 41 #include "chrome/common/chrome_paths.h"
40 #include "chrome/common/chrome_switches.h" 42 #include "chrome/common/chrome_switches.h"
(...skipping 1710 matching lines...) Expand 10 before | Expand all | Expand 10 after
1751 VLOG(1) << "Command Line: " << cmd_line.GetCommandLineString(); 1753 VLOG(1) << "Command Line: " << cmd_line.GetCommandLineString();
1752 1754
1753 VLOG(1) << "multi install is " << prefs.is_multi_install(); 1755 VLOG(1) << "multi install is " << prefs.is_multi_install();
1754 bool system_install = false; 1756 bool system_install = false;
1755 prefs.GetBool(installer::master_preferences::kSystemLevel, &system_install); 1757 prefs.GetBool(installer::master_preferences::kSystemLevel, &system_install);
1756 VLOG(1) << "system install is " << system_install; 1758 VLOG(1) << "system install is " << system_install;
1757 1759
1758 scoped_ptr<google_breakpad::ExceptionHandler> breakpad( 1760 scoped_ptr<google_breakpad::ExceptionHandler> breakpad(
1759 InitializeCrashReporting(system_install)); 1761 InitializeCrashReporting(system_install));
1760 1762
1763 // Make sure the process exits cleanly on unexpected errors.
1764 base::EnableTerminationOnHeapCorruption();
1765 base::EnableTerminationOnOutOfMemory();
1766 base::win::RegisterInvalidParamHandler();
1767 base::win::SetupCRT(cmd_line);
1768
1761 InstallationState original_state; 1769 InstallationState original_state;
1762 original_state.Initialize(); 1770 original_state.Initialize();
1763 1771
1764 InstallerState installer_state; 1772 InstallerState installer_state;
1765 installer_state.Initialize(cmd_line, prefs, original_state); 1773 installer_state.Initialize(cmd_line, prefs, original_state);
1766 const bool is_uninstall = cmd_line.HasSwitch(installer::switches::kUninstall); 1774 const bool is_uninstall = cmd_line.HasSwitch(installer::switches::kUninstall);
1767 1775
1768 // Check to make sure current system is WinXP or later. If not, log 1776 // Check to make sure current system is WinXP or later. If not, log
1769 // error message and get out. 1777 // error message and get out.
1770 if (!InstallUtil::IsOSSupported()) { 1778 if (!InstallUtil::IsOSSupported()) {
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
1875 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT 1883 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT
1876 // to pass through, since this is only returned on uninstall which is 1884 // to pass through, since this is only returned on uninstall which is
1877 // never invoked directly by Google Update. 1885 // never invoked directly by Google Update.
1878 return_code = InstallUtil::GetInstallReturnCode(install_status); 1886 return_code = InstallUtil::GetInstallReturnCode(install_status);
1879 } 1887 }
1880 1888
1881 VLOG(1) << "Installation complete, returning: " << return_code; 1889 VLOG(1) << "Installation complete, returning: " << return_code;
1882 1890
1883 return return_code; 1891 return return_code;
1884 } 1892 }
OLDNEW
« no previous file with comments | « chrome/chrome_exe.gypi ('k') | chrome/nacl/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698