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 3// found in the LICENSE file. 4 5#include "remoting/host/ipc_constants.h" 6 7#include "base/compiler_specific.h" 8#include "base/logging.h" 9#include "base/path_service.h" 10 11namespace remoting { 12 13const char kDaemonPipeSwitchName[] = "daemon-pipe"; 14 15const base::FilePath::CharType kHostBinaryName[] = 16 FILE_PATH_LITERAL("remoting_host"); 17 18const base::FilePath::CharType kDesktopBinaryName[] = 19 FILE_PATH_LITERAL("remoting_desktop"); 20 21bool GetInstalledBinaryPath(const base::FilePath::StringType& binary, 22 base::FilePath* full_path) { 23 base::FilePath dir_path; 24 if (!PathService::Get(base::DIR_EXE, &dir_path)) { 25 LOG(ERROR) << "Failed to get the executable file name."; 26 return false; 27 } 28 29 base::FilePath path = dir_path.Append(binary); 30 31#if defined(OS_WIN) 32 path = path.ReplaceExtension(FILE_PATH_LITERAL("exe")); 33#endif // defined(OS_WIN) 34 35 *full_path = path; 36 return true; 37} 38 39} // namespace remoting 40