Man oh Manefests

Started by Ed Lecuyer, September 12, 2014, 02:23:24 PM

Previous topic - Next topic

Ed Lecuyer

Hi all,

Just got my upgrade to WinBatch + Compiler 2014B. Yey!

I currently use the method described in Article ID: W17428 to modify the manifest resource of the WinBatch executable.

Is there now a better way to embed my own manifests (added since WB2010?)

If not, what are the correct FixManSize and Offset values to use for WB2014B.

Thanks,

-Ed Lecuyer
Technical Product Manager, Terrain Navigator Pro
Proud WinBatch User and Advocate since 1997.
Ed Lecuyer
Technical Product Manager
Terrain Navigator Pro
MyTopo, A Trimble Company

td

The manifest starts somewhere close to byte offest 131586 and has a size of about 1294 bytes for 2014B.  The offset may not be exact but they should be close. You may have to experiment a bit.

You can find this information for yourself using the BinaryIndexEx functions to search a compiled script for the introductory '<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">' string. You can find the size by searching for  the the last resource compiler inserted 'PADDINGPADDINGX' string.

It could be possible that at some time in the future we might size a manifest such that it falls exactly between resource segment boundaries but it is very unlikely that that would ever happen.  If it ever did happened the 'PADDINGPADDINGX' stings would not be present and you would have to search for the manifest terminating string '</assembly>'.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

Ed Lecuyer

I think I found the right settings
offset: 130292
size: 1291

That said, it would be much easier if we could add our own requirements to the application manifest, rather than having to hack them in post-compile. It would make WinBatch more flexible for those using it for application development in conjunction with external libraries.
Ed Lecuyer
Technical Product Manager
Terrain Navigator Pro
MyTopo, A Trimble Company

td

Using BinaryIndexEx I get the same offset for a 32-bit compilation but get 1292 for the size.  Of course the 64-bit compilation would produce different results.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

td

You may want to limit your manifest size to the size calculated by using the byte offset of the end of the '</assembly>' tag.  Have always assumed that the 'paddingpadingx' can be used by a manifest but have never tested that assumption.  The .rsrc section structures could be storing size limiting information for the #24 resource separate from the next resource and total .rsrc section size information.  If I ever get a free moment, I will have to poke around in the PE format's .rsrc section contents.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade

td

That didn't take long.  It appears that the resource header does contain size information that does not include the padding between resource so it would be best to not use 'PADDINGPADDINGX' as part of the total manifest size.
"No one who sees a peregrine falcon fly can ever forget the beauty and thrill of that flight."
  - Dr. Tom Cade