For some reason when I'm attempting to run a task via NSTask I receive the error message: "launch path not accessible".
My app is running as root. And if I type the EXACT same command in terminal, it runs fine, so I'm a bit confused.
My application copies a tool, called relaunch, to NSTemporaryDirectory()
. If I try to run it from here, I get "launch path not accessible". Here is the strange thing, if I manually copy the tool to my desktop, then hardcode the path in NSTask, it will execute properly. And i have 0 idea why.
Anyone know why this is occurring?
Note: Just FYI, trying to get Sparkle to work from github.
Here is the code:
@try{
[NSTask launchedTaskWithLaunchPath:relaunchPath arguments:[NSArray arrayWithObjects:pathToRelaunch, [NSString stringWithFormat:@"%d", [[NSProcessInfo processInfo] processIdentifier]], nil]];
}
Where
relaunchPath = @"/var/folders/zz/zzzivhrRnAmviuee+++++++++++/-Tmp-/relaunch";