From cb9b60e8e84d0a77b285d7b13773facc664aff34 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Sat, 9 Aug 2014 18:56:02 +0200 Subject: [PATCH] pre/post build process exe name can be resolved from the PATH variable --- src/ce_main.pas | 63 +++++++++++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 33 deletions(-) diff --git a/src/ce_main.pas b/src/ce_main.pas index ddba48c5..11b0597a 100644 --- a/src/ce_main.pas +++ b/src/ce_main.pas @@ -1186,22 +1186,21 @@ begin with fProject.currentConfiguration do begin if preBuildProcess.executable <> '' then - if fileExists(preBuildProcess.Executable) then - begin - ppproc := TProcess.Create(nil); - try - preBuildProcess.setProcess(ppproc); - if ppproc.CurrentDirectory = '' then - ppproc.CurrentDirectory := extractFilePath(ppproc.Executable); - ppproc.Execute; - if not (poWaitOnExit in ppproc.Options) then - if poUsePipes in ppproc.Options then - repeat ProcessOutputToMsg(ppproc, mcProject) until not ppproc.Running; - finally - ppproc.Free; - end; - end - else fMesgWidg.addCeWarn('the pre-compilation executable does not exist', mcProject); + begin + ppproc := TProcess.Create(nil); + try + preBuildProcess.setProcess(ppproc); + if ppproc.CurrentDirectory = '' then + ppproc.CurrentDirectory := extractFilePath(ppproc.Executable); + ppproc.Execute; + if not (poWaitOnExit in ppproc.Options) then + if poUsePipes in ppproc.Options then + repeat ProcessOutputToMsg(ppproc, mcProject) until not ppproc.Running; + finally + ppproc.Free; + end; + end + else fMesgWidg.addCeWarn('the pre-compilation executable does not exist', mcProject); end; if aProject.Sources.Count = 0 then @@ -1224,7 +1223,6 @@ begin chDir(prjpath); dmdProc.CurrentDirectory := prjpath; end; - {$IFDEF RELEASE} dmdProc.ShowWindow := swoHIDE; {$ENDIF} @@ -1242,22 +1240,21 @@ begin with fProject.currentConfiguration do begin if postBuildProcess.executable <> '' then - if fileExists(postBuildProcess.Executable) then - begin - ppproc := TProcess.Create(nil); - try - postBuildProcess.setProcess(ppproc); - if ppproc.CurrentDirectory = '' then - ppproc.CurrentDirectory := extractFilePath(ppproc.Executable); - ppproc.Execute; - if not (poWaitOnExit in ppproc.Options) then - if poUsePipes in ppproc.Options then - repeat ProcessOutputToMsg(ppproc, mcProject) until not ppproc.Running; - finally - ppproc.Free; - end; - end - else fMesgWidg.addCeWarn('the post-compilation executable does not exist', mcProject); + begin + ppproc := TProcess.Create(nil); + try + postBuildProcess.setProcess(ppproc); + if ppproc.CurrentDirectory = '' then + ppproc.CurrentDirectory := extractFilePath(ppproc.Executable); + ppproc.Execute; + if not (poWaitOnExit in ppproc.Options) then + if poUsePipes in ppproc.Options then + repeat ProcessOutputToMsg(ppproc, mcProject) until not ppproc.Running; + finally + ppproc.Free; + end; + end + else fMesgWidg.addCeWarn('the post-compilation executable does not exist', mcProject); end; finally