Stephen Harris wrote: > On my computer, the contents of \path_prefix are a subset of the > Windows PATH environment variable because I've manually added > them. Checking the contents of PATH and comparing it to LyX's > \path_prefix to determine accuracy seems awfully smart, like AI.
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 ;-) >> Within LyX we prepend the contents of \path_prefix to the global PATH, >> creating an augmented PATH for this process and all of its children >> (spawned processes). >> > By global PATH, do you mean Windows PATH is global and > \path_prefix is local? Or that there is a LyX global path variable? Think of an operating system as a tree of processes. Let's say that LyX is launched from a cmd.exe terminal. This terminal is the parent to the spawned LyX process. A *copy* of all environment variables visible to cmd.exe is made available to the LyX process. This LyX process can modify these environment variables as it sees fit, but won't alter the environment variables (or their contents) that are visible to the parent, cmd.exe process. Should the LyX process spawn its own child processes (launching gswinc.exe, for example), then these child processes have access to a *copy* of the environment variables available to LyX *at the moment that the child was spawned*. Thus, we use the lyxrc.defaults \path_prefix string to modify the local copy of the PATH environment variable available to the LyX process. > This is where I became confused. Makes sense now? > Enrico: Yes, I noticed it. Anyway, I always edit the configure script > after >>>> installation to trim \path_prefix because I already have everything >>>> needed in my path. > > SH: Isn't he referring to his Windows PATH environment variable? Yes. He means he's tweaked this from the Start menu. Any process that's subsequently spawned will have access to a copy of the WindowsOS process' environment variables. > If you can trim some items of the \path_prefix content because > "everything needed" is already in the Windows PATH, why can't > you trim all the items in \path_prefix if you have all of the contents > of \path_prefix already included in your Windows PATH variable? You can. If LyX can find gswinc.exe already there's no need for \path_prefix to tell it where gswinc.exe is. > I questioned his statement because I thought LyX relied on its own > \path_prefix and was independent of the Windows PATH for operation > of LyX function, not that LyX is independent of an OS, or a key part of > it. What does "... I already have everything needed in my path" mean? Is this question now answered? >> What I propose to do is to add some text to the final screen of the >> Installer: [snip text...] > This looks good. By tune automatically, do you mean if the user has > exercised the option to choose an alternate installation directory? That's exactly what I mean. > The best laid plans of mice and men..., > Stephen The best laid schemes o' Mice an' Men, Gang aft agley, An' lea'e us nought but grief an' pain, For promis'd joy! Still, thou art blest, compar'd wi' me! The present only toucheth thee: But Och! I backward cast my e'e, On prospects drear! An' forward, tho' I canna see, I guess an' fear! -- Angus