XE7 Command Line Build not working even with Patch

delphi package - automated exception handling
Post Reply
MarkElder
Posts: 21
Joined: Sun Sep 10, 2006 3:42 am

XE7 Command Line Build not working even with Patch

Post by MarkElder »

Hello,

I am moving from XE6 to XE7. Everything is working fine except for command line builds. I'm aware that I need to use MadExceptPatch after building my exes and that I need to generate a detailed map file. No matter what I seem to try I can get MadExcept to work from within the ide, but not from the command line build.

I setup a very simple VCL Forms application to test with. Just a single button that raises an exception. When I build from my command line script madExcept does not catch the error.

I am using MadExcept 4.0.11

I can run my build in steps and I can see the output exe change in file size after the patching is run.

On a hunch I copied over the 4.0.10 copy of MadExceptPatch.exe and that solved my problem.

Here is the main part of my build where I call MadExceptPatch from msbuild:
<Target Name="Build">
<MSBuild Projects="MGR All Group.groupproj"
Properties="config=Release;DCC_Define=CONSOLE_TESTRUNNER"
Targets="Build" />
<Exec Command='$(MadExceptPatch) "..\bin\win32\AgMgr.exe" ".\AgMGR\AgMGR.mes"' />
<Exec Command="..\bin\win32\AgMgrTests.exe" />
</Target>

--
So two questions:
1) I see that there were some changes to the handling of relative paths in MadExcept. Does my command line need to be different now?
2) If this is a bug, am I OK to use the 4.0.10 version until there is a fix?

Thanks,

Mark
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Re: XE7 Command Line Build not working even with Patch

Post by madshi »

You're right that there have been changes. You should be fine with 4.0.10. But in order to fix this problem I might need to have a test case which reproduces the problem. Would you be willing to create a small test case for me? That would be great!
MarkElder
Posts: 21
Joined: Sun Sep 10, 2006 3:42 am

Re: XE7 Command Line Build not working even with Patch

Post by MarkElder »

Not quite sure how to get you a sample.

In my case I build into a folder structure that is side by side like this:
project\src
project\dcu
project\bin

I have a msbuild file that runs the build and calls MadExceptPatch. I have MadExceptPatch in a variable because I used to include the full path. We now always have it in the search path so that is no longer needed.

The msbuild file is in the root of the source file so a relative path of "..\bin\Win32\*.exe" gets back to my executables (I don't use different folders for release vs. debug). Here is what that looks like in the msbuild file.
<Exec Command='$(MadExceptPatch) "..\bin\Win32\UaarSales.exe" ".\UaarSales\UaarSales.mes"' />

Here are the full sections from the msbuild file.

Code: Select all

  <PropertyGroup>
    <!-- Normal Mad Except will add the information needed for the stack trace 
         to the exe during the IDE build.  However we have to manually execute 
         this tool when running a command line build -->
    <MadExceptPatch>madExceptPatch.exe</MadExceptPatch>
  </PropertyGroup>

  <Target Name="Build">
  
    <MSBuild Projects="UAAR Sales.groupproj" 
             Properties="config=Release;DCC_Define=CONSOLE_TESTRUNNER" 
             Targets="Build" />
             
    <Exec Command='$(MadExceptPatch) "..\bin\Win32\UaarSales.exe" ".\UaarSales\UaarSales.mes"' />
    <Exec Command='$(MadExceptPatch) "..\bin\Win32\UaarSalesApi.dll" ".\UaarSalesApi\UaarSalesApi.mes"' />	
    <Exec Command='$(MadExceptPatch) "..\bin\Win32\TemplateDesigner.exe" ".\TemplateDesigner\TemplateDesigner.mes"' />		
  </Target>
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Re: XE7 Command Line Build not working even with Patch

Post by madshi »

Please try the latest beta build, it contains some improvements in relative path handling for madExceptPatch. Maybe it already fixes the problem for you?

http://madshi.net/madCollectionBeta.exe
MarkElder
Posts: 21
Joined: Sun Sep 10, 2006 3:42 am

Re: XE7 Command Line Build not working even with Patch

Post by MarkElder »

Yes - everything seems to work for me with the Beta build.

Thanks!
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Re: XE7 Command Line Build not working even with Patch

Post by madshi »

Good to hear!
Post Reply