Zip and the executable file

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
khofez
Prole
Posts: 12
Joined: Thu Dec 17, 2015 7:05 pm

Zip and the executable file

Post 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
User avatar
Beelz
Party member
Posts: 234
Joined: Thu Sep 24, 2015 1:05 pm
Location: New York, USA
Contact:

Re: Zip and the executable file

Post by Beelz »

There are quite a few ways to do it... As of yesterday, this web based way is one of the easiest.

Code: Select all

if self:hasBeer() then self:drink()
else self:getBeer() end
GitHub -- Website
khofez
Prole
Posts: 12
Joined: Thu Dec 17, 2015 7:05 pm

Re: Zip and the executable file

Post by khofez »

Well, this isn't what I meant. I know how to do it, i just asked how it works
User avatar
zorg
Party member
Posts: 3465
Joined: Thu Dec 13, 2012 2:55 pm
Location: Absurdistan, Hungary
Contact:

Re: Zip and the executable file

Post 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
Last edited by zorg on Thu Dec 17, 2015 8:20 pm, edited 1 time in total.
Me and my stuff :3True Neutral Aspirant. Why, yes, i do indeed enjoy sarcastically correcting others when they make the most blatant of spelling mistakes. No bullying or trolling the innocent tho.
khofez
Prole
Posts: 12
Joined: Thu Dec 17, 2015 7:05 pm

Re: Zip and the executable file

Post by khofez »

Thank you zorg !

Edit: So its actually a virtual file system??
User avatar
pgimeno
Party member
Posts: 3641
Joined: Sun Oct 18, 2015 2:58 pm

Re: Zip and the executable file

Post by pgimeno »

As I recently discovered, it uses PhysicsFS, http://www.icculus.org/physfs/ which is a virtual filesystem library.
Post Reply

Who is online

Users browsing this forum: Semrush [Bot] and 2 guests