pre/post build process exe name can be resolved from the PATH variable

This commit is contained in:
Basile Burg 2014-08-09 18:56:02 +02:00
parent f7a6fad9c8
commit cb9b60e8e8
1 changed files with 30 additions and 33 deletions

View File

@ -1186,22 +1186,21 @@ begin
with fProject.currentConfiguration do with fProject.currentConfiguration do
begin begin
if preBuildProcess.executable <> '' then if preBuildProcess.executable <> '' then
if fileExists(preBuildProcess.Executable) then begin
begin ppproc := TProcess.Create(nil);
ppproc := TProcess.Create(nil); try
try preBuildProcess.setProcess(ppproc);
preBuildProcess.setProcess(ppproc); if ppproc.CurrentDirectory = '' then
if ppproc.CurrentDirectory = '' then ppproc.CurrentDirectory := extractFilePath(ppproc.Executable);
ppproc.CurrentDirectory := extractFilePath(ppproc.Executable); ppproc.Execute;
ppproc.Execute; if not (poWaitOnExit in ppproc.Options) then
if not (poWaitOnExit in ppproc.Options) then if poUsePipes in ppproc.Options then
if poUsePipes in ppproc.Options then repeat ProcessOutputToMsg(ppproc, mcProject) until not ppproc.Running;
repeat ProcessOutputToMsg(ppproc, mcProject) until not ppproc.Running; finally
finally ppproc.Free;
ppproc.Free; end;
end; end
end else fMesgWidg.addCeWarn('the pre-compilation executable does not exist', mcProject);
else fMesgWidg.addCeWarn('the pre-compilation executable does not exist', mcProject);
end; end;
if aProject.Sources.Count = 0 then if aProject.Sources.Count = 0 then
@ -1224,7 +1223,6 @@ begin
chDir(prjpath); chDir(prjpath);
dmdProc.CurrentDirectory := prjpath; dmdProc.CurrentDirectory := prjpath;
end; end;
{$IFDEF RELEASE} {$IFDEF RELEASE}
dmdProc.ShowWindow := swoHIDE; dmdProc.ShowWindow := swoHIDE;
{$ENDIF} {$ENDIF}
@ -1242,22 +1240,21 @@ begin
with fProject.currentConfiguration do with fProject.currentConfiguration do
begin begin
if postBuildProcess.executable <> '' then if postBuildProcess.executable <> '' then
if fileExists(postBuildProcess.Executable) then begin
begin ppproc := TProcess.Create(nil);
ppproc := TProcess.Create(nil); try
try postBuildProcess.setProcess(ppproc);
postBuildProcess.setProcess(ppproc); if ppproc.CurrentDirectory = '' then
if ppproc.CurrentDirectory = '' then ppproc.CurrentDirectory := extractFilePath(ppproc.Executable);
ppproc.CurrentDirectory := extractFilePath(ppproc.Executable); ppproc.Execute;
ppproc.Execute; if not (poWaitOnExit in ppproc.Options) then
if not (poWaitOnExit in ppproc.Options) then if poUsePipes in ppproc.Options then
if poUsePipes in ppproc.Options then repeat ProcessOutputToMsg(ppproc, mcProject) until not ppproc.Running;
repeat ProcessOutputToMsg(ppproc, mcProject) until not ppproc.Running; finally
finally ppproc.Free;
ppproc.Free; end;
end; end
end else fMesgWidg.addCeWarn('the post-compilation executable does not exist', mcProject);
else fMesgWidg.addCeWarn('the post-compilation executable does not exist', mcProject);
end; end;
finally finally