[fpc-devel] Error: Unable to create "reg.xml" file
Michael Van Canneyt
michael at freepascal.org
Fri Jan 19 14:23:53 CET 2007
On Fri, 19 Jan 2007, Marco van de Voort wrote:
> > On 1/19/07, Michael Van Canneyt <michael at freepascal.org> 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.
More information about the fpc-devel
mailing list