Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-devel / 2007-01

Error: Unable to create "reg.xml" file

11 messages · 5 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

I started getting this message in my Lazarus applications since the last 2 weeks. It happens very seldom, but still strange. I don't use xml files at all in my application and don't have a reference to a "reg.xml" in any of my code. The applications are run from my HOME directory where I have full read/write access.

Anybody got some ideas?

I used FPC 2.1.1 (lastest SVN) and Lazarus (lastest SVN) under Linux. Lazarus is compiled against the GTK1 widget set. My applications also use the GTK1 widget set.

PS:
I did a quick search of the FPC src directory and found one reference to reg.xml in the /src/fcl/inc/xregreg.inc file.

Graeme Geldenhuys There's no place like S34° 03.168' E018° 49.342'

Reply by email

Bogusław Brandys
to Graeme Geldenhuys
Graeme Geldenhuys wrote 20 lines
Hi, I started getting this message in my Lazarus applications since the last 2 weeks. It happens very seldom, but still strange. I don't use xml files at all in my application and don't have a reference to a "reg.xml" in any of my code. The applications are run from my HOME directory where I have full read/write access. Anybody got some ideas? I used FPC 2.1.1 (lastest SVN) and Lazarus (lastest SVN) under Linux. Lazarus is compiled against the GTK1 widget set. My applications also use the GTK1 widget set. PS: I did a quick search of the FPC src directory and found one reference to reg.xml in the /src/fcl/inc/xregreg.inc file.

TRegistry under Linux is simulated using XML file (this is afaik TXMLRegistry class inside)

FPC 2.1.1 is a proper version for registry under Linux.2.0.4 had bugs here.

Regards
Boguslaw

Reply by email

Graeme Geldenhuys
to Bogusław Brandys
Bogusław Brandys wrote
TRegistry under Linux is simulated using XML file (this is afaik TXMLRegistry class inside) FPC 2.1.1 is a proper version for registry under Linux.2.0.4 had bugs here.

I'm using FPC 2.1.1! I found when the problem occurs. When a form is loaded or closed, it's state is saved. This is handled by the tiOPF framework. The tiOPF framework uses TRegINIFile for storing that State information. I thought it would use a .ini file as supplied by tiOPF, instead of a hard-coded reg.xml file as defined in FPC.

If I can't get this sorted in FPC, maybe I should change tiOPF to rather use the TINIFile class under Linux instead. At least that will mean anybody using tiOPF with FPC 2.0.4 will also be able to save their Forms State information, where currently they can't.

Graeme Geldenhuys There's no place like S34° 03.168' E018° 49.342'

Reply by email

Michael Van Canneyt
to Graeme Geldenhuys
Graeme Geldenhuys wrote 13 lines
On 1/19/07, Bogusław Brandys wrote: > TRegistry under Linux is simulated using XML file (this is afaik > > TXMLRegistry class inside) > > > > FPC 2.1.1 is a proper version for registry under Linux.2.0.4 had bugs > here. > > I'm using FPC 2.1.1! I found when the problem occurs. When a form > is loaded or closed, it's state is saved. This is handled by the > tiOPF framework. The tiOPF framework uses TRegINIFile for storing > that State information. I thought it would use a .ini file as > supplied by tiOPF, instead of a hard-coded reg.xml file as defined in > FPC.

I fixed a bug in TInifile only yesterday. Maybe that is it. Loading form state should work, saving may still exhibit the problem.

Show quoted text 5 lines
> > If I can't get this sorted in FPC, maybe I should change tiOPF to > rather use the TINIFile class under Linux instead. At least that will > mean anybody using tiOPF with FPC 2.0.4 will also be able to save > their Forms State information, where currently they can't.

I would recommend using TIniFile anyway, even on windows. Using the registry is Bad (tm). At my job we started with the registry, but in the end moved everything to Ini files. Much more practical, and portable to boot.

Michael.

Reply by email

Graeme Geldenhuys
to Michael Van Canneyt
Michael Van Canneyt wrote
I fixed a bug in TInifile only yesterday. Maybe that is it. Loading form state should work, saving may still exhibit the problem.

Thanks, I'll get another FPC update and retest. The problem occurred mostly at the save stage (closing a form).

I would recommend using TIniFile anyway, even on windows. Using the registry is Bad (tm). At my job we started with the registry, but in the end moved everything to Ini files. Much more practical, and portable to boot.

I fully agree! I hate the registry. I have actually just completed the change in tiOPF to rather use TIniFile under Linux, even if you call gINI or gReg singleton functions in the tiOPF framework. Unfortunately I can't change the gReg function under Windows as there are other users relying on the Registry for settings.

As for my own apps and any user settings, I call gINI which stores them in a .ini file on both Windows and Linux.

Graeme Geldenhuys There's no place like S34° 03.168' E018° 49.342'

Reply by email

