Page 1 of 1

PB 6.21 - Has GetUserDirectory(#PB_Directory_ProgramData) changed?

Posted: Tue Feb 24, 2026 12:13 pm
by Kukulkan
Hi

Our last app used GetUserDirectory(#PB_Directory_ProgramData) + "appName" to store settings. They were build with PB 6.02.

There, the returned path was usually "/Users/<username>/." (with a dot at the end to create .appname folder)

Now, with PB 6.21, it looks like it returns "/Users/<username>/Library/Application Support/"

I know that this is the common and recommended location, but compiled with the new PB version, our app does no longer find it's settings.

We can do a compilerif to check for MacOS and try to work around, but is this correct? Unfortunately, the old version of PB does not run on my current machines, so I can't test.

Can someone confirm that this was a regular change in PureBasic behaviour? I quick scanned the changelogs and did not find that?

Re: PB 6.21 - Has GetUserDirectory(#PB_Directory_ProgramData) changed?

Posted: Tue Feb 24, 2026 1:59 pm
by mrbungle
This is OK, the Application Support folder is blessed by macOS to store program data and you don't need permissions to write data there.

Re: PB 6.21 - Has GetUserDirectory(#PB_Directory_ProgramData) changed?

Posted: Tue Feb 24, 2026 2:10 pm
by Fred
No it didn't changed, we use this API, so it's probably the API which is returning something else:

Code: Select all

  [[NSFileManager defaultManager] URLsForDirectory:NSApplicationSupportDirectory inDomains:Domain]

Re: PB 6.21 - Has GetUserDirectory(#PB_Directory_ProgramData) changed?

Posted: Tue Feb 24, 2026 2:35 pm
by Kukulkan
Fred wrote: Tue Feb 24, 2026 2:10 pm No it didn't changed, we use this API, so it's probably the API which is returning something else:

Code: Select all

  [[NSFileManager defaultManager] URLsForDirectory:NSApplicationSupportDirectory inDomains:Domain]
Thank you Fred.

But my app, compiled with previous PB versions, still uses the home folder while the new compiled app is using the new location. Therefore I assumed that you changed something. Anyway, we will work around and try finding the old settings manually. :)

Re: PB 6.21 - Has GetUserDirectory(#PB_Directory_ProgramData) changed?

Posted: Tue Feb 24, 2026 3:09 pm
by Fred
You probably updated xcode so the behaviour change for the new app

Re: PB 6.21 - Has GetUserDirectory(#PB_Directory_ProgramData) changed?

Posted: Tue Feb 24, 2026 4:27 pm
by Kukulkan
Yes. The new client is build on a new and up to date mac. Therefore, it is using a the most recent xcode for sure. Yes, maybe this is the reason.

I wonder why others, who saved stuff to that folder, haven't reported issues yet?

Anyway, thanks!

Re: PB 6.21 - Has GetUserDirectory(#PB_Directory_ProgramData) changed?

Posted: Tue Feb 24, 2026 4:56 pm
by Fred
It's how it works with Apple: if you want full backward compat, you need to use the same tool you used to build your original software. It's a bit wierd and I got bite as well !

Re: PB 6.21 - Has GetUserDirectory(#PB_Directory_ProgramData) changed?

Posted: Wed Feb 25, 2026 1:13 pm
by mrbungle
Thanks, Fred. This is also true for web gadgets. The new SDK (26.x) will automatically use WebView2

Re: PB 6.21 - Has GetUserDirectory(#PB_Directory_ProgramData) changed?

Posted: Wed Feb 25, 2026 1:57 pm
by Fred
Wait, WebView2 on MacOS ?

Re: PB 6.21 - Has GetUserDirectory(#PB_Directory_ProgramData) changed?

Posted: Wed Feb 25, 2026 3:12 pm
by mk-soft
I think it's a rumor. Not planned.

Re: PB 6.21 - Has GetUserDirectory(#PB_Directory_ProgramData) changed?

Posted: Fri Feb 27, 2026 1:00 pm
by mrbungle
Sorry, I meant WebKit 2 -- what you use for the WebView gadget. On older versions of macOS SDK, the Web gadget is different from the WebView gadget. One newer versions, they are the same.