summaryrefslogtreecommitdiff
path: root/Master/tl-portable.bat
diff options
context:
space:
mode:
authorPiotr Strzelczyk <piotr@eps.gda.pl>2010-07-08 22:55:58 +0000
committerPiotr Strzelczyk <piotr@eps.gda.pl>2010-07-08 22:55:58 +0000
commit7cfe9e20cd7d24506adc62a38a078a714b19509f (patch)
tree5889cd0203120b4d3955aa7add2193977365625a /Master/tl-portable.bat
parente0ea7b22699470cd72a9f7d27a0eaf6a5354f752 (diff)
portable and from_dvd installations
git-svn-id: svn://tug.org/texlive/trunk@19292 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tl-portable.bat')
-rwxr-xr-xMaster/tl-portable.bat34
1 files changed, 34 insertions, 0 deletions
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.