Marco van de Voort
to Graeme Geldenhuys
Show quoted text 21 lines
On 1/19/07, Michael Van Canneyt wrote: > I fixed a bug in TInifile only yesterday. Maybe that is it. > Loading form state should work, saving may still exhibit the problem. Thanks, I'll get another FPC update and retest. The problem occurred mostly at the save stage (closing a form). > I would recommend using TIniFile anyway, even on windows. > Using the registry is Bad (tm). At my job we started with the registry, > but in the end moved everything to Ini files. Much more practical, and > portable to boot. I fully agree! I hate the registry. I have actually just completed the change in tiOPF to rather use TIniFile under Linux, even if you call gINI or gReg singleton functions in the tiOPF framework. Unfortunately I can't change the gReg function under Windows as there are other users relying on the Registry for settings. As for my own apps and any user settings, I call gINI which stores them in a .ini file on both Windows and Linux.

There is one dangerous caution against overzealous inifile use: with lessened privileges (a situation that is going to become more frequent under Vista, iow, user has no admin rights), apps can't write to "program files/" with the default permissions, and must use special directories for this.

Reply by email

Michael Van Canneyt
to Marco van de Voort
Marco van de Voort wrote 26 lines
> On 1/19/07, Michael Van Canneyt wrote: > > > I fixed a bug in TInifile only yesterday. Maybe that is it. > > Loading form state should work, saving may still exhibit the problem. > > Thanks, I'll get another FPC update and retest. The problem occurred > mostly at the save stage (closing a form). > > > I would recommend using TIniFile anyway, even on windows. > > Using the registry is Bad (tm). At my job we started with the registry, > > but in the end moved everything to Ini files. Much more practical, and > > portable to boot. > > I fully agree! I hate the registry. I have actually just completed > the change in tiOPF to rather use TIniFile under Linux, even if you > call gINI or gReg singleton functions in the tiOPF framework. > Unfortunately I can't change the gReg function under Windows as there > are other users relying on the Registry for settings. > > As for my own apps and any user settings, I call gINI which stores > them in a .ini file on both Windows and Linux. There is one dangerous caution against overzealous inifile use: with lessened privileges (a situation that is going to become more frequent under Vista, iow, user has no admin rights), apps can't write to "program files/" with the default permissions, and must use special directories for this.

Yes. A well known issue:

This is exactly why we moved away from the registry, because the HKEY_LOCAL_MACHINE (the key for installation-wide settings) is not writable by normal users since NT, and writing the same config to all HKEY_USER keys is not desirable or feasible (roaming profiles etc). A config directory can be made read/write for all users.

Michael.

Reply by email

Vinzent Hoefler
to Marco van de Voort: There is one dangerous caution against overzealous inifile use: with lessened privileges…
Marco van de Voort wrote 5 lines
There is one dangerous caution against overzealous inifile use: with lessened privileges (a situation that is going to become more frequent under Vista, iow, user has no admin rights), apps can't write to "program files/" with the default permissions, and must use special directories for this.

Yes, and the hell they should, multi user OS's are out there for how long? Thirty years? Almost fourty?

So - writing application specific data to the same, single location for each and every user is inappropriate for most applications anyway. This leaves us with the "AppData" (or whatever it's called) directory in the user's home directory - or the local registry keys.

Without proper rights you can't write to the "global" registry keys either.

So I don't see the difference apart from the usual "Is it better to back up thousands of ini files in different locations, or a single blob aka. registry which is several megabytes of a mixture of important data and junk?" question.

Vinzent.

Reply by email

Michael Van Canneyt
to Vinzent Hoefler
Vinzent Hoefler wrote 6 lines
On Friday 19 January 2007 13:23, Michael Van Canneyt wrote: > HKEY_USER keys is not desirable or feasible (roaming profiles etc). A > config directory can be made read/write for all users. A registry key can be made that, too.

I know.
But the average IT admin of our clients doesn't know how to do that. He does know how to operate the windows explorer and click right, ask properties and set permissions (and even that is voodoo for many of them).

Anyone who is convinced that the registry is OK is welcome to sit for a day at the helpdesk here and give it a try. Switching to ini files was mainly done at the request of our helpdesk :-)

Michael.

Reply by email

Graeme Geldenhuys
to Marco van de Voort: There is one dangerous caution against overzealous inifile use: with lessened privileges…
Marco van de Voort wrote 7 lines
> As for my own apps and any user settings, I call gINI which stores > them in a .ini file on both Windows and Linux. There is one dangerous caution against overzealous inifile use: with lessened privileges (a situation that is going to become more frequent under Vista, iow, user has no admin rights), apps can't write to "program files/" with the default permissions, and must use special directories for this.

No matter where the application is located, the .ini file is created in the users HOME directory, be that Windows or Linux. The .ini file only stores custom user settings, so the HOME directory is appropriate for that. You don't want to mix different users settings in a single .ini file!

Graeme Geldenhuys There's no place like S34° 03.168' E018° 49.342'

Reply by email