Steve Crossman wrote:

When the app runs from the Downloads folder in macOS 10.12, it cannot properly locate this folder

Perhaps not as satisfying as fixing the security issue but the app could notify the user ( put up a dialog ) if it finds itself being launched in the Downloads directory ( i.e. ask them to drag the app to the desktop etc. )

The ingredients are:

NSDownloadsDirectory + NSUserDomainMask plus a call to:

[[NSFileManager defaultManager] URLsForDirectory: NSDownloadsDirectory inDomains: NSUserDomainMask];
( alternatively use FD_SpecialDirectoryCreateCFURL and pass those same two constants )

convert that url to a path and compare to the path for the application's parent folder.
which you can get by calling:

NSURL    *parentURL  = [[[NSRunningApplication currentApplication] bundleURL] URLByDeletingLastPathComponent];

In Xcode it would look like the following. It could easily be built to do the compare and pass back a boolean. 

    // get the URL to the user Downloads directory
    NSFileManager *fm    = [NSFileManager defaultManager];
    NSArray *urls        = [fm URLsForDirectory:NSDownloadsDirectory inDomains:NSUserDomainMask];


    // Get the parent directory where this application is running
    NSURL    *parentURL  = [[[NSRunningApplication currentApplication] bundleURL] URLByDeletingLastPathComponent];


    // Print both to log for comparison ( or do compare and pass back a boolean )
    NSLog(@"%@\n%@",[[urls objectAtIndex:0]path], [parentURL path] );


To unsubscribe, send ANY message to: futurebasic-unsubscribe@... To access the list archives, go to: