Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > launchPath of OS X application

launchPath of OS X application
Thread Tools
Dedicated MacNNer
Join Date: Jun 2000
Location: Dundas, Ontario, Canada
Status: Offline
Reply With Quote
May 3, 2001, 02:13 PM
 
Hello,

I am trying to write a program to encompass a unix CLI application and I am having one problem. I am putting the Unix app inside the application bundle so nobody has to worry about where it is in the file system but this leaves no way for me to determine the launch path for the application:
[NSTask setLaunchPath:] call cannot be specified properly unless I know where the parent application is.

If there is any way to get the launch path of the current application or any other way to do this (while still keeping the Unix app in the OS X app bundle) please post it here.

Once I get that working I will put the application and source on my web site for anyone to play with. It works pretty well when running from Project Builder (the current directory is set to the build directory so I know where to start) so it could make a great universal wrapper once I get this issue fixed.

Please help,
Jeff.
Spectral Class
"Shedding Light on Innovation"
     
Admin Emeritus
Join Date: Oct 2000
Location: Boston, MA
Status: Offline
Reply With Quote
May 3, 2001, 02:27 PM
 
If you've included the binary as a resource, try this:


(NSString *)[[NSBundle mainBundle] pathForResource:@"myBinary" ofType:nil];
"Against stupidity, the gods themselves contend in vain" (Schiller)
     
Dedicated MacNNer
Join Date: Jun 2000
Location: Dundas, Ontario, Canada
Status: Offline
Reply With Quote
May 3, 2001, 11:08 PM
 
Thanks Parallax!

This was EXACTLY what I was looking for!

Here is the image I was talking about.

Thanks,
Jeff.

[This message has been edited by Apocalypse (edited 05-04-2001).]
Spectral Class
"Shedding Light on Innovation"
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:56 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2