' Gambas module file

Public Function ChkExec(executable As String) As Boolean

  Dim i As Integer

  i = InStr(executable, " ")
  If i Then executable = Left(executable, i - 1)

  Shell "which " & executable & " >/dev/null 2>&1" Wait

  If Process.LastValue Then Return False
  Return True

End

Public Function ChkExecDir(executable As String) As String

  Dim installdir As String
  Shell "which " & executable & "" Wait To installdir
  installdir = Replace(Replace(installdir, " ", ""), "\n", "")
  Return installdir
End
