fix some case where tools could not be found

This commit is contained in:
Basile Burg 2015-12-04 20:05:48 +01:00
parent 0e00028c22
commit cb4d381e08
5 changed files with 23 additions and 17 deletions

View File

@ -727,7 +727,12 @@ begin
ext := extractFileExt(anExeName); ext := extractFileExt(anExeName);
if ext = '' then if ext = '' then
anExeName += exeExt; anExeName += exeExt;
//full path already specified
if FileExists(anExeName) and (not FileExists(ExtractFileName(anExeName))) then
exit(anExeName);
//
env := sysutils.GetEnvironmentVariable('PATH'); env := sysutils.GetEnvironmentVariable('PATH');
// maybe in current dir
if FileExists(anExeName) then if FileExists(anExeName) then
env += PathSeparator + GetCurrentDir; env += PathSeparator + GetCurrentDir;
{$IFNDEF CEBUILD} {$IFNDEF CEBUILD}

View File

@ -773,7 +773,7 @@ begin
exit; exit;
// //
fDemangler := TCEProcess.Create(nil); fDemangler := TCEProcess.Create(nil);
fDemangler.Executable := toolname; fDemangler.Executable := exeFullName(toolname);
fDemangler.OnTerminate:= @demanglerOutput; fDemangler.OnTerminate:= @demanglerOutput;
fDemangler.Options:= [poUsePipes]; fDemangler.Options:= [poUsePipes];
fDemangler.ShowWindow:= swoHIDE; fDemangler.ShowWindow:= swoHIDE;

View File

@ -653,7 +653,7 @@ begin
process := TProcess.Create(nil); process := TProcess.Create(nil);
try try
processInfo.setProcess(process); processInfo.setProcess(process);
process.Executable := pname; process.Executable := exeFullName(pname);
j := process.Parameters.Count-1; j := process.Parameters.Count-1;
for i:= 0 to j do for i:= 0 to j do
process.Parameters.AddText(symbolExpander.get(process.Parameters.Strings[i])); process.Parameters.AddText(symbolExpander.get(process.Parameters.Strings[i]));

View File

@ -115,6 +115,7 @@ type
procedure TreeKeyPress(Sender: TObject; var Key: char); procedure TreeKeyPress(Sender: TObject; var Key: char);
private private
fHasToolExe: boolean; fHasToolExe: boolean;
fToolExeName: string;
fOptions: TCESymbolListOptions; fOptions: TCESymbolListOptions;
fSyms: TSymbolList; fSyms: TSymbolList;
fMsgs: ICEMessagesDisplay; fMsgs: ICEMessagesDisplay;
@ -648,7 +649,8 @@ end;
procedure TCESymbolListWidget.checkIfHasToolExe; procedure TCESymbolListWidget.checkIfHasToolExe;
begin begin
fHasToolExe := exeInSysPath(toolExeName); fToolExeName := exeFullName(toolExeName);
fHasToolExe := FileExists(fToolExeName);
end; end;
procedure TCESymbolListWidget.callToolProc; procedure TCESymbolListWidget.callToolProc;
@ -664,7 +666,7 @@ begin
fToolProc := TCEProcess.Create(nil); fToolProc := TCEProcess.Create(nil);
fToolProc.ShowWindow := swoHIDE; fToolProc.ShowWindow := swoHIDE;
fToolProc.Options := [poUsePipes]; fToolProc.Options := [poUsePipes];
fToolProc.Executable := toolExeName; fToolProc.Executable := fToolExeName;
fToolProc.OnTerminate := @toolTerminated; fToolProc.OnTerminate := @toolTerminated;
fToolProc.CurrentDirectory := ExtractFileDir(Application.ExeName); fToolProc.CurrentDirectory := ExtractFileDir(Application.ExeName);
fToolProc.Execute; fToolProc.Execute;

View File

@ -174,7 +174,7 @@ begin
fProcess.OnReadData:= @processOutput; fProcess.OnReadData:= @processOutput;
fProcess.OnTerminate:= @processOutput; fProcess.OnTerminate:= @processOutput;
fProcess.Options := fOpts; fProcess.Options := fOpts;
fProcess.Executable := symbolExpander.get(fExecutable); fProcess.Executable := exeFullName(symbolExpander.get(fExecutable));
fProcess.ShowWindow := fShowWin; fProcess.ShowWindow := fShowWin;
fProcess.CurrentDirectory := symbolExpander.get(fWorkingDir); fProcess.CurrentDirectory := symbolExpander.get(fWorkingDir);
if fQueryParams then if fQueryParams then
@ -186,6 +186,8 @@ begin
for prm in fParameters do if not isStringDisabled(prm) then for prm in fParameters do if not isStringDisabled(prm) then
fProcess.Parameters.AddText(symbolExpander.get(prm)); fProcess.Parameters.AddText(symbolExpander.get(prm));
ensureNoPipeIfWait(fProcess); ensureNoPipeIfWait(fProcess);
//
if FileExists(fProcess.Executable) then
fProcess.Execute; fProcess.Execute;
end; end;
@ -360,16 +362,13 @@ var
chained: TCollectionItem; chained: TCollectionItem;
begin begin
if aTool = nil then exit; if aTool = nil then exit;
if not exeInSysPath(aTool.executable) then //
if (aTool.chainAfter.Count = 0) and (aTool.chainBefore.Count = 0) then
exit;
for nme in aTool.chainBefore do for nme in aTool.chainBefore do
for chained in fTools do for chained in fTools do
if TCEToolItem(chained).toolAlias = nme then if TCEToolItem(chained).toolAlias = nme then
if TCEToolItem(chained).toolAlias <> aTool.toolAlias then if TCEToolItem(chained).toolAlias <> aTool.toolAlias then
TCEToolItem(chained).execute; TCEToolItem(chained).execute;
if exeInSysPath(aTool.executable) then //
begin
aTool.execute; aTool.execute;
if aTool.editorToInput and assigned(fDoc) and (poUsePipes in aTool.options) then if aTool.editorToInput and assigned(fDoc) and (poUsePipes in aTool.options) then
begin begin
@ -377,7 +376,7 @@ begin
aTool.fProcess.Input.Write(txt[1], length(txt)); aTool.fProcess.Input.Write(txt[1], length(txt));
aTool.fProcess.CloseInput; aTool.fProcess.CloseInput;
end; end;
end; //
for nme in aTool.chainAfter do for nme in aTool.chainAfter do
for chained in fTools do for chained in fTools do
if TCEToolItem(chained).toolAlias = nme then if TCEToolItem(chained).toolAlias = nme then