"Mapping binary file failed"

delphi package - automated exception handling
Adrien
Posts: 2
Joined: Wed Oct 02, 2013 7:43 pm

"Mapping binary file failed"

Post by Adrien »

Hi,

I'm evaluating madExcept under Delphi XE4, 32 bit target. After having created a new VCL project, I enabled madExcept using the settings window. However, when I run the project, the following error message is displayed into the "messages" view :
[madExcept] Mapping binary file failed.
...and there is no madExcept dialog when an exception is raised by the compiled application.

Do I miss something ? Is it linked to this post : viewtopic.php?f=4&t=27600 ?

Thanks,

Adrien
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: "Mapping binary file failed"

Post by madshi »

Could you please try the very latest version which I've just released yesterday/today?

http://madshi.net/madCollection.exe (installer 2.7.7.0)

Does the same problem occur with this version?
Adrien
Posts: 2
Joined: Wed Oct 02, 2013 7:43 pm

Re: "Mapping binary file failed"

Post by Adrien »

Hi !

Just downloaded and installed your new version. It seems to work perfectly now. Thank you very much !

Adrien
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: "Mapping binary file failed"

Post by madshi »

Good to hear that! :D
daniel z
Posts: 4
Joined: Thu Oct 17, 2013 11:46 pm

Re: "Mapping binary file failed"

Post by daniel z »

We encountered the same problem on XE4 with madCollection 2.7.6.0.
When I upgraded to 2.7.7.0, the problem also went away.

I then uninstalled the madCollection installer, and simply installed the BPLs from 2.7.7.0 directly (which we do on all of our developer machines to allow us to manage 3rd party components more easily), I ended up with a similar error messages as before:

[madExcept] Starting external madExceptPatch tool failed.

From the message, it sounds like it doesn't know where to find madExceptPatch.exe. Can you tell me how the tool is found for patching at the end of the build process? I've tried copying madExceptPatch.exe into a folder in the windows Path, and adding back registry values to match what the installer does, but so far, haven't found the right combination. I've already verified that running madExceptPatch on the command line, using our .mes file and the map file, works properly.

Thanks,
Daniel
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: "Mapping binary file failed"

Post by madshi »

Can you please update to 2.7.7.4 / madExcept 4.8.0.1?

http://madshi.net/madCollection.exe

Does the problem still occur with that version?
daniel z
Posts: 4
Joined: Thu Oct 17, 2013 11:46 pm

Re: "Mapping binary file failed"

Post by daniel z »

Sorry, that was a typo - 2.7.7.4/4.8.0.1 is the version that I downloaded and tried yesterday.

Daniel
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: "Mapping binary file failed"

Post by madshi »

Ok, could you please do the following:

(1) Download http://madshi.net/HookProcessCreation.zip
(2) Start DllInjector and inject the 32bit hook dll. Leave the DllInjector GUI open.
(3) Compile your project in such a way that madExcept fails to patch your exe.

The "HookProcessCreation" download is in theory just a little demo which shows what my library "madCodeHook" can do. But in this case it will be useful to find out which exact command line madExcept called "madExceptPatch.exe" with. Once you've found out the command line, please start a command prompt window and try the same command line. What does madExceptPatch.exe report? Probably some sort of error?

When you've got the command line, you can uninject the 32bit hook dll and close the DllInjector and delete the HookProcessCreation demo folder.
daniel z
Posts: 4
Joined: Thu Oct 17, 2013 11:46 pm

Re: "Mapping binary file failed"

Post by daniel z »

Great, thanks for your quick reply. This led us straight to where it's running from.

The command line was
"<folder_where_the_madExcept_BPLs_are_located>\..\tools\madExceptPatch.exe" <exe filename> <mes filename>

As soon as I created this folder, and dropped in madExceptPatch.exe, everything worked properly.

Is the tool just being sought in a folder relative to the BPL? ie "..\tools"? Or is there also a registry key or some other setting that can override this?

Thanks,
Daniel
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: "Mapping binary file failed"

Post by madshi »

I'm not sure I understand. Have you moved the design time BPLs to a different folder? Or why would madExceptPatch.exe not be positioned in "..\tools\"? The installer should install the files with those relative paths, so unless you moved the files around manually, everything should work out fine. Obviously madExceptWizard_.bpl needs to be able to locate madExceptPatch.exe somehow in order to successfully start it.
daniel z
Posts: 4
Joined: Thu Oct 17, 2013 11:46 pm

Re: "Mapping binary file failed"

Post by daniel z »

Yes, that's exactly right. For each of the many 3rd party component we use, we have scripts that move around and register BPLs directly, put files in system paths, add registry keys, etc, so that we don't have to run each component's installer and uninstaller every time we upgrade them or make modifications. It makes things far easier for us to manage on all of our developer machines.

Now that I know that madExceptpatch is required to be in <madExceptWizard_.bpl folder>\..\tools, I can make sure our environment gets set up correctly.

Thanks again,
Daniel
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: "Mapping binary file failed"

Post by madshi »

Ok. FWIW, you can use the installer parameter "/extractOnly".
flightrisk
Posts: 6
Joined: Mon Feb 28, 2011 11:12 pm

Re: "Mapping binary file failed"

Post by flightrisk »

I have the same issue, but I am wondering if it is the type of project I am creating. I created developed a set of ActiveX controls from a set of VCL controls. So the end result is an ActiveX which is a form of DLL. Can MadExcept work with this kind of project or only a VCL Forms application?
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: "Mapping binary file failed"

Post by madshi »

It should generally work fine with an ActiveX control, too. Which madExcept version are you using? Make sure you're using the latest 4.0.10. Does the problem then still occur?
cesarliws
Posts: 1
Joined: Wed Jan 14, 2015 11:38 am

Re: "Mapping binary file failed"

Post by cesarliws »

I'm getting this error with Delphi XE7 Enterprise, I downloaded the last version earlier and still getting the same error.

My question is, what is the cause of the error?
What can I configure in my project to avoid the error?

Regards,


Cesar
Post Reply