bug-gnubg
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-gnubg] .gnubgautorc under windows


From: Holger
Subject: Re: [Bug-gnubg] .gnubgautorc under windows
Date: Mon, 13 Oct 2003 23:19:41 +0200

At 22:04 13.10.2003, Joern Thyssen wrote:
On Mon, Oct 13, 2003 at 07:30:32PM +0200, Holger wrote
> >
> >Fair enough. On win95/98 there shouldn't be any problems with write
> >access to %USERPROFILE%.
>
> If it exists, no. If the directory doesn't exist, you'll get an error on
> open().

Good point :-) gnubg should also check for existence, and create the
directory if possible.

Within limits, yes. See below.

> >I suggest the following:
> >
> >gnubg read and writes .gnubgautorc, .gnubg/* to/from
> >
> >(a) HOME on posix systems
> >(b) USERPROFILE on later windows versions
> >(c) current directory otherwise
>
> What about the datadirectory?

szDataDirectory is currently initialised to "." for windows, so item (c)
above is the current default.

Well, kind of. After the latest changes it's not necessarily ".". (and then there is -d)

> >The interesting part is "migration" of existing user's profiles. I
> >simply suggest that gnubg copies .gnubgautorc from the data directory to
> >%USERPROFILE% if non-existing in %USERPROFILE%.
>
> But only if this directory already exists (except for the "\gnubg" part). I
> wouldn't like gnubg to create folders outside of its install directory on
> my system.

What do you propose then? I think it's a severe requirement that the
user must be logged on as super user!

Hmm, let's see. Well, first, logged in as administrator doesn't help and actually brings problems. %USERPROFILE% would then be the one of the administrator, not the user's. Also, user permissions are enough. Every user has in his %USERPROFILE% full permissions.

My suggestion is something like this:
If env. var. USERPROFILE exists
        if directory %USERPROFILE%\gnubg doesn't exist
                mkdir %USERPROFILE%\gnubg
        if directory %USERPROFILE%\gnubg exists
                set it as homedirectory
else
        homedirectory = "."  or  = datadirectory

Btw, there are a few more interesting env. vars on the later Windows versions: (ex. from a German Win2k)
ALLUSERSPROFILE=C:\Dokumente und Einstellungen\All Users
USERPROFILE=C:\Dokumente und Einstellungen\username  (for completeness)
APPDATA=C:\Dokumente und Einstellungen\username\Anwendungsdaten
USERNAME=username
ProgramFiles=C:\Programme
CommonProgramFiles=C:\Programme\Gemeinsame Dateien

Regards,

Holger




reply via email to

[Prev in Thread] Current Thread [Next in Thread]