Page 1 of 1

Zip and the executable file

Posted: Thu Dec 17, 2015 7:10 pm
by khofez
i'm starting using this tool, and I found very cool how the engine works etc, but I want to know, how you guys merge the zip and the executable file into one file?? I mean, its a very cool thing, I just want to know how it works

Re: Zip and the executable file

Posted: Thu Dec 17, 2015 7:28 pm
by Beelz
There are quite a few ways to do it... As of yesterday, this web based way is one of the easiest.

Re: Zip and the executable file

Posted: Thu Dec 17, 2015 7:49 pm
by khofez
Well, this isn't what I meant. I know how to do it, i just asked how it works

Re: Zip and the executable file

Posted: Thu Dec 17, 2015 8:02 pm
by zorg
Then you want this, specifically the "Creating a Windows Executable" part.

Edit: To answer your question even more deeply, windows executables have headers, meaning the start of the file is what matters when you execute it, and zip archives have footers, meaning the most relevant stuff is at the end; You merge the zip onto the end of the exe, so this is how it'll look:

Code: Select all

[EXE_HEADER.....................................][..................................ZIP_FOOTER]
Effectively, neither interferes with the other in any way.

Edit2: If you want to know how löve actually accesses the zip file that's welded to it's butt, you want to see the source, more specifically, /src/modules/filesystem/physfs/Filesystem.cpp and /src/scripts/boot.lua

Re: Zip and the executable file

Posted: Thu Dec 17, 2015 8:14 pm
by khofez
Thank you zorg !

Edit: So its actually a virtual file system??

Re: Zip and the executable file

Posted: Thu Dec 17, 2015 10:45 pm
by pgimeno
As I recently discovered, it uses PhysicsFS, http://www.icculus.org/physfs/ which is a virtual filesystem library.