From 7cfe9e20cd7d24506adc62a38a078a714b19509f Mon Sep 17 00:00:00 2001 From: Piotr Strzelczyk Date: Thu, 8 Jul 2010 22:55:58 +0000 Subject: portable and from_dvd installations git-svn-id: svn://tug.org/texlive/trunk@19292 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tl-portable.bat | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'Master/tl-portable.bat') diff --git a/Master/tl-portable.bat b/Master/tl-portable.bat index 359eac4d7e4..348ce79b20e 100755 --- a/Master/tl-portable.bat +++ b/Master/tl-portable.bat @@ -13,11 +13,45 @@ 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. -- cgit v1.2.3