Mail Archives: djgpp-workers/1999/04/11/07:19:28
On Sat, 10 Apr 1999, Laurynas Biveinis wrote:
> I think I have found acceptable solution, implemented it and it works good:
Let me serve as a Devil's advocate here, and alert you to some
potential problems.
> 1) insert @SET DJGPP=... as first line in autoexec.bat
Problem no.1: how do you know which autoexec.bat to edit? (Some
systems, like Windows 98 and NT, has them in special places under
special names.)
Problem no.2: you might get "Out of environment space" if you simply
add a variable; you need to find a way to detect such problems and
deal with them.
> 2) look for first line with "path=" but not "rem"
Problem no.3: don't forget the colon `:' that can also mark a comment
line (rarely used, but you can be sure somebody out there does it).
Problem no.4: what about those autoexec.bat files which define
multiple configurations? In these cases there's more than a single
PATH= line that needs to be changed. How do you know which ones? And
some of the configurations might not be appropriate for running DJGPP;
only the user will know which ones.
Problem no.5: some systems set PATH like this:
PATH c:\foo\bar;d:\baz
i.e., no leading SET and no equals sign.
Problem no.6: changing PATH might also overflow the environment; see
problem no.2 above.
Problem no.7: some malformed autoexec.bat files can override PATH=
settings in a later line (I saw too many of these!), so the first line
is probably not a fool-proof solution.
> And I create new autoexec.bat if there isn't one :)
> (Who will need this feature?
Lots of people, IMHO. The default in Windows 9X is not to have
autoexec.bat at all.
- Raw text -