| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <winspool.h> | 6 #include <winspool.h> |
| 7 | 7 |
| 8 #include "base/at_exit.h" | 8 #include "base/at_exit.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 LOG(ERROR) << "Can't find regsvr32.exe."; | 92 LOG(ERROR) << "Can't find regsvr32.exe."; |
| 93 return result; | 93 return result; |
| 94 } | 94 } |
| 95 CommandLine command_line(regsvr32_path); | 95 CommandLine command_line(regsvr32_path); |
| 96 command_line.AppendArg("/s"); | 96 command_line.AppendArg("/s"); |
| 97 if (!install) { | 97 if (!install) { |
| 98 command_line.AppendArg("/u"); | 98 command_line.AppendArg("/u"); |
| 99 } | 99 } |
| 100 command_line.AppendArgPath(source_path); | 100 command_line.AppendArgPath(source_path); |
| 101 HANDLE process_handle; | 101 HANDLE process_handle; |
| 102 if (!base::LaunchApp(command_line.command_line_string(), | 102 if (!base::LaunchApp(command_line.GetCommandLineString(), |
| 103 true, | 103 true, |
| 104 false, | 104 false, |
| 105 &process_handle)) { | 105 &process_handle)) { |
| 106 LOG(ERROR) << "Unable to launch regsvr32.exe."; | 106 LOG(ERROR) << "Unable to launch regsvr32.exe."; |
| 107 return ERROR_NOT_SUPPORTED; | 107 return ERROR_NOT_SUPPORTED; |
| 108 } | 108 } |
| 109 base::win::ScopedHandle scoped_process_handle(process_handle); | 109 base::win::ScopedHandle scoped_process_handle(process_handle); |
| 110 DWORD exit_code = S_OK; | 110 DWORD exit_code = S_OK; |
| 111 if (!GetExitCodeProcess(scoped_process_handle, &exit_code)) { | 111 if (!GetExitCodeProcess(scoped_process_handle, &exit_code)) { |
| 112 HRESULT result = cloud_print::GetLastHResult(); | 112 HRESULT result = cloud_print::GetLastHResult(); |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 } else { | 315 } else { |
| 316 retval = InstallVirtualDriver(); | 316 retval = InstallVirtualDriver(); |
| 317 } | 317 } |
| 318 if (!CommandLine::ForCurrentProcess()->HasSwitch("silent")) { | 318 if (!CommandLine::ForCurrentProcess()->HasSwitch("silent")) { |
| 319 cloud_print::DisplayWindowsMessage(NULL, retval, | 319 cloud_print::DisplayWindowsMessage(NULL, retval, |
| 320 cloud_print::LoadLocalString(IDS_DRIVER_NAME)); | 320 cloud_print::LoadLocalString(IDS_DRIVER_NAME)); |
| 321 } | 321 } |
| 322 return retval; | 322 return retval; |
| 323 } | 323 } |
| 324 | 324 |
| OLD | NEW |