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!
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!
for once I thought you were farfar and I was like "WTF!?" then my entire world collapsed.
squezel: the fairlight-method is a pretty ok hack (i.e. zip everything together and attach it after the .exe)
search for CFL on this page:
http://sol.gfxile.net/code.html
that worked for me in the past ..
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?
skrebbel: i did and it worked fine for me.
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 :-)
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.
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).
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).
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.
I usually bundle everything into one zip file and read it with physfs
Oh.. it's cross platform too
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
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.
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)
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..
oh btw, VSXu also uses LZMA.. Best packer lib for fat stuff out there, even packs mp3:s and jpegs a little bit!
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.