PB 6.21 - Has GetUserDirectory(#PB_Directory_ProgramData) changed?
PB 6.21 - Has GetUserDirectory(#PB_Directory_ProgramData) changed?
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?
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?
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?
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?
Thank you Fred.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]
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?
You probably updated xcode so the behaviour change for the new app
Re: PB 6.21 - Has GetUserDirectory(#PB_Directory_ProgramData) changed?
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!
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?
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?
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?
Wait, WebView2 on MacOS ?
Re: PB 6.21 - Has GetUserDirectory(#PB_Directory_ProgramData) changed?
I think it's a rumor. Not planned.
My Projects EventDesigner V3 / ThreadToGUI / OOP-BaseClass / Windows: Module ActiveScript
PB v3.30 / v5.75 - OS Mac Mini - VM Window Pro / Linux Ubuntu
Downloads on my OneDrive
PB v3.30 / v5.75 - OS Mac Mini - VM Window Pro / Linux Ubuntu
Downloads on my OneDrive
Re: PB 6.21 - Has GetUserDirectory(#PB_Directory_ProgramData) changed?
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.



