Access to Documents on Catalina after compile

After compiling a Xojo app, Catalina prompts for access to the Documents folder the first time you run the app. Whenever you compile the app, you are prompted again. Assigning Full Disk Access to the App on the Privacy panel of Security & Privacy Control Panel does not help.

Any ideas?

All I’ve got is sarcasm and disappointment, sorry.

The above answer has come to my mind, too…

What you could try is to CodeSign your DebugBuilds (both DebugRun’s and Beta-Builds). Here’s an idea and example.
I just can say that a non codesigned DebugRun is behaving differently on macOS Catalina compared to a built-and-notarized app, and compared to a codesigned DebugBuild. That could make a (or ‘the’) difference.

Just be aware that some of your users will deny that. And later ask for your support: “Why can’t your app read the document(s)”?.

The biggest issue we’ve had is that the checks like FolderItem.Exists, … happily says “yes, all fine”. Depending on how you’re trying to read the file(s), you might just get an “empty” content. So you have to catch that possible situation. And ask the user to reconsider allowing access.

btw: Does anyone know if it’s possible to programmatically open the System Preferences in the “correct location”?
When needing Automation, I know how to open System Preferences at “Privacy - Automation”: Example.

But I haven’t found a way (yet) to open it right there where the user needs to allow access to (Documents / Desktop / Downloads / …) Folders in Catalina… It wouldn’t surprise me if there is no way (happily joining @Sam Rowlands with sarcarsm and disappointment). I’d love to be proven otherwise :wink:

In theory; you should be able to use folderitem.isReadable and folderitem isWriteable to see if you have access to the folder; however when Apple first introduced ACLs it was possible to have an ACL that denies access to a folder, while .isReadable and .isWriteable would tell you that it’s good. So I can’t guarantee that this will work.

Which leads us to the next issue, which is how to ask the user to give access?

[quote=465946:@Jürg Otter]btw: Does anyone know if it’s possible to programmatically open the System Preferences in the “correct location”?
When needing Automation, I know how to open System Preferences at “Privacy - Automation”: Example .[/quote]
Apple Script used to be the way to do these things, but I know in recent years as Apple has decried “Automation” (as well as 3rd Party developers) to be the enemy of Security, you might be able to get this to work but I’m pretty certain that you’ll not be allowed on the Mac App Store.

Read this thread and follow the links to see how some others are trying to solve this.
https://twitter.com/steipete/status/1200408801087819781

This is just insane.

Ask permission to run an Application,
Ask permission to read,
Ask permission to write

What permission(s) will we have to ask in 10 16 ?
(to breath ?)

Thanks. I just don’t see any “links to follow”, or where to get more information about that.
And it looks like it’s about “Full Disk Access”, and not the new Catalina-nags for just about every single folder such as Documents, Desktop, …
I don’t want to ask our users for “Full Disk Access”. But I’d love to be able to point them to the right spot in System Preferences in case of needing Access to Documents/Desktop/Downloads/whatever.
Or even better: A way in code (similar to Automation - there is a Declare to query the status) to detect if the app has permission to “Downloads”, and if not: redirect to the exact right spot in System Preferences to allow “Downloads” for this app.

This is one I’ve submitted as both a bug and a feature request to Apple since it affects apps built in ALL languages, not just Xojo.