| 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 <windows.h> | 5 #include <windows.h> |
| 6 #include <setupapi.h> // Must be included after windows.h | 6 #include <setupapi.h> // Must be included after windows.h |
| 7 #include <winspool.h> | 7 #include <winspool.h> |
| 8 #include <iomanip> | 8 #include <iomanip> |
| 9 | 9 |
| 10 #include "base/at_exit.h" | 10 #include "base/at_exit.h" |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 | 140 |
| 141 base::win::ScopedHandle regsvr32_handle; | 141 base::win::ScopedHandle regsvr32_handle; |
| 142 if (!base::LaunchProcess(command_line.GetCommandLineString(), options, | 142 if (!base::LaunchProcess(command_line.GetCommandLineString(), options, |
| 143 ®svr32_handle)) { | 143 ®svr32_handle)) { |
| 144 LOG(ERROR) << "Unable to launch regsvr32.exe."; | 144 LOG(ERROR) << "Unable to launch regsvr32.exe."; |
| 145 return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED); | 145 return HRESULT_FROM_WIN32(ERROR_NOT_SUPPORTED); |
| 146 } | 146 } |
| 147 | 147 |
| 148 DWORD exit_code = S_OK; | 148 DWORD exit_code = S_OK; |
| 149 if (install) { | 149 if (install) { |
| 150 if (!GetExitCodeProcess(regsvr32_handle, &exit_code)) { | 150 if (!GetExitCodeProcess(regsvr32_handle.Get(), &exit_code)) { |
| 151 LOG(ERROR) << "Unable to get regsvr32.exe exit code."; | 151 LOG(ERROR) << "Unable to get regsvr32.exe exit code."; |
| 152 return GetLastHResult(); | 152 return GetLastHResult(); |
| 153 } | 153 } |
| 154 if (exit_code != 0) { | 154 if (exit_code != 0) { |
| 155 LOG(ERROR) << "Regsvr32.exe failed with " << exit_code; | 155 LOG(ERROR) << "Regsvr32.exe failed with " << exit_code; |
| 156 return HRESULT_FROM_WIN32(exit_code); | 156 return HRESULT_FROM_WIN32(exit_code); |
| 157 } | 157 } |
| 158 } else { | 158 } else { |
| 159 if (!base::DeleteFile(target_path, false)) { | 159 if (!base::DeleteFile(target_path, false)) { |
| 160 SpoolerServiceCommand("stop"); | 160 SpoolerServiceCommand("stop"); |
| (...skipping 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 | 550 |
| 551 VLOG(0) << GetErrorMessage(retval) | 551 VLOG(0) << GetErrorMessage(retval) |
| 552 << " HRESULT=0x" << std::setbase(16) << retval; | 552 << " HRESULT=0x" << std::setbase(16) << retval; |
| 553 | 553 |
| 554 // Installer is silent by default as required by Google Update. | 554 // Installer is silent by default as required by Google Update. |
| 555 if (CommandLine::ForCurrentProcess()->HasSwitch("verbose")) { | 555 if (CommandLine::ForCurrentProcess()->HasSwitch("verbose")) { |
| 556 DisplayWindowsMessage(NULL, retval, LoadLocalString(IDS_DRIVER_NAME)); | 556 DisplayWindowsMessage(NULL, retval, LoadLocalString(IDS_DRIVER_NAME)); |
| 557 } | 557 } |
| 558 return retval; | 558 return retval; |
| 559 } | 559 } |
| OLD | NEW |