Distributing your games (making a .love file)

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.
nunix
Prole
Posts: 28
Joined: Fri Jan 30, 2009 4:38 am

Re: Distributing your games (making a .love file)

Post by nunix »

(also on OSX)

Actually all we do is rename the directory .love, and then double-click the resulting icon (so /user/Game becomes /user/Game.love). You can still navigate into the folder itself, it just changes the double-click (and the icon) action to "run with this program" rather than "open this directory".
User avatar
Kaze
Party member
Posts: 189
Joined: Sat Jul 19, 2008 4:39 pm
Location: Dublin, Ireland

Re: Distributing your games (making a .love file)

Post by Kaze »

I just drag my game folders onto my batch script, "Make LOVE.bat". :nyu:
User avatar
JoeOsborn
Prole
Posts: 4
Joined: Mon Feb 09, 2009 3:03 pm

Re: Distributing your games (making a .love file)

Post by JoeOsborn »

As a long-time Mac developer, I would like to suggest that love.app should look for Contents/Resources/*.love , where * is whatever the game is named (if there are multiple files, either provide a game selector or choose the alphabetically first one). The Objective-C magic to make this happen is:

Code: Select all

//in whatever your "application just launched" handler might be:
NSString *firstLovePath = [[[NSBundle mainBundle] pathsForResourcesOfType:@"love" inDirectory:nil] objectAtIndex:0];
//then just load it like a regular love document...
That way, the developer could just rename love.app to MyGame.app (and fix the info.plist on his own, too) -- this could be automated pretty easily.
philnelson
Prole
Posts: 48
Joined: Sun Feb 01, 2009 3:32 am

Re: Distributing your games (making a .love file)

Post by philnelson »

That would work nicely. Is the OS X package code available anywhere? It is apparently not in the main SVN repository.
User avatar
Sardtok
Party member
Posts: 108
Joined: Thu Feb 21, 2008 2:37 pm
Location: Norway/Norge/諾威/挪威 (Yes, I'm teh back!)
Contact:

Re: Distributing your games (making a .love file)

Post by Sardtok »

Uhm, there are multiple files on Macs too, they're just not located in the Applications folder after you run the installer. It's similar to the Start menu folder on Windows.
Take off every Zigg for great rapist.
Now, outgay that!
machman
Prole
Posts: 1
Joined: Fri Feb 13, 2009 6:32 pm

Re: Distributing your games (making a .love file)

Post by machman »

Sardtok wrote:Uhm, there are multiple files on Macs too, they're just not located in the Applications folder after you run the installer. It's similar to the Start menu folder on Windows.
Most Mac apps don't have an installer, you just download a .dmg and drag the application to wherever you want to store it. Besides the Apple applications and VMWare I don't think I use any applications that use installers.
User avatar
thelinx
The Strongest
Posts: 857
Joined: Fri Sep 26, 2008 3:56 pm
Location: Sweden

Re: Distributing your games (making a .love file)

Post by thelinx »

can we use LZMA instead of zip?
mike wrote:LÖVE IDE
want O.O
osuf oboys
Party member
Posts: 215
Joined: Sun Jan 18, 2009 8:03 pm

Re: Distributing your games (making a .love file)

Post by osuf oboys »

TheLinx wrote:can we use LZMA instead of zip?
mike wrote:LÖVE IDE
want O.O
I vote that it should be made with LÖVE.
If I haven't written anything else, you may assume that my work is released under the LPC License - the LÖVE Community. See http://love2d.org/wiki/index.php?title=LPC_License.
User avatar
Sardtok
Party member
Posts: 108
Joined: Thu Feb 21, 2008 2:37 pm
Location: Norway/Norge/諾威/挪威 (Yes, I'm teh back!)
Contact:

Re: Distributing your games (making a .love file)

Post by Sardtok »

DMGs are archives, which usually contains another archive .app files. The .app files aren't just an application, but an archive containing the application, and required files. I believe there is some way, or at least used to be, to be able to turn on seeing .apps as directories, but I never really cared to get do these things myself.
One thing I've always wondered about is how Macs handle dependencies and shared libraries, or dynamic libraries on Macs. I guess most apps just contain .dylib files in their app archives.
Remember that the programs leave config files and such around on your drive. Most likely in a hidden directory with the same name as the application in your home directory. (For instance /home/~username/.Safari or something similar for your Safari config files).

I don't really see any problem with appending a zip archive to the end of an app archive, unless it needs you to actually append it to the executable inside the .app, then it could get problematic. If you can compile the thing yourself, it should be possible to do that too, though.
Take off every Zigg for great rapist.
Now, outgay that!
User avatar
JoeOsborn
Prole
Posts: 4
Joined: Mon Feb 09, 2009 3:03 pm

Re: Distributing your games (making a .love file)

Post by JoeOsborn »

It's actually a fairly subtle solution.

First, a .app is just a folder - not any type of archive. Loosely, Mac OS's file type registry permits folders to be treated as "packages" or "bundles" -- single files -- while remaining folders in actuality. So, .apps work this way, and so do .love bundles on OS X (.love ZIP archives also work; a .love bundle is just a folder named .love).

A Mac app has access to its bundle contents at runtime, so dynamic code loading can happen in a few ways:
* Link or dlopen() a .a/.so/.dylib in the usual Unix paths or somewhere in the application bundle
* NS/CFBundle API to load a framework (a bundle containing library headers, binaries, documentation, etc) in various framework search paths or within the app's Contents/Frameworks

Also, Mac config files are generally written using the NS or CFUserDefaults API and stored in ~/Library/Preferences/<bundle identifier>.plist. Auxiliary files are stored in ~/Library/Application Support. Neither of these locations is .love-appropriate.

Appending a zip archive to a .app doesn't make any sense -- zip would see the .app as a folder, because it is a folder.

The solution of making Mac LÖVE look inside Contents/Resources/ for a love package is the best one. It's trivial to do from a Makefile or from Finder.

(Edited for clarification.)
Post Reply

Who is online

Users browsing this forum: No registered users and 49 guests