diff options
Diffstat (limited to 'Master/bin/win32/tlmgr.bat')
-rwxr-xr-x | Master/bin/win32/tlmgr.bat | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/Master/bin/win32/tlmgr.bat b/Master/bin/win32/tlmgr.bat index efb1f4b2c69..8f72641d00b 100755 --- a/Master/bin/win32/tlmgr.bat +++ b/Master/bin/win32/tlmgr.bat @@ -1,18 +1,11 @@ @echo off
rem Advanced launcher for tlmgr with auto-update
rem
-rem Copyright 2009 by Tomasz M. Trzeciak <t.m.trzeciak@googlemail.com>
-rem This file is licensed under the GNU General Public License version 2
-rem or any later version.
-rem
-
-rem Check if we are running under NT based system
-rem (works for Vista too, extra check needed to exclude winNT4)
-if not [%OS%]==[Windows_NT] goto err_OS
+rem Copyright 2009 by Tomasz M. Trzeciak
+rem Public Domain
-rem Make environment changes local & enable delayed expansion
-setlocal enabledelayedexpansion
-(set errorlevel=)
+rem Make environment changes local
+setlocal enableextensions
rem Get TL installation root (it should be two levels up)
for %%I in ("%~dp0..\..") do (set tlroot=%%~fI)
@@ -25,17 +18,17 @@ if exist "%tlupdater%*" goto :err_updater_exists rem Start tlmgr
(set PERL5LIB=%tlroot%\tlpkg\tlperl\lib)
-"%tlroot%\tlpkg\tlperl\bin\perl.exe" "%tlroot%\texmf\scripts\texlive\tlmgr.pl" %*
+path %tlroot%\tlpkg\tlperl\bin;%tlroot%\bin\win32;%path%
+perl "%tlroot%\texmf\scripts\texlive\tlmgr.pl" %*
-rem Exit here if there are no updates to do
-if not exist "%tlupdater%" exit /b %errorlevel%
+rem Finish if there are no updates to do; the last error code will be returned
+if not exist "%tlupdater%" goto :eof
rem Rename updater script before it is run
ren "%tlupdater%" "%tlupdatername%.bat"
if errorlevel 1 goto :err_rename_updater
-rem Run updater explicitly with cmd.exe, in case we are launched from 4NT
-rem Use delayed expansion for errorlevel, 4NT doesn't like: call exit /b %%errorlevel%%
+rem Run updater
echo Starting update ...
-endlocal & call "%tlupdater%.bat" & exit /b !errorlevel!
+endlocal & call "%tlupdater%.bat" & goto :eof
:err_updater_exists
echo %~n0: cannot remove update script, infrastructure update might be in progress>&2
|