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

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

%tldrive%
cd %tlroot%

rem we need wget in the path, so add tlpkg\bin to the path
path %tlroot%tlpkg\installer;%path%

rem use provided Perl
set PERL5LIB=%tlroot%tlpkg\installer\perllib

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.
"%tlroot%tlpkg\installer\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
"%tlroot%tlpkg\installer\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.