On Wednesday 14 September 2005 20:49, Bo Peng wrote: > > Generally, I think it would be sufficient to use "open file.ps", etc for > > most viewers. That way, we get the default viewer associated with a > > particular file extension. > > I am not quite sure what you are talking about. What context is this > 'open file.ps'? Are you saying that we do not need to use 'configure' > to get path info? Open file by extension is a very common practice > under windows. Under linux/unix, we also only need to keep track of > command names, not their pathes.
C:\Program Files\LyX\Resources\lyx\configure is used to populate lyxrc.defaults in the same directory. (It also generates a few other files, but let's keep things simple for now.) Here's what configure generated for me on my Linux box for all things PDF-related: ============================================ \Format pdf pdf PDF P \Format pdf2 pdf "PDF (pdflatex)" F \Format pdf3 pdf "PDF (dvipdfm)" m \converter latex pdf2 "pdflatex $$i" "latex" \converter dvi pdf3 "dvipdfm $$i" "" \converter ps pdf "ps2pdf13 $$i" "" \converter eps pdf "epstopdf --outfile=$$o $$i" "" \viewer pdf "acroread" \viewer pdf2 "acroread" \viewer pdf3 "acroread" ============================================ It could do that because it found pdflatex, dvipdfm, ps2pdf13, epstopdf and acroread in the PATH. On Windows, however, such things may or may not be found in the PATH. Things like AcroRd32.exe and ImageMagick.exe can be found in the registry. For example, the location of ImageMagic.exe can be found by calling RegGetValue: RegGetValue(HKEY_LOCAL_MACHINE, "Software\ImageMagick\Current", "BinPath", ...) and will fill a variable with something like: C:\Program Files\ImageMagick-6.2.3-Q16\convert.exe I'm suggesting that we should use the "C:\Program Files\ImageMagick-6.2.3-Q16" part to augment the PATH that is used by LyX by augmenting the path_prefix variable that is/can be stored in lyxrc.defaults. Make sense now? Angus