Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (757)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (844)
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 2650 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 ( 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 (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 directory to be executable ("chmod +x") - even though the terminal won't let you execute it directly, Finder knows to call "open" 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?

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  

EgonOlsen (45 views)
2018-06-10 19:43:48

EgonOlsen (27 views)
2018-06-10 19:43:44

EgonOlsen (47 views)
2018-06-10 19:43:20

DesertCoockie (210 views)
2018-05-13 18:23:11

nelsongames (127 views)
2018-04-24 18:15:36

nelsongames (126 views)
2018-04-24 18:14:32

ivj94 (867 views)
2018-03-24 14:47:39

ivj94 (128 views)
2018-03-24 14:46:31

ivj94 (779 views)
2018-03-24 14:43:53

Solater (143 views)
2018-03-17 05:04:08
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 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‑
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!