Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (541)
Games in Android Showcase (133)
games submitted by our members
Games in WIP (603)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Packaging .dmg files for Mac OS X  (Read 1515 times)
0 Members and 1 Guest are viewing this topic.
Offline fletchergames

Senior Devvie





« Posted 2008-07-18 19:09:52 »

I ported my Java game to Mac OS X (10.4+) and created a .dmg file for it.  I even figured out how to compress it (though the compression rate was lousy).  The file is available here.

This file works.  It mounts the drive, and you can then double click on the Jar file to run the program.

However, this is not what I want.  I want double clicking on the .dmg file to open up a window that lets you copy the whole application into the Applications folder.  Some applications do this, though others don't.  How do I make this happen?

It may be that this has nothing to do with .dmg files in and of themselves.  I'm a Newless Cluebie when it comes to Macs, so I'm not sure.
Offline fletchergames

Senior Devvie





« Reply #1 - Posted 2008-07-19 18:52:09 »

Ok, I figured out that I need to create a .app bundle.  I've looked at a variety of urls and was baffled.  Then, I tried exporting a .app bundle with Eclipse, but that didn't quite seem to work.  Finally, I downloaded a Jar Builder task for Ant and used that.  All it did was copy the files to the directory, not do anything for the bundling itself.

This should be easy.  This should be practically automatic.  What's going on here?

I have Tiger and don't have XCode.  The current version of XCode requires Leopard, so I can't download it.  So I haven't tried the Jar Builder application.

Is there a simple way to create a .app bundle?  I seem to be royally screwing it up.

Is there some alternative to creating a .app bundle?
Offline ewjordan

Junior Devvie





« Reply #2 - Posted 2008-07-19 20:48:36 »

I've never done it myself, but I know that Processing (http://www.processing.org) exports Mac (and PC and Linux) applications that you can run with a double click, and it doesn't rely on XCode or anything like that.  It's all open source, so it should be fairly easy to figure out what's going on.

Taking a browse through the source, it appears that you'd most likely be interested in the function "public boolean exportApplication(int exportPlatform)" in the file at http://dev.processing.org/source/index.cgi/trunk/processing/app/src/processing/app/Sketch.java?view=markup (search through it for that text).  It looks like there's a skeleton application that it starts from, so you might have to track that down and download it.  I'm not sure if any of what it does is Processing specific...

To me, though, it looks like the most likely thing you've missed is that you need to set your myApp.app directory to be executable ("chmod +x myApp.app") - even though the terminal won't let you execute it directly, Finder knows to call "open myApp.app" when you double click it (which will work in the terminal, but only if it's marked executable, otherwise you get a cryptic error).  Try setting that, see if it does the trick.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline oNyx

JGO Coder


Medals: 2


pixels! :x


« Reply #3 - Posted 2008-07-20 01:37:46 »

>Finally, I downloaded a Jar Builder task for Ant and used that.

You mean JarBundler, right?

弾幕 ☆ @mahonnaiseblog
Offline fletchergames

Senior Devvie





« Reply #4 - Posted 2008-07-20 04:28:34 »

>Finally, I downloaded a Jar Builder task for Ant and used that.

You mean JarBundler, right?
Yes.

And I figured out how I was screwing things up with JarBundler.  I saved a file to the wrong spot.

That was it.

Though my build file doesn't quite work right now, I'm confident that I should be able to figure it out.  I will work on it on Monday.

I was considering getting a Mac OS X 10.4 CD just so that I could get an old version of XCode (since I believe that's where it comes from).

If I fail to get JarBundler to work, I will look into Processing.  Somehow, I expect that it would be more complicated to figure out than I would like, but that's only because I thought figuring out how to package Mac applications would take only a half hour or so.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

Mr.CodeIt (25 views)
2014-12-23 03:34:11

rwatson462 (55 views)
2014-12-15 09:26:44

Mr.CodeIt (46 views)
2014-12-14 19:50:38

BurntPizza (91 views)
2014-12-09 22:41:13

BurntPizza (113 views)
2014-12-08 04:46:31

JscottyBieshaar (83 views)
2014-12-05 12:39:02

SHC (92 views)
2014-12-03 16:27:13

CopyableCougar4 (102 views)
2014-11-29 21:32:03

toopeicgaming1999 (161 views)
2014-11-26 15:22:04

toopeicgaming1999 (164 views)
2014-11-26 15:20:36
Resources for WIP games
by kpars
2014-12-18 10:26:14

Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!