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> |
11 | 11 |
12 #include "base/at_exit.h" | 12 #include "base/at_exit.h" |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
15 #include "base/file_util.h" | 15 #include "base/file_util.h" |
16 #include "base/path_service.h" | 16 #include "base/path_service.h" |
17 #include "base/process_util.h" | 17 #include "base/process_util.h" |
18 #include "base/scoped_handle_win.h" | 18 #include "base/scoped_handle_win.h" |
19 #include "base/string_number_conversions.h" | 19 #include "base/string_number_conversions.h" |
20 #include "base/string_util.h" | 20 #include "base/string_util.h" |
21 #include "base/utf_string_conversions.h" | 21 #include "base/utf_string_conversions.h" |
22 #include "base/values.h" | 22 #include "base/values.h" |
23 #include "base/win_util.h" | 23 #include "base/win/windows_version.h" |
24 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
25 #include "chrome/installer/setup/install.h" | 25 #include "chrome/installer/setup/install.h" |
26 #include "chrome/installer/setup/setup_constants.h" | 26 #include "chrome/installer/setup/setup_constants.h" |
27 #include "chrome/installer/setup/setup_util.h" | 27 #include "chrome/installer/setup/setup_util.h" |
28 #include "chrome/installer/setup/uninstall.h" | 28 #include "chrome/installer/setup/uninstall.h" |
29 #include "chrome/installer/util/browser_distribution.h" | 29 #include "chrome/installer/util/browser_distribution.h" |
30 #include "chrome/installer/util/delete_after_reboot_helper.h" | 30 #include "chrome/installer/util/delete_after_reboot_helper.h" |
31 #include "chrome/installer/util/delete_tree_work_item.h" | 31 #include "chrome/installer/util/delete_tree_work_item.h" |
32 #include "chrome/installer/util/helper.h" | 32 #include "chrome/installer/util/helper.h" |
33 #include "chrome/installer/util/html_dialog.h" | 33 #include "chrome/installer/util/html_dialog.h" |
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 return installer_util::SXS_OPTION_NOT_SUPPORTED; | 667 return installer_util::SXS_OPTION_NOT_SUPPORTED; |
668 } | 668 } |
669 } | 669 } |
670 | 670 |
671 int exit_code = 0; | 671 int exit_code = 0; |
672 if (HandleNonInstallCmdLineOptions(parsed_command_line, system_install, | 672 if (HandleNonInstallCmdLineOptions(parsed_command_line, system_install, |
673 exit_code)) | 673 exit_code)) |
674 return exit_code; | 674 return exit_code; |
675 | 675 |
676 if (system_install && !IsUserAnAdmin()) { | 676 if (system_install && !IsUserAnAdmin()) { |
677 if (win_util::GetWinVersion() >= win_util::WINVERSION_VISTA && | 677 if (base::win::GetVersion() >= base::win::VERSION_VISTA && |
678 !parsed_command_line.HasSwitch(installer_util::switches::kRunAsAdmin)) { | 678 !parsed_command_line.HasSwitch(installer_util::switches::kRunAsAdmin)) { |
679 std::wstring exe = parsed_command_line.program(); | 679 std::wstring exe = parsed_command_line.program(); |
680 std::wstring params(command_line); | 680 std::wstring params(command_line); |
681 // Append --run-as-admin flag to let the new instance of setup.exe know | 681 // Append --run-as-admin flag to let the new instance of setup.exe know |
682 // that we already tried to launch ourselves as admin. | 682 // that we already tried to launch ourselves as admin. |
683 params.append(L" --"); | 683 params.append(L" --"); |
684 params.append(installer_util::switches::kRunAsAdmin); | 684 params.append(installer_util::switches::kRunAsAdmin); |
685 DWORD exit_code = installer_util::UNKNOWN_STATUS; | 685 DWORD exit_code = installer_util::UNKNOWN_STATUS; |
686 InstallUtil::ExecuteExeAsAdmin(exe, params, &exit_code); | 686 InstallUtil::ExecuteExeAsAdmin(exe, params, &exit_code); |
687 return exit_code; | 687 return exit_code; |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 parsed_command_line.HasSwitch(installer_util::switches::kUninstall))) { | 741 parsed_command_line.HasSwitch(installer_util::switches::kUninstall))) { |
742 // Note that we allow the status installer_util::UNINSTALL_REQUIRES_REBOOT | 742 // Note that we allow the status installer_util::UNINSTALL_REQUIRES_REBOOT |
743 // to pass through, since this is only returned on uninstall which is never | 743 // to pass through, since this is only returned on uninstall which is never |
744 // invoked directly by Google Update. | 744 // invoked directly by Google Update. |
745 return_code = dist->GetInstallReturnCode(install_status); | 745 return_code = dist->GetInstallReturnCode(install_status); |
746 } | 746 } |
747 | 747 |
748 LOG(INFO) << "Installation complete, returning: " << return_code; | 748 LOG(INFO) << "Installation complete, returning: " << return_code; |
749 return return_code; | 749 return return_code; |
750 } | 750 } |
OLD | NEW |