I have an app running in OS X that needs to launch another executable with a GUI and then close itself leaving this other GUI intact.
Right now I’m launching the other executable with fork then execve and closing the app that launched it but the new executable keeps the menu bar from the app that just closed. This stops me from running the original app until I close the window for the executable.
The only thing I’ve found is people saying to use nohup but from what I understand that just stops the program from closing when the parent closes?
EDIT: After looking into the functions in the first answer, I realized I should have included some more details. I am using OS X 10.8 which seems to have deprecated a lot of the File Manager API. Another important detail is that I need to pass command line arguments to the executable.
As it turns out, my executable I was trying to launch, which was originally in another app package, was using the plist file for the application that was launching the executable. I had the executable in the Contents/MacOS folder where the executable for the original application resided. After putting the other executable in its own app package, I was able to use fork and execve on the executable within its own package to launch it properly.