NSTask 'launch path not accessible'

1.3k Views Asked by At

My application requires a dylib file to be in /usr/lib/. If it is not there, the application copies the dylib to /usr/lib/ from the application resources directory. To do this, I use a helper tool, which calls /usr/bin/sudo.

Although this application works correctly on many systems, I've just received a bug report where the application apparently cannot find the launch path of the helper tool.

Does anyone have any ideas why this would work on many systems, but break on just one?

The code:

if (!libraryExists) {
    NSLog(@"dylib does not exist at usr/lib. Launching helper tool to duplicate dylib in application directory\n");         
    NSArray *args = [NSArray arrayWithObjects:helperToolPath, @"setup", nil];
    [NSTask launchedTaskWithLaunchPath:helperToolPath arguments:args];  
}

The log:

2012-01-11 09:53:59.008 Application[1860:b07] Path of helper tool set to: /Users/xx/Downloads/Application.app/Contents/Resources/HelperTool

2012-01-11 09:54:00.585 Application[1860:b07] dylib does not exist at usr/lib. Launching helper tool to duplicate dylib from application directory

2012-01-11 09:54:00.587 Application[1860:b07] launch path not accessible

1

There are 1 best solutions below

4
On

If the user is not in the admin group, they might not have permission to run your helper app. You can create a new user account without admin privileges to test this theory.