Helge Hafting wrote:
Angus Leeming wrote:
On Tuesday 14 June 2005 21:34, Andre Poenitz wrote:
On Tue, Jun 14, 2005 at 01:14:05PM +0200, Helge Hafting wrote:
if "%LANG%"=="" SET LANG=no_NO
lyx.exe %*
[...]
Second line starts the lyx executable and passes any parameters
to it. The script is tested on windows XP. (I don't have lyx for
windows, but the LANG test and parameter passing works fine.)
I don't think it works on older Windows versions. I've seen
%1 %2 %3 %4 %5 %6 %7 %8 %9 in this place often enough to assume
that it can't be a mere oversight of lazy programmers...
I tested with windows98 - windows98 don't support .cmd files
(they have to end in .bat instead), and there is no support for %*
So it depends on how old windows versions you want to support.
Of course %1 %2 %3 ... works on newer windows too, but limits you
to 9 arguments. (You can probably get more by using some
ugly tricks with the "shift" command...)
In that case, shouldn't it be
lyx.exe "%1" "%2" "%3" "%4" "%5" "%6" "%7" "%8" "%9"
No, that will turn
lyx.bat "file with spaces.lyx"
into
lyx.exe ""file with spaces.lyx"" and that won't work too well.
The windows shell is like most other ms software - not well planned
for corner cases.
If you pass a filename with quotes to a windows batchfile, then
the quotes are preserved as part of the %1 variable. Any
subsequent use of %1 will retain the quotes. So they shouldn't
be necessary, at least not on windows98.
Helge Hafting
Hi, Helge. Thanks for the info.
I've been testing things out and have two remaining problems:
1. Creating short cuts from the desktop and from the start menu to
c:\Program Files\LyX\bin\lyx.bat
works perfectly well, but my icons are replaced with that of a .bat file.
Any idea how to get back to the icon embedded in lyx.exe?
2 Launching LyX at the end of the installer as
!define PRODUCT_BAT "$INSTDIR\bin\lyx.bat"
!define MUI_FINISHPAGE_RUN "${PRODUCT_BAT}"
works perfectly well, but I get a bloody great cmd window in the
background. How do I make it go away? :-)
Angus