PB 6.21 - Has GetUserDirectory(#PB_Directory_ProgramData) changed?

Mac OSX specific forum
User avatar
Kukulkan
Addict
Addict
Posts: 1418
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

PB 6.21 - Has GetUserDirectory(#PB_Directory_ProgramData) changed?

Post 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?
mrbungle
Enthusiast
Enthusiast
Posts: 188
Joined: Wed Dec 30, 2020 3:18 am

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

Post 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.
Fred
Administrator
Administrator
Posts: 18529
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

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

Post 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]
User avatar
Kukulkan
Addict
Addict
Posts: 1418
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

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

Post 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. :)
Fred
Administrator
Administrator
Posts: 18529
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

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

Post by Fred »

You probably updated xcode so the behaviour change for the new app
User avatar
Kukulkan
Addict
Addict
Posts: 1418
Joined: Mon Jun 06, 2005 2:35 pm
Location: germany
Contact:

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

Post 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!
Fred
Administrator
Administrator
Posts: 18529
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

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

Post 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 !
mrbungle
Enthusiast
Enthusiast
Posts: 188
Joined: Wed Dec 30, 2020 3:18 am

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

Post by mrbungle »

Thanks, Fred. This is also true for web gadgets. The new SDK (26.x) will automatically use WebView2
Fred
Administrator
Administrator
Posts: 18529
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

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

Post by Fred »

Wait, WebView2 on MacOS ?
User avatar
mk-soft
Always Here
Always Here
Posts: 6595
Joined: Fri May 12, 2006 6:51 pm
Location: Germany

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

Post by mk-soft »

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
mrbungle
Enthusiast
Enthusiast
Posts: 188
Joined: Wed Dec 30, 2020 3:18 am

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

Post 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.
Post Reply