Re: How to make an application non-executable?
Re: How to make an application non-executable?
- Subject: Re: How to make an application non-executable?
- From: Brent Gulanowski <email@hidden>
- Date: Sun, 18 Jul 2004 13:30:13 -0400
>
7. From now on, when the script is run it launches Master.app -- even though
>
Master.app is located inside the Resources folder of Setup.app.
I think the problem is that you cannot use an application bundle for
Master. Is there anything stopping you from making Master a standard
unix executable file and only constructing the bundle at the last
minute?
Perhaps the dilemma (if I understand it) stems from the fact that you
want a program which will respond to double-clicks by opening a file
but then never give the user feedback that it is running. So it's only
interactive half-way, which is atypical.
Your original statement of the problem was that you wanted to make an
app non-runnable. It turns out that this is not the problem. In fact,
you want to make it invisible to the operating system as anything
other than a file, unless it is deliberately launched (i.e.: never
indirectly launched by double-clicking a file or otherwise requesting
a viewer/editor for a file of a certain type).
I have been led to believe that programs are registered lazily. So you
have to make sure that you never register the program at all.
I tried two things in the Finder: moving info.plist and removing the
".app" extension. The latter seems the best solution. But to be safe,
you should just try the full solution: remove the .app extension, move
the info.plist, and unset the executable bit. I think even if you run
a .app from within another bundle, removing the .app will cause the
app to no longer appear as a candidate to open files of type X.
Here's my experiment:
"Get Info..." on a .txt file
Look at the 'Open With" list -- includes SubEthaEdit
"Get Info..." on SubEthaEdit and remove ".app" extension
Look at the 'Open With" list -- still includes SubEthaEdit
close "Get Info..." for the .txt file
re-open "Get Info.." on .txt file
Look at the 'Open With" list -- SubEthaEdit is gone!
close "Get Info"
Add ".app" back to SubEthaEdit
"Get Info" on .txt file
SubEthaEdit is back
Does "Open With..." use the same Launch Services API to get the list
as the Script Editor? Certainly the information will be cached during
a run instance but if you change the application to have no extension
when you can be sure that the user won't have a chance to open
something else that will cause the application to be registered, I
think you are OK.
Cheers,
--
Brent Gulanowski
http://www.boredastronaut.com
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.