Am 17.01.2011 um 03:01 schrieb Enrico Forestieri:

> On Mon, Jan 17, 2011 at 08:45:45AM +0800, hzluo wrote:
> 
>> In addition to this exact path_prefix problem, it causes another
>> problem on Windows:
>> If the external uitility is a .bat/.cmd wrapper, it will fail. For
>> example, ps2pdf13 is a wrapper in gs/lib dir on Windows Ghostscript.
>> I have to fix the configure.py to specially detect .bat/.cmd
>> utilities and prefix "cmd.exe /c" before it. So may it be possible
>> to return to system(), or may we have a better fix?
> 
> Does the attached patch help?

You are the devils advocate? :-)

Seriously, it would help for external .bat/.cmd utilities on windows.
But in general it's a good move to refrain from using system().

To sum it up, I see four problems now:
1) bad environment variable expansion in replaceEnvironmentPath()
2) missing environment variable expansion for path_prefix
3) too early environment variable expansion on saving preferences
4) windows specific problem to be unable to execute batch/script utilities

I claim that 1) and 2) are fixed with my patch and should help the installer
a lot. The environment variables of the other preference path items are replaced
already on read of the lyxrc files. To make use of it the installer has to make
sure the environment variable LyXDir is set to the correct value when LyX 
starts.
Would that be possible?

Problem 3) is another story and can be postponed.

Problem 4) is mentioned by Hangzai as a problem in configure.py, I don't know
if QProcess::start suffers from this too.

So I propose again to apply my patch as it fixes two bugs (or regressions).
The change in behavior with undefined variables my be seen as a fix of a 
regression too.

Stephan

Reply via email to