Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Quicktime 7.0.4 kills Java application



Bill Janssen wrote:

>It would be nice to be able to do this in the application, though, so
>that an installer wouldn't be necessary.  Is it possible to wrap the
>binary executable in an app with a script that could check the
>environment, then run the executable?

You could create the app-bundle itself with an executable which is only a
shell-script (no native launcher at all), and which copies the current
JavaApplicationStub from its JavaVM.framework/Resources location into the
app-bundle.  Then the script removes itself (or renames itself, or
otherwise takes itself out of commission) and uses the 'exec' shell builtin
to run the newly installed stub in the same process.  See the 'exec'
builtin in 'man sh'.

There are security implications to doing this, so it may be safer to have
an installer do a post-flight.  But there are ways to identify who runs the
app-bundle script, too, and only let admin-users do it (members of 'wheel'
group).  Of course, a knowledgeable but unprivileged user could edit the
script to circumvent this precaution.  Yes, it's an escalating arms-race,
so you just have to draw the line somewhere and ship it.

There are also viability implications, if a machine happens to have a wide
range of bootable partitions, and an app gets installed under an OS version
whose launcher stub happens to be incompatible with at least one of the
other bootable partitions.  Developers are most likely to have multiple
bootable partitions, so keep that in mind when explaining viability
work-arounds to a target audience.

Shell-scripts as app-bundle executables works as far back as 10.2, as I
recall.  It does NOT work before 10.2, in my experience.


I don't think it would be possible to write a Java app that copies in its
own launcher stub, because in order to run it, you'd need a launcher stub
already in the app-bundle.  But that's a Catch-22 with the very problem
this strategy is trying to solve.

  -- GG


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.