summaryrefslogtreecommitdiff
path: root/Master/tl-portable.bat
diff options
context:
space:
mode:
Diffstat (limited to 'Master/tl-portable.bat')
-rwxr-xr-xMaster/tl-portable.bat54
1 files changed, 44 insertions, 10 deletions
diff --git a/Master/tl-portable.bat b/Master/tl-portable.bat
index 3fcf68d8a70..98a52b2725c 100755
--- a/Master/tl-portable.bat
+++ b/Master/tl-portable.bat
@@ -1,11 +1,25 @@
@echo off
-
-rem Copyright 2008 Siep Kroonenberg.
+rem Copyright 2008-2009 Siep Kroonenberg, Tomasz M. Trzeciak.
rem You may freely use, modify and/or distribute this file.
+rem First, check if this is DOS based system
+rem in DOS '&' is just a normal character
+echo.>nul & goto continue
+goto DOS
+:continue
+
+rem Now check for Windows NT which is also not supported
+ver | find "NT"
+if not errorlevel 1 goto WinNT
+
+rem Abort if we are running from UNC path
+if %~d0==\\ goto UNC
+
+rem Localize environment changes
+setlocal enableextensions
+
rem TeX Live Root; ends with backslash
set TEXDIR=%~dp0
-set tldrive=%~d0
rem TEXDIR writable?
set TEXDIRW=%USERPROFILE%\.tlportable2008\
@@ -38,14 +52,34 @@ set platform=win32
rem use provided Perl
set PERL5LIB=%TEXDIR%tlpkg\tlperl\lib
-path %TEXDIR%tlpkg\tlperl\bin;%path%
+path %TEXDIR%tlpkg\tlperl\bin;%TEXDIR%bin\win32;%path%
perl "%TEXDIR%install-tl" --portable
-if not errorlevel 1 goto doit
-echo Initialization of TeXLive failed!
-pause
-exit /b 1
+if errorlevel 1 goto failedinit
-:doit
-path %TEXDIR%bin\win32;%path%
+rem start command interperter
set PROMPT=TL $P$G
%COMSPEC% /k
+goto :eof
+
+:failedinit
+echo Initialization of TeX Live failed!
+pause
+exit /b 1
+
+:UNC
+echo Cannot run from UNC path.
+echo Map network drive to a drive letter and rerun the installer.
+echo Use pushd/popd commands for temporary mapping.
+pause
+exit /b 1
+
+:WinNT
+echo Windows NT is not supported. Sorry.
+echo Windows 2000 or newer is required.
+pause
+exit /b 1
+
+:DOS
+echo DOS and Windows 9x systems are not supported. Sorry.
+echo Windows 2000 or newer is required.
+pause