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

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: 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
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 1661 matching lines...) Expand 10 before | Expand all | Expand 10 after
1702 VLOG(1) << "Command Line: " << cmd_line.GetCommandLineString(); 1704 VLOG(1) << "Command Line: " << cmd_line.GetCommandLineString();
1703 1705
1704 VLOG(1) << "multi install is " << prefs.is_multi_install(); 1706 VLOG(1) << "multi install is " << prefs.is_multi_install();
1705 bool system_install = false; 1707 bool system_install = false;
1706 prefs.GetBool(installer::master_preferences::kSystemLevel, &system_install); 1708 prefs.GetBool(installer::master_preferences::kSystemLevel, &system_install);
1707 VLOG(1) << "system install is " << system_install; 1709 VLOG(1) << "system install is " << system_install;
1708 1710
1709 scoped_ptr<google_breakpad::ExceptionHandler> breakpad( 1711 scoped_ptr<google_breakpad::ExceptionHandler> breakpad(
1710 InitializeCrashReporting(system_install)); 1712 InitializeCrashReporting(system_install));
1711 1713
1714 // Make sure the setup exits cleanly on unexpected errors.
grt (UTC plus 2) 2015/10/08 11:52:08 s/setup/process/
Patrick Monette 2015/10/08 21:22:46 Done.
1715 base::EnableTerminationOnHeapCorruption();
1716 base::EnableTerminationOnOutOfMemory();
1717 base::win::RegisterInvalidParamHandler();
1718 base::win::SetupCRT(cmd_line);
1719
1712 InstallationState original_state; 1720 InstallationState original_state;
1713 original_state.Initialize(); 1721 original_state.Initialize();
1714 1722
1715 InstallerState installer_state; 1723 InstallerState installer_state;
1716 installer_state.Initialize(cmd_line, prefs, original_state); 1724 installer_state.Initialize(cmd_line, prefs, original_state);
1717 const bool is_uninstall = cmd_line.HasSwitch(installer::switches::kUninstall); 1725 const bool is_uninstall = cmd_line.HasSwitch(installer::switches::kUninstall);
1718 1726
1719 // Check to make sure current system is WinXP or later. If not, log 1727 // Check to make sure current system is WinXP or later. If not, log
1720 // error message and get out. 1728 // error message and get out.
1721 if (!InstallUtil::IsOSSupported()) { 1729 if (!InstallUtil::IsOSSupported()) {
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
1826 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT 1834 // Note that we allow the status installer::UNINSTALL_REQUIRES_REBOOT
1827 // to pass through, since this is only returned on uninstall which is 1835 // to pass through, since this is only returned on uninstall which is
1828 // never invoked directly by Google Update. 1836 // never invoked directly by Google Update.
1829 return_code = InstallUtil::GetInstallReturnCode(install_status); 1837 return_code = InstallUtil::GetInstallReturnCode(install_status);
1830 } 1838 }
1831 1839
1832 VLOG(1) << "Installation complete, returning: " << return_code; 1840 VLOG(1) << "Installation complete, returning: " << return_code;
1833 1841
1834 return return_code; 1842 return return_code;
1835 } 1843 }
OLDNEW
« base/base.gyp ('K') | « chrome/installer/setup/BUILD.gn ('k') | chrome/nacl/DEPS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698