[tex-live] TL in portable mode on Windows

T T t34www at googlemail.com
Sun Dec 21 21:37:50 CET 2008


2008/12/21 Siep Kroonenberg <siepo at cybercomm.nl>:
> On Sat, Dec 20, 2008 at 05:55:45PM +0000, T T wrote:
>> Next, upon installation, TL breaks any other TeX installation on the system
>> by removing it from the path. Although this is documented (
>> http://www.tug.org/texlive/windows.html) I still consider it a bug to
>> interfere with other software on the system without explicit user consent.
>> It's essentially as bad as changing file associations without asking (not
>> that uncommon on Windows, I'm afraid). Furthermore, during uninstallation
>> the original path is not restored and user has to fix it manually.
>
> This is a limitation of TeX. Some components may work when invoked
> with an absolute path, but in general the TeX binaries should be on
> the searchpath. Restoring the original path is pointless because
> there is no way of knowing what has happened to the path in the
> meantime.  Simply prepending TeX would have been more conservative,
> but has drawbacks of its own.

What would be those drawbacks? I can think of two situations on Windows:
1) admin account - in this case you can always ensure that TL is found
first on the path
2) restricted account - you have access only to the user path, so if
there is another tex on the system path, it will overshadow TL but
there is nothing you can do about it

I think it would be much cleaner to simply ask user what to do if
there is another TeX distribution detected. I was quite surprised to
find MiKTeX not working after TL uninstallation. Also, the link I gave
is the only place I found any mention about this - documentation says
nothing about this behaviour.

>> tl-portable.bat could be useful not only for launching TL shell but also
>> other tools, e.g. text editor or compilation script. Unfortunately, in its
>> current form this not possible. I would suggest the following modification
>
> What would be the point? You can run these editors and scripts from
> within the TL shell. Since we are talking about writable media, you
> can create customized copies of tl-portable.bat all you want.

I doubt anybody would like to start their editor from the command
prompt (we're talking about win users here). But if you think those
changes aren't useful I can make a customized launcher for that, no
problem.

> My advice:
>
> - install TeX Live to some temporary location
> - copy the installation to a pendrive
> - uninstall TeX Live
> - re-add MikTeX to the searchpath. I think that is enough to restore
>  MikTeX.
> - modify tl-portable.bat to skip the Perl code and not to change
>  directories
> - optional: create variations to this batchfile for starting editors
>  etc.

As I already said I'm not very keen on that idea because it is likely
to be messy to automate it. But if there will be no other choice I
might go for it.

> But I am not quite sure whether package management would work in
> such an installation.

That would be a real pity. The only way to update would be then to
repeat the whole exercise from the start. And that would update
everything. Is there anything in tlmgr that would not work portably,
like absolute paths or writing some system specific configuration?

> I think a script to create a portable pendrive installation from an
> existing installation might be useful.

My thoughts exactly. A lot of users would welcome possibility to use
TeX on the go. Live DVD doesn't cut it mainly due to its fixed nature,
size and no integration with editing tools.

> However, offering too many
> options at installation time would make it hard to explain and would
> do more harm than good.

But we are talking here about one tick box at most. On *nix systems
installer doesn't perform any integration at all. It is only on
Windows that installation and system integration have been made
inseparable.

I would even argue that such a change would make the installer easier
to maintain. I've learned from another thread about install-w32client
script that can be used for an existing TL installation. This script
essentially duplicates some code from the installer. Why not just
invoke install-w32client after TL installation? Wouldn't that be
simpler and easier to maintain?

I might be even tempted to give it a go and try to do such a
refactoring of the installer. My only question is: would such a change
be accepted (in the rather unlikely event that I would succeed)? The
last think I would like is to end up with a privetly held fork of the
official installer, so if don't like that idea, I won't even try.

> As to UNC paths: you are right that in most situations UNC paths
> don't work.
>
> The UNC comment, the directory change and the final exit have been
> removed from tl-portable.bat.

Thanks for those changes. I would further suggest to either abort or
fallback on %USERPROFILE% in case of running from UNC location to
avoid writing to %WINDIR% on admin accounts.

rem TeX Live Root; ends with backslash
set TEXDIR=%~dp0

rem TEXDIR writable?
set TEXDIRW=%USERPROFILE%\.tlportable2008\
if %~d0==\\ goto wrtestdone
del "%TEXDIR%tl_wrtest" 2>nul
echo Testing for write access %TEXDIR%...
echo Hello >"%TEXDIR%tl_wrtest"
if not exist "%TEXDIR%tl_wrtest" goto wrtestdone
del "%TEXDIR%tl_wrtest"
set TEXDIRW=%TEXDIR%
:wrtestdone
if not exist "%TEXDIRW%" md "%TEXDIRW%"

I only added 'if %~d0==\\ goto wrtestdone' line to bypass writeable
media test in case we are running from the UNC path.

Cheers,

Tomek


More information about the tex-live mailing list