Page 1 of 1

Manifest tool failing after madExcept patch tool run

Posted: Wed Apr 13, 2022 12:56 am
by markk
I've been trialling Delphi 11.0 and Delphi 11.1 for a while and have run into a problem.
One of our project builds runs post build events which essentially do the following

Code: Select all

"..\..\..\Library\Third party\madCollection\madExcept5\Tools\madExceptPatch.exe" /restoreFileTime "C:\PC4\License64\PC4LicGUI.exe" "C:\_svn\trunk_xe_D11.0\Riemann\LicenseServer\Service\PC4LicGUI.mes" "C:\PC4\License64\\PC4LicGUI.map" 

"C:\_svn\trunk_xe_D11.0\Library\Third party\\Microsoft\mt.exe" -manifest "C:\_svn\trunk_xe_D11.0\Riemann\LicenseServer\Service\PC4LicGui.base.manifest" -outputresource:"C:\PC4\License64\PC4LicGUI.exe"
Yesterday after updating our our Jedi/JCL copy the post build failed for one project and corrupts the exe, it still works for Delphi 10.4.2 builds but not Delphi 11.1
Microsoft (R) Manifest Tool
Copyright (c) Microsoft Corporation.
All rights reserved.

mt.exe : general error c101008d: Failed to write the updated manifest to the resource of file "C:\PC4\License64\PC4LicGUI.exe". The file or directory is corrupted and unreadable.
Error: Adding manifest(s) failed, error code 31

Reverting changes to jcl\source\common\JclUnicode.* files (.pas, .rc, .res) makes the problem go away and I subsequently discovered that not running the madExceptPatch.exe also makes the problem go away (but is not desirable)

Is there a bug with madExcept patching that's likely to be causing this failure?

Re: Manifest tool failing after madExcept patch tool run

Posted: Wed Apr 13, 2022 8:26 am
by madshi
I've no idea, I haven't heard about a similar problem from anyone else yet. Is the order of the commands important? Maybe you can run the manifest stuff first and madExceptPatch afterwards?

Re: Manifest tool failing after madExcept patch tool run

Posted: Thu Apr 21, 2022 12:45 am
by markk
I reverted the newer unicode Jcl files and then also changed our PostBuild commands to run within a single batch script to get better logging and error control and committed that to our svn server to stop the failure.
Today I went to check on running them in different order and now on my PC if I use the newer unicode JCL files again the error has gone away, including if I run the tools manually, weird.
Will recommit the newer uncicode files and see if the Jenkins build server works or fails again.

Re: Manifest tool failing after madExcept patch tool run

Posted: Thu Apr 21, 2022 2:49 am
by markk
Now failing on our build server with Delphi 10.4.2 but working with Delphi 11.1
and working on latest two builds on build server if madExcept patching is run after manifest tool