Angus Leeming wrote:

Now uploaded to the wiki. It merges Uwe's and Helge's code and enables the user to specify the language of the UI by creating and running a lyx.bat file:

@echo off
if "%LANG%"=="" SET LANG=fr_FR
"C:\Program Files\LyX\bin\lyx.exe" %~1 %~2 %~3 %~4 %~5 %~6 %~7 %~8 %~9

I tested the  %~1  construct on windows98, and it failed.
Win98 turns this into literally lyx ~1 ~2 ~3 ... , I guess lyx
will ask if you want to create the file "~1" and so on. :-(

Interesting to note: %* retains any quote marks while
%~1 %~2 %~3... removes them.  There is no such thing as a %~*,
at least not in windows XP pro SP1.  Wonderfully inconsistent.
Neither work on win98, so if you want
to support win98 then %1 %2 %3 (without the ~) is the only way.

I don't think the win98 shell _can_ pass an argument containing a space
without also passing the quotes to the app.  Unless there is some
other way but I doubt it.
Testing what happens when a file is dropped onto the bat-file.
(I expect it to work the same way for other ways of using the GUI,
such as having a file extension association for .lyx)

No problem on win98, for win98 seems to pass a mangled space-less
filename (e.g. "AA~1" when the real name is "A A"), and there are
no quotes. So the inability to remove quotes doesn't matter.

Definitely a problem for winXP, for the XP GUI passes names such as
test.lyx  as-is, but a name with a space is passed as "A A" including
the quotes.  So XP need some way of getting rid of quotes,
and %~1 does that.

You may have to have one script for XP and another for win98,
unless lyx can deal with quoted filenames itself.
I don't know what other windows versions use, but I guess that
2000, 2003 and NT works like XP, with 95 and ME working like 98.
But that's just a guess.

Helge Hafting





Similarly, we now have a reLyX.bat file:

@echo off
perl.exe "C:\Program Files\LyX\bin\reLyX" %~1 %~2 %~3 %~4 %~5 %~6 %~7 %~8 %~9

Uwe, I didn't do anythiing with your fonts stuff because I don't think it should go on the same page as the UI language stuff and, more importantly, becase I was unsure whether it was finished. Why don't you start making patches against the stuff in CVS (BRANCH_1_3_X ;-)) and I'll start shoving it in.

I've just got rid of all CamelCase file names. Let's stick with lower_case ones.

Angus



Reply via email to