summaryrefslogtreecommitdiff
path: root/Master/bin/win32/tlmgr.bat
blob: 867cf3a68ac1b40464cb94106d6e50710b097218 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
@echo off
rem Advanced starter for tlmgr with auto-update
rem Copyright 2009 by Tomasz M. Trzeciak <t.m.trzeciak@googlemail.com>
rem Public Domain
rem

setlocal
rem TL installation root
for %%P in ("%~dp0..\..") do set "tlroot=%%~fP"
rem This shouldn't be necessary but without it 'tlmgr gui' complains
rem Comment from Tomek:
rem It is not about putting tlpkg\installer on the path, this is
rem irrelevant. It's about making sure that cmd.exe is not found on the
rem first element of the path.
rem I looks like perl discards or somehow mishandles the very first of the
rem path when it searches for cmd.exe. In fact, even this is enough to fix it:
path ;%path%
rem Alternatively we can activate the original way by adding the installer dir
rem path %TLdir%\tlpkg\installer;%path%

rem Start tlmgr
set PERL5LIB=%tlroot%\tlpkg\tlperl\lib
"%tlroot%\tlpkg\tlperl\bin\perl.exe" "%tlroot%\texmf\scripts\texlive\tlmgr2.pl" %*

rem Check for updater script
set "updater=%tlroot%\tlpkg\installer\updater.bat"
if not exist "%updater%" exit /b
if exist "%updater%.bat" del "%updater%.bat"
ren "%updater%" updater.bat.bat
if errorlevel 1 exit /b 1

rem Run updater script
endlocal & call "%updater%.bat" & exit /b