mirror of https://gitlab.com/basile.b/dexed.git
exeInSysPath uses exeFullName
This commit is contained in:
parent
d59d85f750
commit
1a0c006e06
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue