Game Development Community

Bundling App Contents

by Seth Willits · in Torque Game Engine · 11/21/2004 (5:20 pm) · 8 replies

What steps do you guys use to put all of the scripts inside of the application's bundle rather than having it all over the place? Is there a resource on this? (The search doesn't work very effectively some times.)

#1
11/21/2004 (6:56 pm)
I believe David Chait did that work under contract for both 21-6 and BraveTree. He claims it was a clever piece of work that was not easy to do. In any event I do not belive there is an existing resource that explains how it is done.
#2
11/21/2004 (7:26 pm)
Hmm... it seems pretty doubtful that it wouldn't easy... but then again, what do I know about Torque? I would think it'd just require some fiddling of the default directory and some paths.
#3
11/21/2004 (8:40 pm)
Sounds very much like concatenating a zip archive on the end of a self extracting exe stub. Without looking at the code I'm not 100% sure, but it'd probably just be an extra couple of lines :-)

In fact it's something I've been meaning to look at for a while, but alas real life has intervened and I don't have quite so much free time as I once did...
#4
11/21/2004 (8:45 pm)
Simon, no, he's asking about stuffing the main.cs and everything else inside the game.app directory (Mac apps are not just an "exe" - they're a series of files and folders). It's very different from appending the contents to the end of a zip or an exe. It's more like adjusting the start directory of any and all file access ("chroot" or "chdir" from the beginning).

I'd love to see a solution to this.
#5
11/21/2004 (9:34 pm)
Right. I think I'm going to look at it. I can't imagine it would be difficult, but if Dave Chait says it is...
#6
11/22/2004 (3:17 am)
Seth, look at the CFURL (or whatever the URL/file access stuff is called, it's been a while...:)) on the Apple's dev site, and you'll have to modify the mac platform layer, mainly the the stuff that sets the working directory.
Ideally, you probably should ifdef that code for release/public builds vs internal builds, unless you always want to pack your stuff in the .app bundle.
There is nothing really magic about it from a MacOS X pov, as you probably know, since it's the standard way to go, but you do need to change the working directory stuff... (hmm, might have to touch some common code, again, it's been a while. If that's the case, some more ifdefing ;))
#7
11/22/2004 (6:35 am)
Yeah exactly.
#8
11/22/2004 (4:34 pm)
@seth,

Have you searched the mac forum ? I've already seen this thread before.

But, IMHO, the way to set this would be in the console part of the engine. Somewhere it will need to get your current directory and stablish it as root. All you have to do would be append your 'gamename.app' to that string and stuff things inside.