summaryrefslogtreecommitdiff
path: root/Master/install-tl.bat
blob: c743e17ca8bc651712affe11a38f8ef2ccaaccfe (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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
@echo off
rem Wrapper script to set up environment for installer
rem
rem Copyright 2009 by Tomasz M. Trzeciak
rem Public Domain

rem First, check if this is DOS based system
rem in DOS '^' is just a normal character
if not ^x==x goto DOS

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 Do we really need to cd to the batch location?
cd /d %~dp0

rem Break search path into dir list and rebuild w/o tex dirs
call :rebuildpath ";" "%path:;=" "%"

rem Use TL Perl
path %~dp0tlpkg\tlperl\bin;%path%
set PERL5LIB=%~dp0tlpkg\tlperl\lib

rem Start installer
path
perl "%~dpn0" %*
pause Done
goto :eof

rem Subroutine to build search path without tex directories 
rem any dir containing pdftex.exe is considered a tex dir
:rebuildpath ";" dir list ...
shift
rem The first argument (";") serves as a marker to reset the path
if "%~0"==";" set path=
rem Finish if no more arguments to process
if "%~1"=="" goto :eof
rem Continue if tex dir
if exist "%~1\pdftex.exe" goto :rebuildpath
rem Add dir to path
if not defined path (path %~1) else (path %path%;%~1)
goto :rebuildpath

rem About install-tl.bat.manifest:
rem Vista assumes that a file with install in the name is
rem an installer and therefore requires administrative privileges.
rem The manifest file tells Vista otherwise.

:UNC
echo Cannot run from UNC path.
echo Map network drive to a drive letter and rerun the installer.
echo You can 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