summaryrefslogtreecommitdiff
path: root/Master/install-tl.bat
diff options
context:
space:
mode:
authorSiep Kroonenberg <siepo@cybercomm.nl>2008-11-02 21:30:49 +0000
committerSiep Kroonenberg <siepo@cybercomm.nl>2008-11-02 21:30:49 +0000
commit9683e2f7185c5cf8b4a194d839e26425a5b9e811 (patch)
tree525feebadb07ef1014d83a886756a07baf89b17c /Master/install-tl.bat
parent1376cc9defb4d5ca60c2c4bbd5aacd6fd4f10f67 (diff)
Win32: path cleaned up in install-tl.bat, with embedded Perl code
git-svn-id: svn://tug.org/texlive/trunk@11158 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/install-tl.bat')
-rwxr-xr-xMaster/install-tl.bat29
1 files changed, 26 insertions, 3 deletions
diff --git a/Master/install-tl.bat b/Master/install-tl.bat
index d3ade37b586..108cc3e718d 100755
--- a/Master/install-tl.bat
+++ b/Master/install-tl.bat
@@ -11,11 +11,34 @@ cd %tlroot%
rem we need wget in the path, so add tlpkg\bin to the path
path %tlroot%tlpkg\installer;%path%
-rem We shouldn't have to add TL to the searchpath here, but we do
-path %tlroot%bin\win32;%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