It took me several hours and has left me with a nasty headache, but I managed to figure out all the hoops one has to jump through to create a standalone application of your .love that can be distributed to OS X users! Below is the 12-step tutorial (the steps are small, don't worry!):
First, make a copy of love.app, and make sure you have a .love of your game. For this tutorial, I'll be using a fresh copy of love.app and examples.love, newly downloaded:
Once you have those (remember, use a copy of love.app, not your original), right-click (or control-click) on love.app, select "Show Package Contents", and expand the Contents folder, followed by the MacOS folder. Your window should look something like this:
Open up Terminal (it can be found in the Utilities folder, in your Applications folder), type "cd " (without the quotes), and then drag the MacOS folder from the Finder onto the Terminal window - it will automatically put in the full path. Hit enter once you've done that.
Next, type "cat " (again, without the quotes). Drag the "love" icon inside the MacOS folder onto the Terminal window, followed by your .love file. DON'T hit enter yet.
Type "> " (I'm going to stop reminding you about the quotes now ), followed by the name of your .love file, without the .love. So, since mine is called "examples.love", I type "examples". I'm going to refer to this as the name of your project. NOW you can hit enter.
Okay, next, type "chmod u+x " followed by the name of your project. Hit enter.
We're done in Terminal! You can quit it now. If you go back to the Finder window, you'll notice there's something new in the MacOS folder...
We don't want the love inside the MacOS folder anymore, so get rid of it. You can drop it in the Trash if you want, or drag it to another folder, but either way, you need to remove it from the MacOS folder.
See that file there, Info.plist? We need to modify it. If you have the Mac OS X Developer Tools installed, you'll have a very useful application called Property List Editor. I'm going to assume you don't, though, and edit it in TextEdit. So, open up TextEdit, and open Info.plist with it:
There's a lot of cryptic-looking text there. Most of it, we don't care about. We're looking for one specific line. Scroll down until you find the line that has "CFBundleExecutable" in it:
See the "love" below it? Change that to the name of your project.
Save and quit TextEdit. Only one more thing to do: back in Finder, change the name of the application from "love" to the name of your project.
And you're done! Here's a screenshot of my new examples.app running on a computer that has never had LÖVE installed on it:
For your testing pleasure, you can download a .dmg of examples.app here, and verify that it works for you.
Distributing Stand-Alone Applications on Mac OS X
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Super Sëxy Bonus Stuff
There are a few extra things you can do in Info.plist to make it a more seamless OS X experience:
Change the displayed name
If you run your .app after following the instructions above, you'll notice it still says "love" in the menubar where the name of the application is. This isn't a big deal if you're running fullscreen, but if you're not, you might want to change it. You can do that by going to the line where it says "CFBundleName" and changing the "love" below that to whatever you want:
Don't open .love files
If someone downloads your application and double-clicks on a .love file, your .app will try to open it. Unfortunately, it won't work. This is not desirable behavior. To change it, go to the part of Info.plist where it says <array>, and delete everything between <array> and </array>:
This will prevent your application from trying (and failing) to open .love files on its own.
Change the displayed name
If you run your .app after following the instructions above, you'll notice it still says "love" in the menubar where the name of the application is. This isn't a big deal if you're running fullscreen, but if you're not, you might want to change it. You can do that by going to the line where it says "CFBundleName" and changing the "love" below that to whatever you want:
Don't open .love files
If someone downloads your application and double-clicks on a .love file, your .app will try to open it. Unfortunately, it won't work. This is not desirable behavior. To change it, go to the part of Info.plist where it says <array>, and delete everything between <array> and </array>:
This will prevent your application from trying (and failing) to open .love files on its own.
Re: Distributing Stand-Alone Applications on Mac OS X
Funny, I had tried to do that and failed miserably. Probably missed something. Good to know that it in fact works!
For the sëxy stuff, you can also change the icon, by putting it in the Resources folder of the bundle, and setting the right name in the plist at CFBundleIconFile. Icons for Mac OS X are ICNS format, made for instance with IconComposer, or some converters found on the web.
Beware that it is generaly updated only after copying the bundle once.
For the sëxy stuff, you can also change the icon, by putting it in the Resources folder of the bundle, and setting the right name in the plist at CFBundleIconFile. Icons for Mac OS X are ICNS format, made for instance with IconComposer, or some converters found on the web.
Beware that it is generaly updated only after copying the bundle once.
"When in doubt, use brute force." Ken Thompson
Re: Distributing Stand-Alone Applications on Mac OS X
Lovely. I have never successfully done it by combining binaries. I shall follow your guide first thing in the morning.
This thread should be stickied!
This thread should be stickied!
Re: Distributing Stand-Alone Applications on Mac OS X
Hey! How come the images disappeared
Re: Distributing Stand-Alone Applications on Mac OS X
ack, sorry, my webhost has been having a little trouble
They should be up now (and if not, it's not my fault! )
They should be up now (and if not, it's not my fault! )
Re: Distributing Stand-Alone Applications on Mac OS X
Okay!!! I've followed this just now, and it works perfectly!!! Awesome!!!!
Re: Distributing Stand-Alone Applications on Mac OS X
Hey hey, great thing, dude. I made a screencast to show this in motion. You can watch it here on Vimeo:
http://vimeo.com/5520116
Otherwise you can download the video here:
http://www.acrowdapart.net/files/screen ... akeapp.mov
Have fun and thanks again, anjo. =)
http://vimeo.com/5520116
Otherwise you can download the video here:
http://www.acrowdapart.net/files/screen ... akeapp.mov
Have fun and thanks again, anjo. =)
Re: Distributing Stand-Alone Applications on Mac OS X
Oh wow, that's great! Much easier to follow than static imagesGruni wrote:Hey hey, great thing, dude. I made a screencast to show this in motion. You can watch it here on Vimeo:
http://vimeo.com/5520116
Re: Distributing Stand-Alone Applications on Mac OS X
Yeah, I would recommend anyone who wants to make a custom icon for their game on the mac use Img2icns - the free version does everything you need, namely, taking a picture and making an .icns suitable for usage as, say, a game icon.Tenoch wrote:For the sëxy stuff, you can also change the icon, by putting it in the Resources folder of the bundle, and setting the right name in the plist at CFBundleIconFile. Icons for Mac OS X are ICNS format, made for instance with IconComposer, or some converters found on the web.
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 198 guests