OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "cloud_print/common/win/install_utils.h" | 5 #include "cloud_print/common/win/install_utils.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_version_info_win.h" | 10 #include "base/file_version_info_win.h" |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 if (!IsProgramsFilesParent(installer_source)) | 196 if (!IsProgramsFilesParent(installer_source)) |
197 return; | 197 return; |
198 base::FilePath temp_path; | 198 base::FilePath temp_path; |
199 if (!base::CreateTemporaryFile(&temp_path)) | 199 if (!base::CreateTemporaryFile(&temp_path)) |
200 return; | 200 return; |
201 base::CopyFile(installer_source, temp_path); | 201 base::CopyFile(installer_source, temp_path); |
202 base::DeleteFileAfterReboot(temp_path); | 202 base::DeleteFileAfterReboot(temp_path); |
203 base::CommandLine command_line(temp_path); | 203 base::CommandLine command_line(temp_path); |
204 command_line.AppendSwitchPath(delete_switch, installer_source.DirName()); | 204 command_line.AppendSwitchPath(delete_switch, installer_source.DirName()); |
205 base::LaunchOptions options; | 205 base::LaunchOptions options; |
206 base::ProcessHandle process_handle; | 206 if (!base::LaunchProcess(command_line, options).IsValid()) { |
207 if (!base::LaunchProcess(command_line, options, &process_handle)) { | |
208 LOG(ERROR) << "Unable to launch child uninstall."; | 207 LOG(ERROR) << "Unable to launch child uninstall."; |
209 } | 208 } |
210 } | 209 } |
211 | 210 |
212 bool IsProgramsFilesParent(const base::FilePath& path) { | 211 bool IsProgramsFilesParent(const base::FilePath& path) { |
213 base::FilePath program_files; | 212 base::FilePath program_files; |
214 if (!PathService::Get(base::DIR_PROGRAM_FILESX86, &program_files)) | 213 if (!PathService::Get(base::DIR_PROGRAM_FILESX86, &program_files)) |
215 return false; | 214 return false; |
216 return program_files.IsParent(path); | 215 return program_files.IsParent(path); |
217 } | 216 } |
218 | 217 |
219 } // namespace cloud_print | 218 } // namespace cloud_print |
220 | 219 |
OLD | NEW |