MadExcept before Digital Signing

delphi package - automated exception handling
Post Reply
obl918
Posts: 23
Joined: Thu Sep 03, 2015 8:33 pm

MadExcept before Digital Signing

Post by obl918 »

When adding code signing as a post-build event, I found that my 32-bit executables were fine but the 64-bit ones "lost" their digital signature. I tracked this down to MadExcept being "applied" *after* the post-build event that signs the exe. I have no idea why XE8 would tell MadExcept to do its thing AFTER my post-build event but there it is.

Is there some way to fix this? I realize it is not MadExcept's fault, but would like a solution that hopefully allows me to continue using the MadExcept settings wizard for the project.
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Re: MadExcept before Digital Signing

Post by madshi »

I'm confused about the order of in which the IDE calls things here, too. Makes no sense, really.

The only thing coming to mind right now is that you might have to disable madExcept in the IDE settings dialog, and then in the post build event manually run "madExceptPatch.exe" with a different copy of the yourProject.mes file which has madExcept still enabled. This should do the trick, but it's obviously not a "nice" solution. Well, or you could keep madExcept enabled, but move "madExceptPatch.exe" to a different folder so that the IDE wizard can't find it. Then again, execute madExceptPatch.exe yourself in the post build event. The advantage of this solution would be that you can keep madExcept enabled in the settings dialog. The disadvantage is that the madExcept IDE wizard will probably complain that it couldn't find madExceptPatch.exe.
obl918
Posts: 23
Joined: Thu Sep 03, 2015 8:33 pm

Re: MadExcept before Digital Signing

Post by obl918 »

OK. Seems like a bug in Delphi that it would do anything after the post build events so I should probably submit a qa report there. Thanks for the tips.
davidheffernan
Posts: 89
Joined: Thu Feb 23, 2012 12:22 pm

Re: MadExcept before Digital Signing

Post by davidheffernan »

Personally, I don't include ME in the IDE. I have it as a pure post-build step with a .mes file that I've edited in a text editor. I've cut out all the default values, and just included the handful of settings that I make.

Done this way, I can control the order in which the post-build work happens. The ME IDE integration is well done, but once you've got a stable setup, I personally don't think it's needed. And surely you need to script the ME patching anyway for command line builds. At which point, isn't it cleaner to do it just once in a post-build script and then you know that what you are debugging is the same as what you are shipping?
Post Reply