Page 2 of 28

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

Posted: Mon Feb 09, 2009 5:34 am
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".

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

Posted: Mon Feb 09, 2009 6:27 am
by Kaze
I just drag my game folders onto my batch script, "Make LOVE.bat". :nyu:

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

Posted: Mon Feb 09, 2009 3:11 pm
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.

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

Posted: Mon Feb 09, 2009 11:04 pm
by philnelson
That would work nicely. Is the OS X package code available anywhere? It is apparently not in the main SVN repository.

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

Posted: Tue Feb 10, 2009 12:47 am
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.

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

Posted: Fri Feb 13, 2009 6:38 pm
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.

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

Posted: Fri Feb 13, 2009 11:44 pm
by thelinx
can we use LZMA instead of zip?
mike wrote:LÖVE IDE
want O.O

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

Posted: Sat Feb 14, 2009 12:18 am
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.

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

Posted: Sat Feb 14, 2009 12:30 pm
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.

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

Posted: Sun Feb 15, 2009 4:53 am
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.)