Reputation: 519
I have an application which needs to run an external program.
I have included this program as an Embedded Framework
. When archived, it appears at the location %AppRoot%/Contents/Frameworks/MyExternalApplication.
How can I run this program from my app's code without using an absolute path? I'd like to run in both release and debug.
Thank You!
Upvotes: 4
Views: 1947
Reputation: 122381
You can run the executable by using an NSTask
object or the posix_spawn()
function.
You can use the NSBundle
class to find the absolute path of the executable. See this article for details.
Notes:
Contents/MacOS
, as documented here.Upvotes: 7