Can't Create a Folder in SpecialFolder.ApplicationData

A couple of months ago I had half a dozen reports about my app not starting correctly. Turned out that the app couldn’t write to Application Support. The users used the uninstaller, reinstalled and everything was okay. I got the reports within a day or two. And then the problem never showed up again. macOS…

Seems like if macOS learned to allow the application to do that after some attempts.

Yes, kLWBundleIDStr is the same as the app’s bundleID.

I suspect the problem is they’re using jamf to handle their installs, and something in jamf may not be configured correctly.

I’ll also send them a beta version with more error checking, we’ll see what the exact error is.

Thanks!

And unfortunately, whenever I try to add Sam’s code to the app, Xojo crashes when autofilling on App.i

Feedback #65181

Try with an older version. I think that the bug already has been fixed.

1 Like

Because when the User folder is on the Boot Drive the Volume Name is irrelevant.

/Users/rowlands/Library/Caches

However when it is on a different volume it becomes

/Volumes/External Disk/Users/rowlands/Library/Caches

Apple’s submission tool accesses the Users folder, and chokes if the user folder path contains a space in it.

Odd, but we’re getting used to Odd issues in iOS macOS. I’ve only ever seen the TemporaryItems folder inaccessible and have experienced it myself. Rebooting the Mac seemed to fix that one.

Nice.

I apologize, I haven’t tested that code, it was only my interpretation of how I think it could be done, I am sorry for causing you grief.

And today I get this report from a user where the user doesn’t have access to the documents folder:

2021-07-04 14:27:58 An error happened:
2021-07-04 14:27:58 Class/Method: DefaultExportLocation.GetExportFolderNumbered
2021-07-04 14:27:58 Time: Sunday, July 4, 2021 2:27:58 PM Central Daylight Time 3923617
2021-07-04 14:27:58 Type of Error: IOException
2021-07-04 14:27:58 Error Number: 1
2021-07-04 14:27:58 Error Message: You don’t have permission to save the file “Mail Archiver X” in the folder “Documents”.

image

Sadly that’s actually “Normal”.

In App Wrapper, go to the Capabilities Page, under the files and folders heading, enter a “Usage message” next to the “Documents” folder. Then the user should be asked, next time they want to save files to the Documents folder.

What is unclear to me is exactly which “Usage Messages”, actually need to be filled. Sometimes you don’t need to fill it it, and sometimes you do, AppleScript YOU must fill in. I’d refer to Apple’s documentation, but it doesn’t always state and there’s no guarantee it’s up to date.

You are probably correct. Normally, my app needs full disk access anyways so I don’t often get those stupid messages - at least for my own app.

1 Like

I am not 100% sure either, guessing is more like it.

Again, I’ll complain that it would be nice if we had documentation that made this clear and that we could trust, but that would eat into Apple’s profitability, so we flounder around like fish out of water instead.

Let me know if it does help.

Also talk to @Thomas_Tempelmann as he’s implemented a brilliant UI for aiding customers to enable Full Disk Access from your Mac application (Albeit you may need to use Twitter or e-mail to get ahold of him).

You mean like the well known “Macintosh HD”? Even if they are no longer named that way (I don’t really know), they forgot their root…

M1 Boot disk is named… “Macintosh HD”…

So what?

1 Like

Oh yes, obvious (but I forgot anyway…).

Thanks for confirming. I’m not even using Big Sur, so wondered. Additionally, I read (perhaps 2 years ago, already), that Apple wanted to get rid of the words “Macintosh” and “Mac” (“Mac OS X” becoming “OS X” and other things), including “Macintosh HD” could default to something else and “About this Mac” could become “About this computer”. But I think I read fake information.

There’s also another way, keeping the current Xojo version (avoids quitting and relaunching). Write “app”, then Return (add a new line), write the remaining on the second line (e.g. “.ExecutableFile”) and then join both lines.
It has to become a habit, because in the beginning, you won’t realise you typed the period by mistake and it’s too late.

The IT person who’s installing Lightwright is using Composer, he is wondering if the owner permissions he’s setting are the problem. My instant reaction was “yeah, that’s probably what is screwing things up”. Here’s a screen shot he sent:

And the problem was, according to the IT person: “The policy was pointing to a folder that doesn’t exist on the lab machines as it was a carry over from my creation machine. The weird thing is that was never an issue on Catalina (and still isn’t) but Big Sur doesn’t like that.”

1 Like