Native Registry Support

Got an idea for enhancing PureBasic? New command(s) you'd like to see?
User avatar
Jac de Lad
Enthusiast
Enthusiast
Posts: 106
Joined: Wed Jul 15, 2020 7:10 am
Contact:

Native Registry Support

Post by Jac de Lad »

As the title suggests I would like to have native registry support for windows. There's a module from ts-soft, but something official or native support would be a better solution.
User avatar
Saki
Addict
Addict
Posts: 830
Joined: Sun Apr 05, 2020 11:28 am
Location: Pandora

Re: Native Registry Support

Post by Saki »

Unfortunately
This is not Multi OS, so it will probably not exist
地球上の平和
Rinzwind
Enthusiast
Enthusiast
Posts: 638
Joined: Wed Mar 11, 2009 4:06 pm
Location: NL

Re: Native Registry Support

Post by Rinzwind »

Thats the weak excuse we got, however each platform has its own specific ways/standards. Some should be considered “essential” for the platform, and as such included.

Because of this refusal, we get to reinvent the wheel or sometimes use untested or unstable code because theres also a lack of time tested open source third party libraries. macOS has plists (also not supported in any way, not even when compiling), Windows registry, Linux config files.

This stands alone from the fact that Im not a fan at all of the registry idea and execution. It can be quite a mess. Still, it should be supported. FreePascal has it too, which is a compiler that has more architecture targets than PB.

PBs official ecosystem has to grow, supporting each platforms uniquenesses.
Marc56us
Addict
Addict
Posts: 1479
Joined: Sat Feb 08, 2014 3:26 pm

Re: Native Registry Support

Post by Marc56us »

Saki wrote:Unfortunately
This is not Multi OS, so it will probably not exist
There are a number of functions that only exist for certain platforms.
See: List of Platform-dependent Functions
There may be another reason why registry functions are not implemented.

:wink:
Bitblazer
Enthusiast
Enthusiast
Posts: 736
Joined: Mon Apr 10, 2017 6:17 pm
Location: Germany
Contact:

Re: Native Registry Support

Post by Bitblazer »

A command set which focuses on functionality could be offered and the actual implementation is platform dependant. For example a "configuration" commandset which is able to store and retrieve integer, float and text fields plus has the additional ability to store/restore the set of all current configuration settings into a portable file like an XML file. It should be based on something like an application unique identifier so you could use it to support thousands of applications/tools on the system.

If you wanted to be nice, the storage file could use some version of XML. So thirdparty tools could implement additional features like the ability to pick up all pathes used by one application in another. Some path settings are pretty common and could be shared. Personally i would implement it using an initialisation call where the applications name is passed. For windows, it would actually use a registry/localmachine/currentuser/appdata path.

Purebasic could (and should!) make application settings as portable as the applications already are.
BarryG
Addict
Addict
Posts: 3320
Joined: Thu Apr 18, 2019 8:17 am

Re: Native Registry Support

Post by BarryG »

