summaryrefslogtreecommitdiff
path: root/Master/install-tl.bat
blob: 8b0dbc3f75d7cd73c2c1718d3b9fe7e22ae01ef8 (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
@echo off
setlocal

rem TeX Live Root; ends with backslash
set tlroot=%~dp0
set tldrive=%~d0

%tldrive%
cd %tlroot%

rem use provided Perl
set PERL5LIB=%tlroot%tlpkg\tlperl\lib
path %tlroot%tlpkg\tlperl\bin;%path%

rem remove TeX directories from searchpath with
rem some embedded Perl and a temporary batchfile.
rem If it is done in the Perl installer then it may not work right.
perl -x "%~dpn0.bat"
goto fixpath

#! perl
my @newpt = ();
foreach my $d (split (';', $ENV{'PATH'})) {
  my $df = $d;
  $df =~ s/\\/\//g;
  push @newpt, $d unless (-e ($df."/pdftex.exe"));
}
$ENV{'PATH'} = join(';',@newpt);
my $batfile = $ENV{'TEMP'}."\\setpath.bat";
$batfile =~ s/\\/\//g;
open TMPBAT, ">$batfile";
print TMPBAT 'path '.$ENV{'PATH'}."\n";
close TMPBAT;
__END__

:fixpath
call %TEMP%\setpath.bat
echo Path: %path%
rem del %TEMP%\setpath.bat
perl "%~dpn0" %*
pause Done

rem endlocal is implicit

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.