summaryrefslogtreecommitdiff
path: root/Master/bin/win32/runscript.tlu
diff options
context:
space:
mode:
Diffstat (limited to 'Master/bin/win32/runscript.tlu')
-rw-r--r--Master/bin/win32/runscript.tlu28
1 files changed, 19 insertions, 9 deletions
diff --git a/Master/bin/win32/runscript.tlu b/Master/bin/win32/runscript.tlu
index 718fdb938c2..95e9ddbb3cb 100644
--- a/Master/bin/win32/runscript.tlu
+++ b/Master/bin/win32/runscript.tlu
@@ -48,13 +48,13 @@ local helpstr = [[
Tcl (.tcl) -- requires installation
Java (.jar) -- requires installation
VBScript (.vbs) -- part of Windows
- Jscript (.js) -- part of Windows
+ JScript (.js) -- part of Windows
Batch (.bat;.cmd) -- part of Windows
- For Unix-style extensionless scripts the first line of the script is
- consulted for a she-bang (#!) specification of the interpreter
- program. This can be an arbitrary program but it must be present on
- the search path.
+ Finally, Unix-style extensionless scripts are searched as last and
+ the interpreter program is established based on the she-bang (#!)
+ specification on the very first line of the script. This can be
+ an arbitrary program but it must be present on the search path.
Next, the script program needs to be installed somewhere below the
'scripts' directory under one of the TEXMF trees (consult the
@@ -71,7 +71,9 @@ local helpstr = [[
kpsewhich --format=texmfscripts <script-name>.<ext>
- Once installed the script can be called immediately with:
+ This should output the full path to the script if everything is
+ properly installed and configured. If this test is successful,
+ the script can be run immediately with:
runscript <script-name> [script arguments]
@@ -119,7 +121,8 @@ local docstr = [[
process. The system shell (cmd.exe) is never called (except for
batch scripts, of course). If the located script happens to be
a (tex)lua script, it is loaded and called internally from within
- this script, i.e. no new process is spawned.
+ this script, i.e. no new process is spawned. Execution is done
+ using a protected call, so any compile or runtime errors are catched.
Source files
@@ -191,6 +194,11 @@ local docstr = [[
- added tlgs and tlperl to alias_table; callable as e.g.:
runscript tlperl ...
- doc tweaks
+ 2010/04/22
+ - ensure only backslash is used in USERPROFILE variable
+ (Adobe Reader crash case)
+ - fixed argument processing for direct execution under texlua
+ - more doc tweaks
]]
-- HELPER SUBROUTINES --
@@ -308,7 +316,7 @@ else
-- we must be called as: texlua runscript.tlu progname ...
-- this is treated the same as: runscript[.exe] progname ...
-- we don't have the unparsed arument line in this case, so construct one
- for k = 1, #arg do argline = argline..' '.._q(arg[k]) end
+ for k = #arg, 1, -1 do argline = _q(arg[k]) .. ' ' .. argline end
end
-- special behaviour when called under 'runscript' name
@@ -401,6 +409,8 @@ if string.find(','..shell_escape_commands..',', ','..progname..',', 1, true) the
-- because they are not searched for with kpathsea)
os.setenv('TEXMFSCRIPTS', kpse.var_value('TEXMF_RESTRICTED_SCRIPTS'))
end
+-- Adobe Reader crash case: make sure USERPROFILE is not "slashed"
+os.setenv("USERPROFILE", os.getenv("USERPROFILE"):gsub('/', '\\'))
-- alias table (programs with special needs)
@@ -536,7 +546,7 @@ end
end -- MAIN_CHUNK
--- execute main_proc with pcall to catch any runtime errors
+-- execute MAIN_CHUNK with pcall to catch any runtime errors
local success, errormsg = pcall(MAIN_CHUNK)
if not success then