I was trying to avoid bogging down the list with a long and drawn out
description, but here's the $.25 tour of the problem:
My main application allows users to deploy their "projects" as either
"standalone application" . With option B, they may deploy to a program
called "ABC.app". This would have the web folder embedded in the
Contents/Resources structure behind-the-scenes. Once the App is
created, since I can't control where the user might put it or what
they might rename it to, I was left with a couple of choices:
1. Tell the user they can't rename their ABC.app once it's built (lame
and non-Mac like)
2. Create an "installer" with the built mini-app and force users to
install them into one location and never change it (slightly less
lame, but still very non-Mac like)
3. Make a best effort to figure out what the app is called at runtime
so I can locate the HTML pages in its Contents/Resources, without
scanning the whole drive looking for it.
Needless to say, I'm leaning toward #3. :)
On Jun 30, 2008, at 2:46 AM, Johnny Kewl wrote:
----- Original Message ----- From: "Roby Sherman" <email@hidden
To: "Florijan Stamenkovic" <email@hidden>
Cc: "JavaDev" <email@hidden>
Sent: Sunday, June 29, 2008 6:20 PM
Subject: Re: Getting my Java App's "name.app" at runtime.
Thanks for the reply. Unfortunately, the mini-app is standalone so
I'm still stuck. :)
What is the "little bit of code" that deploys the application.
If its done from the main application, ie your own jarbundler, then
why cant you remember the location.
... its a strange requirement... "A user is going to stick a file,
somewhere on disk, and call it something unknown, how do I find it"
There has to be some kind of registry... either you create the
application and remember where you put it, and the name... or the
application has to run once on its own and register itself
somewhere... the JNDI idea.
Heres a crazy thought.. the user (you give them the code) creates a
file association... from your program, you create a file called
"loco.miniapp", and launch it.
The users app will run it and put its own location (got from the
classloader as suggested before) and puts it in the file. Your app
reads it and gets the location... but this will only work for one
self discovering application.
Then you getting OS specific, I assume apple only is ok.
I have no idea what you trying to do... but think about this, Java
does have an Ex classloader mechanism, Apple probably has it own way
of doing it.
But the idea is that the Java bundle becomes just a "link" to the
app... your application can see the classes in the "plugin app",
which is stored externally, and the app name is now the class name
which can be kept simple like.... "my.app.start"... and thats what
the user types into the main app.
Then your user app can use those class loader tricks to discover the
location. Probably the way to go, because it will work on any OS.
Just need to find out how that works on Apple... on other systems
the user just needs to drop the Jar into the Ex folder in the JRE...
Dont worry... its got to be easier than finding oil ;)
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden