pouët.net

resource bundler

category: general [glöplog]
 
There are some cases where you would want to bundle your resources in your binary.
I've done this in the past using bin2h-code.
I just point to a directory, and it'll recursively convert every file into a single .h file.

My question....there are wonderfull tools for packing (think kkrunchy) but are there also nice tools out there to embed files in your exe?

Any feedback or insults about my english are welcome!
added on the 2009-09-27 23:19:01 by squezel squezel
for once I thought you were farfar and I was like "WTF!?" then my entire world collapsed.
added on the 2009-09-27 23:30:35 by decipher decipher
squezel: the fairlight-method is a pretty ok hack (i.e. zip everything together and attach it after the .exe)
added on the 2009-09-27 23:34:29 by Gargaj Gargaj
search for CFL on this page:

http://sol.gfxile.net/code.html

that worked for me in the past ..
doesn't anybody use that windows/msvc resource stuff? if no, why?
added on the 2009-09-28 08:10:25 by skrebbel skrebbel
skrebbel: i did and it worked fine for me.
added on the 2009-09-28 08:30:32 by kbi kbi
i've also used unrarlib at some point

http://www.unrarlib.org/

i dont like the .rc files since they are (to me) a pain to use out side visual studio. rar files and zip files can be read and altered by e.g. graphicians without a recompile :-)
macaw: I second that.
added on the 2009-09-28 10:52:30 by gloom gloom
good one.

then again i've never seen the problem with data directories. they're fun to browse, too (for some odd reason i especially enjoy data directories of mfx demos, it makes them even more impressive).
added on the 2009-09-28 11:03:45 by skrebbel skrebbel
I too happen to think that resource scripts are really unintuitive and I would definitely support something where recompilation is not required. I have been using 7-zip's LZMA SDK recently, it packs really good and it is pretty straightforward to use as well.
added on the 2009-09-28 11:03:55 by decipher decipher
I usually bundle everything into one zip file and read it with physfs
Quote:
PhysicsFS is a library to provide abstract access to various archives. It is intended for use in video games, and the design was somewhat inspired by Quake 3's file subsystem. The programmer defines a "write directory" on the physical filesystem. No file writing done through the PhysicsFS API can leave that write directory, for security. For example, an embedded scripting language cannot write outside of this path if it uses PhysFS for all of its I/O, which means that untrusted scripts can run more safely. Symbolic links can be disabled as well, for added safety. For file reading, the programmer lists directories and archives that form a "search path". Once the search path is defined, it becomes a single, transparent hierarchical filesystem. This makes for easy access to ZIP files in the same way as you access a file directly on the disk, and it makes it easy to ship a new archive that will override a previous archive on a per-file basis."

Oh.. it's cross platform too
added on the 2009-09-28 11:17:48 by evilpaul evilpaul
skrebbel: i guess the reason is that most demos want to use the direct binary data and while it is not impossible, it's just too fiddly to get access to a pointer with windows resources. (sure, it's still just 3-4 lines of code, but...) another thing is that the they don't compress with the executable, and they're also really easy to rip out because they have a well-defined offset/size in the header.
added on the 2009-09-28 11:55:17 by Gargaj Gargaj
lately i've been using a data directory, since nobody cares for file sizes any how ...
yeah but that's... so rudimentary :) having a datafile is l33t. (HELLO ANDROMEDA)
added on the 2009-09-28 15:40:34 by Gargaj Gargaj
In DOS (Windows is still DOS in this regard) you can just read the length of the EXE in the EXE header (forgot which offset, read the spec) and there you can put any data you like..
added on the 2009-09-28 16:00:47 by jaw jaw
oh btw, VSXu also uses LZMA.. Best packer lib for fat stuff out there, even packs mp3:s and jpegs a little bit!
added on the 2009-09-28 16:01:35 by jaw jaw
Quote:
another thing is that the they don't compress with the executable, and they're also really easy to rip out because they have a well-defined offset/size in the header.

They do compress with the executable with all executable packers I've tried. There's only some resources that can't be compressed, notably the first icon and the executable version information, plus the whole resource directory (this is the overhead that kkrunchy warns about); that's because those need to be uncompressed in the file so the shell can access them without running the program.
added on the 2009-09-28 16:17:47 by ryg ryg

login