[tex-live] Installation problems on Windows Vista

Reinhard Kotucha reinhard.kotucha at web.de
Wed Dec 3 00:12:51 CET 2008


Werner LEMBERG writes:
 > 
 > > (Manuel, it's your personal disaster having to reboot three times :-)
 > 
 > To be serious again: The idea of copying the whole Perl stuff needed
 > for running tlmgr looks like a good idea IMHO.  It still would mean
 > shuffling around a few Megabytes, but it would elegantly avoid the
 > file locking problems.  In other words, a Windows user should have to
 > execute a batch file like this if clicking on the tlmgr icon:
 > 
 >   <set up environment variables>
 >   cpdir <tlmgrdir> <tlmgrdir-temp>
 >   <tlmgrdir-temp>\tlmgr

Hi,
while you are talking about the annoying file locking problem, there
is one thing which is probably worthwhile to investigate:

There is (at least) one strange thing on Windows.  Norbert actually
detected it when we had been working on the texlua wrappers but I
tested it with Perl too and got the same result.

The execvpe() system call behaves differently on Unix and Windows:

On Unix it simply replaces the current process image by another one.
On Windows the parent process terminates immediately after the newly
created process had been launched.  This means that the child process
is running asynchronously (in Unix parlance: in the background).

This behavior bothered us a lot some time ago but maybe it is quite
useful in order to circumvent some other Windows problems.

Suppose that you invoke foo.pl from the command line and foo.pl
contains the line 

   exec('perl', 'bar.pl');

then foo.pl returns immediately (to the command line) after bar.pl has
been launched.  I suppose that a kid can remove its parent from the
file system then because the parent process is finished when the child
process is running.  My tests didn't go so far, but it's not unlikely
that it works.

If it works properly, maybe the "final steps" script could be invoked
automatically and the shortcut can be avoided. 

There are some things to consider when using exec() on Windows.  Since
the child process is running in the background, it should not ask for
user input.  It will hang and wait for input forever.  The only thing
you can do then is to kill the process using the process manager.
Windows has no concept of job control.  In TeX parlance, the script
has to be run in \batchmode or \nonstopmode.

However, if user input is required, then the child process has either
to be invoked explicitely in a cmd window or it has to provide a GUI.

If this really works, tlmgr could exec() a script which updates tlmgr
and this script finally could exec() the new version of tlmgr again.
Or an uninstaller could exec('cmd', '/c', 'del', '%me%'), while what
to remove is passed to the child process via the environment.

I don't know whether it works as expected, Windows is always good for
surprises, but it would be nice if it works as explained.  Some
Windows specific problems could be solved more straightforward then.

BTW, it seems that the behavior of execvpe() on Windows originates
from MS-DOG.  You could only run one process at the same time.  My old
Atari ST suffered from the same problem.  There had been a system
function called chain() which allowed a program to replace itself by
another one.  It seems that execvpe() on Windows is supposed to do
something very similar.

Regards,
  Reinhard

-- 
----------------------------------------------------------------------------
Reinhard Kotucha			              Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover	                      mailto:reinhard.kotucha at web.de
----------------------------------------------------------------------------
Microsoft isn't the answer. Microsoft is the question, and the answer is NO.
----------------------------------------------------------------------------


More information about the tex-live mailing list