[Lazarus] Cross-platform using TRegistry - how to?

Bart bartjunk64 at gmail.com
Mon May 4 09:29:56 CEST 2020


On Mon, May 4, 2020 at 12:41 AM Bo Berglund via lazarus
<lazarus at lists.lazarus-ide.org> wrote:
> structure:

> HKLM\SOFTWARE\Companyname\Applicationname\Server\(named values)
> HKLM\SOFTWARE\Companyname\Applicationname\Configuration\(named values)

The *nix way is to use .conf files (basically ini-files) for that.
IIRC you have no control over where the xml file (with the registry
keys) is placed.
There are some issues with the xml implementation of the registry.
Most important: TRegIniFile is completely broken and as of 3.2
deprecated on non-windows platforms.
Also, when you have 2 keys opened at the same time, reading/writing
may go to/from the wrong key:
https://bugs.freepascal.org/view.php?id=36842

For a cross-platform application I wouldn't use TRegistry myself.

Bart


More information about the lazarus mailing list