Making love executable how does it works?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
dominicus
Prole
Posts: 4
Joined: Tue Sep 08, 2015 8:21 pm

Making love executable how does it works?

Post by dominicus »

Hi it's question to developers of Love.
To make My project executable on windows i use script

Code: Select all

@echo off
mkdir install
xcopy D:\LOVE\*.dll install\
copy /b D:\LOVE\love.exe+test.love install\my_game.exe
I copy zipped love project into love.exe. How love.exe knows how to find scripts when they copied into executable?
How luaL_dofile() function find scripts inside executable?
I'm asking because I want to apply this into my own project but I have no idea how.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Making love executable how does it works?

Post by bartbes »

This is a property of the zip file format, specifically. Because zips use footers, anything can be prepended to zips. Similarly, because exes use headers, anything can be appended to exes.

As for luaL_dofile, love doesn't use it, but rather implements its own filesystem (love.filesystem) and its own loader based on that and lua_loadstring (love.filesystem.load).
dominicus
Prole
Posts: 4
Joined: Tue Sep 08, 2015 8:21 pm

Re: Making love executable how does it works?

Post by dominicus »

Well I'm more interested in the implementation (probably in C/C++)... because i need to apply similar solution into my own project... i feel that this question will remain unanswered...
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: Making love executable how does it works?

Post by bartbes »

Then you might want to ask more specific questions. As I said, appending zips to exes leaves the resulting file both a valid exe and a valid zip, so you can then use any zip reading code you'd like.
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest