summaryrefslogtreecommitdiff
path: root/Master/bin
diff options
context:
space:
mode:
authorPiotr Strzelczyk <piotr@eps.gda.pl>2009-06-25 06:47:18 +0000
committerPiotr Strzelczyk <piotr@eps.gda.pl>2009-06-25 06:47:18 +0000
commitb1f69f1f10fa7eb377047f7d15c5a26efa5d04e2 (patch)
tree2c20fb4e89fde90988d8621fdce0a6980a4ab7bb /Master/bin
parent82ab13bdb69e75648259b4d9ef5394432fa026e0 (diff)
start-up script with settings redirection for TeXworks
git-svn-id: svn://tug.org/texlive/trunk@13955 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/bin')
-rwxr-xr-xMaster/bin/win32/texworks.bat30
1 files changed, 24 insertions, 6 deletions
diff --git a/Master/bin/win32/texworks.bat b/Master/bin/win32/texworks.bat
index 0b8c38d3102..d8f352b2e43 100755
--- a/Master/bin/win32/texworks.bat
+++ b/Master/bin/win32/texworks.bat
@@ -1,9 +1,27 @@
@echo off
-rem Launcher script for texworks
+rem Start-up script for TeXworks
+rem
+rem Copyright 2009 by Tomasz M. Trzeciak
+rem Public Domain
-rem Get TL root (should be two levels up)
-for %%I in (%~dp0..\..) do (set tlroot=%%~fI)
+setlocal enableextensions
+rem Get installation root (should be two levels up)
+for %%I in ("%~dp0..\..") do (set TEXROOT=%%~fI)
rem Add bin dir to path
-path %tlroot%\bin\win32;%path%
-rem Start texworks editor
-start "" "%tlroot%\tlpkg\texworks\texworks.exe" %* \ No newline at end of file
+path %TEXROOT%\bin\win32;%PATH%
+rem Ask kpsewhich about TEXMFCONFIG location
+for /f "delims=" %%I in ('kpsewhich --var-value=TEXMFCONFIG') do (
+ set TW_INIPATH=%%~fI\texworks
+ set TW_LIBPATH=%%~fI\texworks
+)
+rem Settings dir needs to exist or TeXworks will fall back on the registry
+if not exist "%TW_INIPATH%\" mkdir "%TW_INIPATH%"
+if not exist "%TW_INIPATH%\" goto :noinipath
+
+rem Start TeXworks editor without blocking command line
+start "" "%TEXROOT%\tlpkg\texworks\texworks.exe" %*
+goto :eof
+
+:noinipath
+echo %~nx0: could not create directory: %TW_INIPATH%>&2
+exit /b 1 \ No newline at end of file