exeInSysPath uses exeFullName

This commit is contained in:
Basile Burg 2015-06-04 15:54:14 +02:00
parent d59d85f750
commit 1a0c006e06
1 changed files with 1 additions and 15 deletions

View File

@ -690,22 +690,8 @@ begin
end; end;
function exeInSysPath(anExeName: string): boolean; function exeInSysPath(anExeName: string): boolean;
var
ext: string;
env: string;
begin begin
ext := extractFileExt(anExeName); exit(exeFullName(anExeName) <> '');
if ext <> exeExt then
anExeName += exeExt;
if FileExists(anExeName) then
exit(true)
else
begin
env := sysutils.GetEnvironmentVariable('PATH');
if Application <> nil then
env += PathSeparator + ExtractFileDir(ExtractFilePath(application.ExeName));
exit(ExeSearch(anExeName, env) <> '');
end;
end; end;
function exeFullName(anExeName: string): string; function exeFullName(anExeName: string): string;