----- Original Message -----
From: "Enrico Forestieri" <[EMAIL PROTECTED]>
To: <lyx-users@lists.lyx.org>
Sent: Monday, December 12, 2005 8:48 AM
Subject: Re: There's Something About Textclass.lst [WinXP, installing into]
Angus Leeming <[EMAIL PROTECTED]> writes:
From an MSYS terminal window (maybe even a cmd.exe one for all I know):
cd "C:/Program Files/LyX/Resources/lyx"
<PATH TO>/sh.exe configure
That will generate the missing files.
Angus, what about a configure.bat script?
This particular subject was about the Uwe .51 complete installer.
The OP had already tried "sh.exe configure" and it didn't work.
The OP does not have admin rights and that most likely is the
problem.
I do like your .bat idea. I have a configure file on my E: drive for
1.3.6 stable. The OP was able to install 1.3.6 because it does not
require admin rights. I think he should utilize his 1.3.6 configure
script and copy it to the 1.3.7pre5 Lyx\resource\lyx directory,
because I think it is very likely that if you examine your 1.3.7pre5
configure file you'll see that the Path preview section is inflated
by a ~two hundred characters.
Or you could edit Path prefix later if you use the 1.3.7pre5
configure. Or maybe leave it as it may not cause damage and just
be a hidden unsightly blemish.
I don't think gsview installs in the .51 series without admin rights.
So I found one, preview, which is shareware that does not appear to
use the registry: http://www.lib-sys.com/preview.htm
Since ghostscript creates the .ps file, you only really need a viewer
to print the file and maybe save it to another location than Lyx's temp.
So I changed the LyX default temp dir in order to use this .bat file,
opening up a dos prompt and changing drives from the c:~~ prompt
by typing E: <enter> (I installed LyX on E: in my non-admin rights test)
cd e:\preview\temp
cd lyx_tmpdir*
cd lyx_tmpbuf*
copy *.* e:\preview\temp
e:\preview\preview.exe
and one can use the file menu to open the contents of e:\pview\temp.
I clean up afterwards by using nuke.com, a common dangerous utility.
deleteps.bat:
E:\preview\nuke.com e:\preview\temp
md temp
(a screen will appear asking the user to type Y for yes/proceed)
Perhaps it can also solve the problem that the configure script is not
launched in 137pre5 at installation time (I also have this problem).
.bat or .cmd files can be very useful in Windows as scripts are in Linux,
and they are easy to create or modify slightly. So for instance your
script uses Cygwin; the Windows default is sh.exe and sed.exe originating
from C:\msys\1.0\bin so a less elegant batfile than yours could read, if a
prefab configure.bat file is included in the lyx1.3.7pre5 package, which
unpacks to the same directory as the installation directory (since the user
might change the default from c:\program files\lyx, which has its configure
in ~\lyx\resources\lyx). The user can also open and type from the dos
prompt from the location he has chosen for the Lyx installation:
(assuming default install directory for Msys)
config1.bat could contain a few simple alternatives:
1. C:\msys\1.0\bin\sh.exe configure (if config1.bat is in the same
directory)
or
2. C:\msys\1.0\bin\sh.exe "C:\program files\lyx\resources\lyx\configure"
or
3. C:\msys\1.0\bin\sh.exe c:\lyx\resources\lyx\configure
The reason I went into this is just in case a current reader has this
problem which is solved with "sh.exe" configure, for a now fix.
They can open Notepad, copy and paste the correct line for their install,
change the default saving from .txt to "all files" and then use Save as
to name the config1.bat as they please (ending with .bat though) and
save it into the proper lyx\resources\lyx directory for their installation.
Open a dos prompt, navigate to the directory referred to above, and type
config1.bat <enter> at the prompt. Actually you can run 2 or 3 from what-
ever directory you have saved config1.bat to, from the dos prompt, for
instance from C:\documents and settings\username config1.bat <enter>
Here is the one I use. It extracts the \path_prefix from configure to
properly set up the path before calling sh.exe configure.
Please, manually join the lines ending with \ to the line following them.
I had to resort to break them this way as the gmane interface does not let
me post lines longer than 80 chars.
--------8<--------8<--------8<--------8<--------8<--------8<--------8<--------
@echo off
if "%OS%"=="Windows_NT" goto win2k
goto usage
:win2k
setlocal enableextensions
if not exist "configure" goto noconf
if "%ComSpec%"=="" goto nocmd
if "%windir%"=="" goto nocmd
:: Make sure native windows commands are (initially) ahead in the path
for /f "usebackq tokens=* delims=" %%A in (`echo %ComSpec%`) do \
set PATH=%windir%;%%~dpA;%PATH%
:: Extract \path_prefix from configure and prepend it to the path
for /f "usebackq tokens=2 delims= " %%A in (`type configure ^| \
find "path_prefix"`) do set pathprefix=%%A
set pathprefix=%pathprefix:"=%
set pathprefix=%pathprefix:\\=\%
set PATH=%pathprefix%;%PATH%
:: We are ready to launch configure
C:\cygwin\bin\sh.exe configure
goto end
:nocmd
echo.
echo Cannot find the command interpreter or the system dir.
goto end
:usage
echo.
echo This script works on Windows NT 4 / 2000 / XP
echo and performs a system wide configuration of LyX.
goto end
:noconf
echo.
echo Cannot find the configure script.
:end
if "%OS%"=="Windows_NT" endlocal
--------8<--------8<--------8<--------8<--------8<--------8<--------8<--------
Your script is certainly hugely more elegant. I just thought to provide
a simple means, although hardly simpler (if the user already has sh.exe
in his Windows path) to complete his Lyx1.3.7pre5 install now. I was
able to follow the Angus advice for this. I hope I'm reinforcing it, while
your advice might be more suitable for inclusion in the installer package.
WBR,
Stephen