@echo off rem Copyright 2008-2009 Siep Kroonenberg, Tomasz M. Trzeciak. rem You may freely use, modify and/or distribute this file. rem First, check if this is DOS based system rem in DOS '^' is just a normal character if not ^x==x goto DOS rem Abort if we are running from UNC path if %~d0==\\ goto UNC rem use provided Perl set PERL5LIB=%~dp0tlpkg\tlperl\lib path %~dp0bin\win32;%path% rem Check for writable medium ( echo.>"%~dp0tlwrtest" ) 2>nul || ( goto :from_dvd ) del "%~dp0tlwrtest" rem On writable media we assume an already portable installation rem if there is texmf.cnf present under TL root if exist "%~dp0texmf.cnf" goto :tlshell rem Otherwise initialize for portable use set "TEXLIVE_INSTALL_PREFIX=%~dp0?" set "TEXLIVE_INSTALL_PREFIX=%TEXLIVE_INSTALL_PREFIX:\?=%" goto :genfiles :from_dvd rem We run from non-writable medium set TEXMFCNF=%USERPROFILE:\=/%/.tlportable2010/texmf-var/web2c if exist "%TEXMFCNF%/texmf.cnf" goto :tlshell set TEXLIVE_INSTALL_PREFIX=%USERPROFILE%\.tlportable2010 :genfiles echo About to generate some files in "%TEXLIVE_INSTALL_PREFIX%" pause rem Make -portable -from_dvd installation to generate necessary stuff rem The -profile nul hack makes installation unattended "%~dp0tlpkg\tlperl\bin\perl.exe" "%~dp0install-tl" -portable -from_dvd -profile nul if errorlevel 1 goto :failedinit :tlshell rem start new command interperter with customized prompt and window title rem reuse console window of this interpreter and terminate it after that if not defined prompt set prompt=$P$G start /b "TL-SHELL" "%ComSpec%" /k "title TL-SHELL& prompt TL$S%prompt%" exit :failedinit echo Initialization of TeX Live for portable use failed! pause exit /b 1 :UNC echo Cannot run from UNC path. echo Map network drive to a drive letter and rerun the script. echo You can use pushd/popd commands for temporary mapping. pause exit /b 1 :DOS echo DOS and Windows 9x systems are not supported. Sorry. echo Windows 2000 or newer is required. pause