summaryrefslogtreecommitdiff
path: root/Master/bin
diff options
context:
space:
mode:
authorPiotr Strzelczyk <piotr@eps.gda.pl>2009-03-01 16:55:53 +0000
committerPiotr Strzelczyk <piotr@eps.gda.pl>2009-03-01 16:55:53 +0000
commit9de40e856cbe4b35f779b5fcf60758efed3fb185 (patch)
tree838360857ec3e1afa32a131f2cb2c13bef2fea9f /Master/bin
parent48417f4e0b469fcedf14fddebac1df1954bbc5bf (diff)
Win32 updater updates:
- 4NT shell compatibility fix - tlmgr.bat detects and quits if update is running - updater script is gui mode aware - more documentation on the update process - fixed condition for warning about updates from disk Others: - removed path setting for win32 from the BEGIN block of tlmgr.pl git-svn-id: svn://tug.org/texlive/trunk@12269 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/bin')
-rwxr-xr-xMaster/bin/win32/tlmgr.bat55
1 files changed, 39 insertions, 16 deletions
diff --git a/Master/bin/win32/tlmgr.bat b/Master/bin/win32/tlmgr.bat
index eeb7a3bdf0b..efb1f4b2c69 100755
--- a/Master/bin/win32/tlmgr.bat
+++ b/Master/bin/win32/tlmgr.bat
@@ -1,27 +1,50 @@
@echo off
-rem Advanced starter for tlmgr with auto-update
+rem Advanced launcher for tlmgr with auto-update
+rem
rem Copyright 2009 by Tomasz M. Trzeciak <t.m.trzeciak@googlemail.com>
-rem Public Domain
+rem This file is licensed under the GNU General Public License version 2
+rem or any later version.
rem
-setlocal enableextensions
-rem TL installation root
-for %%P in ("%~dp0..\..") do set "tlroot=%%~fP"
+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 Make environment changes local & enable delayed expansion
+setlocal enabledelayedexpansion
+(set errorlevel=)
-rem not needed anymore
-rem path %TLdir%\tlpkg\installer;%path%
+rem Get TL installation root (it should be two levels up)
+for %%I in ("%~dp0..\..") do (set tlroot=%%~fI)
+
+rem Remove remains of previous update if any
+(set tlupdatername=run-updater-w32)
+(set tlupdater=%tlroot%\temp\%tlupdatername%)
+if exist "%tlupdater%*" del "%tlupdater%*"
+if exist "%tlupdater%*" goto :err_updater_exists
rem Start tlmgr
-set PERL5LIB=%tlroot%\tlpkg\tlperl\lib
+(set PERL5LIB=%tlroot%\tlpkg\tlperl\lib)
"%tlroot%\tlpkg\tlperl\bin\perl.exe" "%tlroot%\texmf\scripts\texlive\tlmgr.pl" %*
-rem Check for updater script
-set "updater=%tlroot%\temp\run-updater-w32"
-if not exist "%updater%" exit /b
-if exist "%updater%.bat" del "%updater%.bat"
-ren "%updater%" run-updater-w32.bat
-if errorlevel 1 exit /b 1
+rem Exit here if there are no updates to do
+if not exist "%tlupdater%" exit /b %errorlevel%
+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%%
+echo Starting update ...
+endlocal & call "%tlupdater%.bat" & exit /b !errorlevel!
+
+:err_updater_exists
+echo %~n0: cannot remove update script, infrastructure update might be in progress>&2
+exit /b 1
-rem Run updater script
-endlocal & call "%updater%.bat" & exit /b
+:err_rename_updater
+echo %~n0: cannot rename "%tlupdater%">&2
+exit /b 1
+:err_OS
+echo Unsupported operating system. Windows 2000 or later required.
+pause