Marc56us wrote:There may be another reason why registry functions are not implemented.
The Registry is a major functional part of the Windows platform (Windows can't even be used without it), so a Registry library should definitely be included. It's not used just to store/get app settings, but for PC configuration, tweaks, and data info about the PC's runtime state. I've never understood why it's been overlooked for so long despite many multiple repeated requests (like this new thread).
User avatar
Mindphazer
Enthusiast
Enthusiast
Posts: 341
Joined: Mon Sep 10, 2012 10:41 am
Location: Savoie

Re: Native Registry Support

Post by Mindphazer »

BarryG wrote: The Registry is a major functional part of the Windows platform (Windows can't even be used without it), so a Registry library should definitely be included. It's not used just to store/get app settings, but for PC configuration, tweaks, and data info about the PC's runtime state. I've never understood why it's been overlooked for so long despite many multiple repeated requests (like this new thread).
As you say, the registery ONLY EXISTS on Windows.
PureBasic is NOT exclusively a Windows application.

And, in my modest opinion, registery is probably the ugliest thing ever done
MacBook Pro 14" M1 Pro - 16 Gb - MacOS 14 - Iphone 15 Pro Max - iPad at home
...and unfortunately... Windows at work...
BarryG
Addict
Addict
Posts: 3320
Joined: Thu Apr 18, 2019 8:17 am

Re: Native Registry Support

Post by BarryG »

Mindphazer wrote:PureBasic is NOT exclusively a Windows application.
And as Marc56us showed, there's plenty of Windows-only features in PureBasic already. This would just be one more that enables so much more functionality for PureBasic without everyone needing to share and rely on a Registry lib or module from someone.
User avatar
Saki
Addict
Addict
Posts: 830
Joined: Sun Apr 05, 2020 11:28 am
Location: Pandora

Re: Native Registry Support

Post by Saki »

$ You can request features against payment.

So you can just make an offer 8)
地球上の平和
Rinzwind
Enthusiast
Enthusiast
Posts: 638
Joined: Wed Mar 11, 2009 4:06 pm
Location: NL

Re: Native Registry Support

Post by Rinzwind »

Payment? Thats never been discussed openly and officially too. Its all about what one person thinks is right. As said PB is unfortunately not an community effort. All we can hope for is that feature requests get some attention. Oo Fred is more than welcome to add his “price” To this topic. Seriously.
User avatar
NicTheQuick
Addict
Addict
Posts: 1226
Joined: Sun Jun 22, 2003 7:43 pm
Location: Germany, Saarbrücken
Contact:

Re: Native Registry Support

Post by NicTheQuick »

Then also please add dconf support natively. It's only fair. :-)
The english grammar is freeware, you can use it freely - But it's not Open Source, i.e. you can not change it or publish it in altered way.
User avatar
Saki
Addict
Addict
Posts: 830
Joined: Sun Apr 05, 2020 11:28 am
Location: Pandora

Re: Native Registry-Unterstützung

Post by Saki »

Rinzwind wrote:Payment? Thats never been discussed openly and officially too.
But it was, this is nothing new :!:
地球上の平和
User avatar
Jac de Lad
Enthusiast
Enthusiast
Posts: 106
Joined: Wed Jul 15, 2020 7:10 am
Contact:

Re: Native Registry Support

Post by Jac de Lad »

However, some programming languages implemented a dedicated solution for non windows platforms, storing that information in a file with similar structure. This won't port the information you can get via registry on windows to other is, but is suitable for storing information intended by the developer.

Also however, being limited to windows doesn't seem like a valid excuse to me. Thinking of SendMessage right now...
BarryG
Addict
Addict
Posts: 3320
Joined: Thu Apr 18, 2019 8:17 am

Re: Native Registry Support

Post by BarryG »

NicTheQuick wrote:Then also please add dconf support natively. It's only fair. :-)
But dconf isn't needed for Linux to run, is it? Quote from your link: "Its main purpose is to provide a backend to GSettings on platforms that don't already have configuration storage systems." So it looks like an optional storage system, rather than something vital. That's the difference. Windows can't even boot without the Registry.

As I said, Registry access isn't just for saving/loading app data as a storage system. We can already easily do that with INI files and/or the Preferences() lib. The Registry holds PC state settings that are useful to read that isn't available any other way (such as when no API exists for it).
Rinzwind wrote:Payment? Thats never been discussed openly and officially
But it has been accepted and done before (see two sponsors here -> viewtopic.php?f=14&t=70785).
Jac de Lad wrote:Thinking of SendMessage right now
Isn't CocoaMessage() the Mac equivalent of that?
User avatar
Saki
Addict
Addict
Posts: 830
Joined: Sun Apr 05, 2020 11:28 am
Location: Pandora

Re: Native Registry-Unterstützung

Post by Saki »

The discussion about this is rather pointless.

There are in itself only three criteria

1. suggest a feature and wait to see what, or whether something will come up over time.

2. make a financial offer for the implementation

3. change the programming language if the desired feature is indispensable

Common program parameters can be created in a structure and stored in the user folder.
The read and write access can be done binary and is very easy to implement, this is then Multi OS.

OS specific access to the Windows registry is a completely different matter, just special.
Last edited by Saki on Fri Sep 11, 2020 2:35 pm, edited 1 time in total.
地球上の平和
Post Reply