Stephen Harris wrote:
>> The installer searches the Registry in various ways in order to find the
>> whereabouts of sh.exe, gswinc.exe, python.exe, etc. It's blindingly
>> obvious that it should first ascertain whether these things are already
>> in the PATH. Never mind ;-)

By which I meant that I should have done so yet didn't ;-)

> I wish I were smarter so that it would be blindingly obvious to me too.
> I envision four(5) scenarios:

Think of both the registry and the PATH environment variable as simply
*hints* of where to find a given executable. The LyX installer uses the
registry to generate the \path_prefix string which, in turn, is used by a
lyx.exe process to modify its local copy of the PATH environment variable.

Note that the lyx.exe process hasn't looked for any other .exe binary at
this point.

When it comes to do so, it will look for (say) python.exe only in those
directories that are components of its own copy of the PATH environment
variable.

So, it doesn't really matter if your registry or your "global" PATH (as
visible from, say, cmd.exe as "echo %PATH%") contain ancient cruft so long
as the local PATH environment variable used by the lyx.exe process
contains the directory that actually holds python.exe. That's the beauty
of the \path_prefix for you; you, the user, have total control.

> (5.) I've had programs like flpsed and preview that have substituted
> for gsview and they aren't written to the registry or PATH. I did put
> them as file format viewers. If I had put either one in the PATH,
> the LyX installer would not have know to use them in place of
> gsview if I did not have that on the hard drive. This last point (5)
> is quite minor, I just added it to explain my AI remark.

You're getting things a little confused again I fear. The PATH tells LyX
*where* to look for something, not *what* to look for.

There is very little hard coding of the names of individual external
binaries within the LyX.exe binary. Obvious examples that are hard coded
are "sh.exe" and "python.exe" which are used to run *scripts* that *can*
by tuned by you if you wish. Examples would be "convertDefault.sh" and
"lyxpreview2ppm.py" or "lyx2lyx". 

LyX knows of all other external processes through its "converters" and
"viewers" which are defined in "lyxrc.defaults" and which can be tuned by
you (the tuning will be stored in your personal "preferences" file. 

Typical entries might be:
   \viewer pdf2 "acroread"
which says use acroread to view files in pdf2 format. Here "pdf2" is
defined as the result of a conversion process. In this case:
   \converter latex pdf2 "pdflatex $$i" "latex"

Similarly, to take your own particular example, "gsview" could reasonably
be defined as a viewer of "ps" format files, again where "ps" format files
are generated by a conversion process. Here
   \converter dvi ps "dvips -o $$o $$i" ""

Note that the conversion commands defined here do not tell LyX *where* to
look for a given executable. They tell LyX only *what* to look for. The
\path_prefix concept is the other half of the puzzle.

> Perhaps there are some benefits to using the PATH in addition
> to checking the registry, but they do not appear to me to be
> overwhelmingly obvious, sufficient to glaringly refute the inability
> to provide/add confirming evidence to the registry report that I've
> mentioned above.

LyX doesn't use the registry at all. LyX uses only the PATH environment
variable. That's not likely to change any time soon, although there *are*
plans to rewrite the LyX/Resources/lyx/configure script as a python script
(currently it's a Bourne shell script) that is capable of searching the
Registry. Ie, functionality currently in the Windows Installer and
therefore available only when you *install* LyX will be moved into the
configure script so that it's available when you *reconfigure* LyX.

> I think checking for the existence of the relevant executable on
> the hard drive with the registry, provides a lot more confirming
> evidence than the PATH, which purposely or accidentally may
> not have been written to during a LyX helper program installation.
> Though of course it would have a time trade-off.

Nonsense. Even Microsoft think that the registry was ultimately an error.
Moreover, the PATH concept works in a platform independent way on Windows,
Unix and Mac whereas the registry does not. 

> Quoting that poem -- I'm beginning to suspect you have Scot ancestry,

I do, but not on the side where the Angus comes from.

-- 
Angus

Reply via email to