summaryrefslogtreecommitdiff
path: root/Master/tl-portable.bat
blob: 86459c050c9d3dcd458cb3f679ebbfeb8499c152 (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
@echo off

rem Copyright 2008 Siep Kroonenberg.
rem You may freely use, modify and/or distribute this file.

rem TeX Live Root; ends with backslash
rem This should also work with UNC names
set TEXDIR=%~dp0
set tldrive=%~d0

%tldrive%
cd %TEXDIR%

rem TEXDIR writable?
set tlwrite=%USERPROFILE%\texlive2008\
del "%TEXDIR%tl_wrtest" 2>nul
echo Testing for write access %TEXDIR%...
echo Hello >"%TEXDIR%tl_wrtest"
if not exist "%TEXDIR%tl_wrtest" goto wrtestdone
del "%TEXDIR%tl_wrtest"
set tlwrite=%TEXDIR%
:wrtestdone
if not exist "%tlwrite%" md "%tlwrite%"

rem Use TEXMFHOME for private data,
rem TEXMFLOCAL for department- or workgroup data.
rem It is allright if TEXMFLOCAL does not exist.

set TEXMFSYSVAR=%tlwrite%texmf-var
if exist "%TEXDIR%texmf-var" set TEXMFSYSVAR=%TEXDIR%texmf-var

set TEXMFSYSCONFIG=%tlwrite%texmf-config
if exist "%TEXDIR%texmf-config" set TEXMFSYSCONFIG=%TEXDIR%texmf-config
set TEXMFMAIN=%TEXDIR%texmf
set TEXMFDIST=%TEXDIR%texmf-dist
set TEXMFLOCAL=%TEXDIR%texmf-local
set TEXMFHOME=%tlwrite%texmf-home
set TEXMFVAR=%tlwrite%texmf-var
set TEXMFCONFIG=%tlwrite%texmf-config
set TEXBINDIR=%TEXDIR%bin\win32
set platform=win32

rem use provided Perl

set PERL5LIB=%TEXDIR%tlpkg\installer\perllib
"%TEXDIR%tlpkg\installer\perl" "%TEXDIR%install-tl.pl" --portable
if not errorlevel 1 goto doit
echo Initialization of TeXLive failed!
pause
exit

:doit
path %TEXDIR%bin\win32;%path%
set PROMPT=TL $P$G
%COMSPEC% /k
exit