1@echo off
2rem $Id: install-tl.bat 30369 2013-05-10 13:01:27Z siepo $
3rem Wrapper script to set up environment for installer
4rem
5rem Public domain.
6rem Originally written 2009 by Tomasz M. Trzeciak.
7
8rem First, check if this is DOS based system
9rem in DOS '^' is just a normal character
10if not ^x==x goto DOS
11
12rem Localize environment changes
13setlocal enableextensions
14
15rem Batch subroutines require a cd to the batchfile directory.
16rem For UNC paths, pushd will create a temporary mapping.
17pushd "%~dp0"
18
19rem Remove any double quotes from PATH (why we care for it at all???)
20set "path=%path:"=%"
21
22rem Break search path into dir list and rebuild w/o tex dirs
23call :rebuildpath ";" "%path:;=" "%"
24if "%path:~0,1%"==";" set "path=%path:~1%"
25
26rem Use TL Perl
27set "path=%~dp0tlpkg\tlperl\bin;%path%"
28set "PERL5LIB=%~dp0tlpkg\tlperl\lib"
29
30rem Clean environment from other Perl variables
31set PERL5OPT=
32set PERLIO=
33set PERLIO_DEBUG=
34set PERLLIB=
35set PERL5DB=
36set PERL5DB_THREADED=
37set PERL5SHELL=
38set PERL_ALLOW_NON_IFS_LSP=
39set PERL_DEBUG_MSTATS=
40set PERL_DESTRUCT_LEVEL=
41set PERL_DL_NONLAZY=
42set PERL_ENCODING=
43set PERL_HASH_SEED=
44set PERL_HASH_SEED_DEBUG=
45set PERL_ROOT=
46set PERL_SIGNALS=
47set PERL_UNICODE=
48
49set errlev=0
50rem Start installer
51path
52echo "%~dp0install-tl" %*
53perl "%~dp0install-tl" %*
54
55rem The nsis installer will need this:
56if errorlevel 1 set errlev=1
57pause
58goto :eoff
59
60rem Subroutine to build search path without tex directories
61rem any dir containing pdftex.exe is considered a tex dir
62:rebuildpath ";" dir list ...
63shift
64rem The first argument (";") serves as a marker to reset the path
65if "%~0"==";" set path=
66rem Finish if no more arguments to process
67if [%1]==[] goto :eof
68rem Continue if tex dir
69if exist "%~1\pdftex.exe" goto :rebuildpath
70rem Add dir to path
71set "path=%path%;%~1"
72goto :rebuildpath
73
74:DOS
75echo DOS and Windows 9x systems are not supported. Sorry.
76echo Windows 2000 or newer is required.
77pause
78
79:eoff
80if unc == 1 popd
81