summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xBuild/source/texk/texlive/w32_wrapper/context/mtxrun.dllbin7680 -> 0 bytes
-rwxr-xr-xBuild/source/texk/texlive/w32_wrapper/context/mtxrun.exebin4608 -> 0 bytes
-rwxr-xr-xBuild/source/texk/texlive/w32_wrapper/runscript.dllbin3584 -> 0 bytes
-rwxr-xr-xBuild/source/texk/texlive/w32_wrapper/runscript.exebin1536 -> 0 bytes
-rwxr-xr-xBuild/source/texk/texlive/w64_mingw_wrapper/context/mtxrun.dllbin7680 -> 0 bytes
-rwxr-xr-xBuild/source/texk/texlive/w64_mingw_wrapper/context/mtxrun.exebin4608 -> 0 bytes
-rwxr-xr-xBuild/source/texk/texlive/w64_mingw_wrapper/libkpathsea-6.dllbin112742 -> 0 bytes
-rwxr-xr-xBuild/source/texk/texlive/w64_mingw_wrapper/runscript.dllbin17920 -> 0 bytes
-rwxr-xr-xBuild/source/texk/texlive/w64_mingw_wrapper/runscript.exebin16384 -> 0 bytes
-rwxr-xr-xBuild/source/texk/texlive/w64_mingw_wrapper/texlua.dllbin255860 -> 0 bytes
-rwxr-xr-xBuild/source/texk/texlive/w64_mingw_wrapper/texlua.exebin6250496 -> 0 bytes
-rwxr-xr-xBuild/source/texk/texlive/w64_wrapper/context/mtxrun.dllbin18432 -> 0 bytes
-rwxr-xr-xBuild/source/texk/texlive/w64_wrapper/context/mtxrun.exebin15360 -> 0 bytes
-rwxr-xr-xBuild/source/texk/texlive/w64_wrapper/runscript.dllbin16896 -> 0 bytes
-rwxr-xr-xBuild/source/texk/texlive/w64_wrapper/runscript.exebin16896 -> 0 bytes
-rw-r--r--Build/source/texk/texlive/windows_mingw_wrapper/README (renamed from Build/source/texk/texlive/w32_wrapper/README)0
-rw-r--r--Build/source/texk/texlive/windows_mingw_wrapper/bitmap2eps.ico (renamed from Build/source/texk/texlive/w32_wrapper/bitmap2eps.ico)bin3262 -> 3262 bytes
-rw-r--r--Build/source/texk/texlive/windows_mingw_wrapper/bitmap2eps.svg (renamed from Build/source/texk/texlive/w32_wrapper/bitmap2eps.svg)0
-rw-r--r--Build/source/texk/texlive/windows_mingw_wrapper/calldll.c (renamed from Build/source/texk/texlive/w32_wrapper/calldll.c)0
-rw-r--r--Build/source/texk/texlive/windows_mingw_wrapper/callexe.c (renamed from Build/source/texk/texlive/w32_wrapper/callexe.c)0
-rw-r--r--Build/source/texk/texlive/windows_mingw_wrapper/context/mtxrun_dll.c (renamed from Build/source/texk/texlive/w32_wrapper/context/mtxrun_dll.c)0
-rw-r--r--Build/source/texk/texlive/windows_mingw_wrapper/context/mtxrun_exe.c (renamed from Build/source/texk/texlive/w32_wrapper/context/mtxrun_exe.c)0
-rw-r--r--Build/source/texk/texlive/windows_mingw_wrapper/context/readme.txt (renamed from Build/source/texk/texlive/w32_wrapper/context/readme.txt)0
-rw-r--r--Build/source/texk/texlive/windows_mingw_wrapper/readme.txt (renamed from Build/source/texk/texlive/w64_mingw_wrapper/readme.txt)0
-rw-r--r--[-rwxr-xr-x]Build/source/texk/texlive/windows_mingw_wrapper/runscript.tlu (renamed from Build/source/texk/texlive/w64_mingw_wrapper/runscript.tlu)0
-rw-r--r--Build/source/texk/texlive/windows_mingw_wrapper/runscript_dll.c (renamed from Build/source/texk/texlive/w64_mingw_wrapper/runscript_dll.c)0
-rw-r--r--Build/source/texk/texlive/windows_mingw_wrapper/runscript_exe.c (renamed from Build/source/texk/texlive/w32_wrapper/runscript_exe.c)0
-rw-r--r--Build/source/texk/texlive/windows_mingw_wrapper/tl-tray-menu.c (renamed from Build/source/texk/texlive/w64_mingw_wrapper/tl-tray-menu.c)0
-rw-r--r--Build/source/texk/texlive/windows_mingw_wrapper/tlmgr-gui.txt (renamed from Build/source/texk/texlive/w32_wrapper/tlmgr-gui.txt)0
-rw-r--r--Build/source/texk/texlive/windows_mingw_wrapper/tlmgr.ico (renamed from Build/source/texk/texlive/w32_wrapper/tlmgr.ico)bin4286 -> 4286 bytes
-rw-r--r--Build/source/texk/texlive/windows_mingw_wrapper/tlmgr.svg (renamed from Build/source/texk/texlive/w32_wrapper/tlmgr.svg)0
-rw-r--r--Build/source/texk/texlive/windows_mingw_wrapper/wrunscript_exe.c (renamed from Build/source/texk/texlive/w32_wrapper/wrunscript_exe.c)0
-rw-r--r--Build/source/texk/texlive/windows_wrapper/README (renamed from Build/source/texk/texlive/w64_mingw_wrapper/README)16
-rw-r--r--Build/source/texk/texlive/windows_wrapper/bitmap2eps.ico (renamed from Build/source/texk/texlive/w64_mingw_wrapper/bitmap2eps.ico)bin3262 -> 3262 bytes
-rw-r--r--Build/source/texk/texlive/windows_wrapper/bitmap2eps.svg (renamed from Build/source/texk/texlive/w64_mingw_wrapper/bitmap2eps.svg)0
-rw-r--r--Build/source/texk/texlive/windows_wrapper/calldll.c (renamed from Build/source/texk/texlive/w64_mingw_wrapper/calldll.c)26
-rw-r--r--Build/source/texk/texlive/windows_wrapper/callexe.c (renamed from Build/source/texk/texlive/w64_mingw_wrapper/callexe.c)86
-rw-r--r--Build/source/texk/texlive/windows_wrapper/context/mtxrun_dll.c (renamed from Build/source/texk/texlive/w64_mingw_wrapper/context/mtxrun_dll.c)612
-rw-r--r--Build/source/texk/texlive/windows_wrapper/context/mtxrun_exe.c (renamed from Build/source/texk/texlive/w64_mingw_wrapper/context/mtxrun_exe.c)16
-rw-r--r--Build/source/texk/texlive/windows_wrapper/context/readme.txt (renamed from Build/source/texk/texlive/w64_mingw_wrapper/context/readme.txt)80
-rw-r--r--Build/source/texk/texlive/windows_wrapper/readme.txt (renamed from Build/source/texk/texlive/w32_wrapper/readme.txt)450
-rw-r--r--[-rwxr-xr-x]Build/source/texk/texlive/windows_wrapper/runscript.tlu (renamed from Build/source/texk/texlive/w32_wrapper/runscript.tlu)0
-rw-r--r--Build/source/texk/texlive/windows_wrapper/runscript_dll.c (renamed from Build/source/texk/texlive/w32_wrapper/runscript_dll.c)242
-rw-r--r--Build/source/texk/texlive/windows_wrapper/runscript_exe.c (renamed from Build/source/texk/texlive/w64_mingw_wrapper/runscript_exe.c)30
-rw-r--r--Build/source/texk/texlive/windows_wrapper/tl-tray-menu.c (renamed from Build/source/texk/texlive/w32_wrapper/tl-tray-menu.c)696
-rw-r--r--Build/source/texk/texlive/windows_wrapper/tlmgr-gui.txt (renamed from Build/source/texk/texlive/w64_mingw_wrapper/tlmgr-gui.txt)154
-rw-r--r--Build/source/texk/texlive/windows_wrapper/tlmgr.ico (renamed from Build/source/texk/texlive/w64_mingw_wrapper/tlmgr.ico)bin4286 -> 4286 bytes
-rw-r--r--Build/source/texk/texlive/windows_wrapper/tlmgr.svg (renamed from Build/source/texk/texlive/w64_mingw_wrapper/tlmgr.svg)0
-rw-r--r--Build/source/texk/texlive/windows_wrapper/wrunscript_exe.c (renamed from Build/source/texk/texlive/w64_mingw_wrapper/wrunscript_exe.c)54
49 files changed, 1231 insertions, 1231 deletions
diff --git a/Build/source/texk/texlive/w32_wrapper/context/mtxrun.dll b/Build/source/texk/texlive/w32_wrapper/context/mtxrun.dll
deleted file mode 100755
index 3c4481c319d..00000000000
--- a/Build/source/texk/texlive/w32_wrapper/context/mtxrun.dll
+++ /dev/null
Binary files differ
diff --git a/Build/source/texk/texlive/w32_wrapper/context/mtxrun.exe b/Build/source/texk/texlive/w32_wrapper/context/mtxrun.exe
deleted file mode 100755
index 0e7882cf926..00000000000
--- a/Build/source/texk/texlive/w32_wrapper/context/mtxrun.exe
+++ /dev/null
Binary files differ
diff --git a/Build/source/texk/texlive/w32_wrapper/runscript.dll b/Build/source/texk/texlive/w32_wrapper/runscript.dll
deleted file mode 100755
index f0d60d00177..00000000000
--- a/Build/source/texk/texlive/w32_wrapper/runscript.dll
+++ /dev/null
Binary files differ
diff --git a/Build/source/texk/texlive/w32_wrapper/runscript.exe b/Build/source/texk/texlive/w32_wrapper/runscript.exe
deleted file mode 100755
index 5777d90a17a..00000000000
--- a/Build/source/texk/texlive/w32_wrapper/runscript.exe
+++ /dev/null
Binary files differ
diff --git a/Build/source/texk/texlive/w64_mingw_wrapper/context/mtxrun.dll b/Build/source/texk/texlive/w64_mingw_wrapper/context/mtxrun.dll
deleted file mode 100755
index 3c4481c319d..00000000000
--- a/Build/source/texk/texlive/w64_mingw_wrapper/context/mtxrun.dll
+++ /dev/null
Binary files differ
diff --git a/Build/source/texk/texlive/w64_mingw_wrapper/context/mtxrun.exe b/Build/source/texk/texlive/w64_mingw_wrapper/context/mtxrun.exe
deleted file mode 100755
index 0e7882cf926..00000000000
--- a/Build/source/texk/texlive/w64_mingw_wrapper/context/mtxrun.exe
+++ /dev/null
Binary files differ
diff --git a/Build/source/texk/texlive/w64_mingw_wrapper/libkpathsea-6.dll b/Build/source/texk/texlive/w64_mingw_wrapper/libkpathsea-6.dll
deleted file mode 100755
index d821e4a30a4..00000000000
--- a/Build/source/texk/texlive/w64_mingw_wrapper/libkpathsea-6.dll
+++ /dev/null
Binary files differ
diff --git a/Build/source/texk/texlive/w64_mingw_wrapper/runscript.dll b/Build/source/texk/texlive/w64_mingw_wrapper/runscript.dll
deleted file mode 100755
index aa418b5d4f6..00000000000
--- a/Build/source/texk/texlive/w64_mingw_wrapper/runscript.dll
+++ /dev/null
Binary files differ
diff --git a/Build/source/texk/texlive/w64_mingw_wrapper/runscript.exe b/Build/source/texk/texlive/w64_mingw_wrapper/runscript.exe
deleted file mode 100755
index d765cdf75a5..00000000000
--- a/Build/source/texk/texlive/w64_mingw_wrapper/runscript.exe
+++ /dev/null
Binary files differ
diff --git a/Build/source/texk/texlive/w64_mingw_wrapper/texlua.dll b/Build/source/texk/texlive/w64_mingw_wrapper/texlua.dll
deleted file mode 100755
index 0a4d2e638bf..00000000000
--- a/Build/source/texk/texlive/w64_mingw_wrapper/texlua.dll
+++ /dev/null
Binary files differ
diff --git a/Build/source/texk/texlive/w64_mingw_wrapper/texlua.exe b/Build/source/texk/texlive/w64_mingw_wrapper/texlua.exe
deleted file mode 100755
index daf7cd29ecb..00000000000
--- a/Build/source/texk/texlive/w64_mingw_wrapper/texlua.exe
+++ /dev/null
Binary files differ
diff --git a/Build/source/texk/texlive/w64_wrapper/context/mtxrun.dll b/Build/source/texk/texlive/w64_wrapper/context/mtxrun.dll
deleted file mode 100755
index 91050273583..00000000000
--- a/Build/source/texk/texlive/w64_wrapper/context/mtxrun.dll
+++ /dev/null
Binary files differ
diff --git a/Build/source/texk/texlive/w64_wrapper/context/mtxrun.exe b/Build/source/texk/texlive/w64_wrapper/context/mtxrun.exe
deleted file mode 100755
index 93290a6e0a8..00000000000
--- a/Build/source/texk/texlive/w64_wrapper/context/mtxrun.exe
+++ /dev/null
Binary files differ
diff --git a/Build/source/texk/texlive/w64_wrapper/runscript.dll b/Build/source/texk/texlive/w64_wrapper/runscript.dll
deleted file mode 100755
index 2294fb59591..00000000000
--- a/Build/source/texk/texlive/w64_wrapper/runscript.dll
+++ /dev/null
Binary files differ
diff --git a/Build/source/texk/texlive/w64_wrapper/runscript.exe b/Build/source/texk/texlive/w64_wrapper/runscript.exe
deleted file mode 100755
index baa241d679c..00000000000
--- a/Build/source/texk/texlive/w64_wrapper/runscript.exe
+++ /dev/null
Binary files differ
diff --git a/Build/source/texk/texlive/w32_wrapper/README b/Build/source/texk/texlive/windows_mingw_wrapper/README
index 33eb4ae5181..33eb4ae5181 100644
--- a/Build/source/texk/texlive/w32_wrapper/README
+++ b/Build/source/texk/texlive/windows_mingw_wrapper/README
diff --git a/Build/source/texk/texlive/w32_wrapper/bitmap2eps.ico b/Build/source/texk/texlive/windows_mingw_wrapper/bitmap2eps.ico
index be4be44b3d1..be4be44b3d1 100644
--- a/Build/source/texk/texlive/w32_wrapper/bitmap2eps.ico
+++ b/Build/source/texk/texlive/windows_mingw_wrapper/bitmap2eps.ico
Binary files differ
diff --git a/Build/source/texk/texlive/w32_wrapper/bitmap2eps.svg b/Build/source/texk/texlive/windows_mingw_wrapper/bitmap2eps.svg
index aac123a3914..aac123a3914 100644
--- a/Build/source/texk/texlive/w32_wrapper/bitmap2eps.svg
+++ b/Build/source/texk/texlive/windows_mingw_wrapper/bitmap2eps.svg
diff --git a/Build/source/texk/texlive/w32_wrapper/calldll.c b/Build/source/texk/texlive/windows_mingw_wrapper/calldll.c
index ddb17f31055..ddb17f31055 100644
--- a/Build/source/texk/texlive/w32_wrapper/calldll.c
+++ b/Build/source/texk/texlive/windows_mingw_wrapper/calldll.c
diff --git a/Build/source/texk/texlive/w32_wrapper/callexe.c b/Build/source/texk/texlive/windows_mingw_wrapper/callexe.c
index 2aa041ea0da..2aa041ea0da 100644
--- a/Build/source/texk/texlive/w32_wrapper/callexe.c
+++ b/Build/source/texk/texlive/windows_mingw_wrapper/callexe.c
diff --git a/Build/source/texk/texlive/w32_wrapper/context/mtxrun_dll.c b/Build/source/texk/texlive/windows_mingw_wrapper/context/mtxrun_dll.c
index fc2e260f5a2..fc2e260f5a2 100644
--- a/Build/source/texk/texlive/w32_wrapper/context/mtxrun_dll.c
+++ b/Build/source/texk/texlive/windows_mingw_wrapper/context/mtxrun_dll.c
diff --git a/Build/source/texk/texlive/w32_wrapper/context/mtxrun_exe.c b/Build/source/texk/texlive/windows_mingw_wrapper/context/mtxrun_exe.c
index 0c27c272e37..0c27c272e37 100644
--- a/Build/source/texk/texlive/w32_wrapper/context/mtxrun_exe.c
+++ b/Build/source/texk/texlive/windows_mingw_wrapper/context/mtxrun_exe.c
diff --git a/Build/source/texk/texlive/w32_wrapper/context/readme.txt b/Build/source/texk/texlive/windows_mingw_wrapper/context/readme.txt
index 72892ee2f11..72892ee2f11 100644
--- a/Build/source/texk/texlive/w32_wrapper/context/readme.txt
+++ b/Build/source/texk/texlive/windows_mingw_wrapper/context/readme.txt
diff --git a/Build/source/texk/texlive/w64_mingw_wrapper/readme.txt b/Build/source/texk/texlive/windows_mingw_wrapper/readme.txt
index a4637d812ae..a4637d812ae 100644
--- a/Build/source/texk/texlive/w64_mingw_wrapper/readme.txt
+++ b/Build/source/texk/texlive/windows_mingw_wrapper/readme.txt
diff --git a/Build/source/texk/texlive/w64_mingw_wrapper/runscript.tlu b/Build/source/texk/texlive/windows_mingw_wrapper/runscript.tlu
index 0f94c5603aa..0f94c5603aa 100755..100644
--- a/Build/source/texk/texlive/w64_mingw_wrapper/runscript.tlu
+++ b/Build/source/texk/texlive/windows_mingw_wrapper/runscript.tlu
diff --git a/Build/source/texk/texlive/w64_mingw_wrapper/runscript_dll.c b/Build/source/texk/texlive/windows_mingw_wrapper/runscript_dll.c
index 588c84b95bc..588c84b95bc 100644
--- a/Build/source/texk/texlive/w64_mingw_wrapper/runscript_dll.c
+++ b/Build/source/texk/texlive/windows_mingw_wrapper/runscript_dll.c
diff --git a/Build/source/texk/texlive/w32_wrapper/runscript_exe.c b/Build/source/texk/texlive/windows_mingw_wrapper/runscript_exe.c
index 29d04a93a43..29d04a93a43 100644
--- a/Build/source/texk/texlive/w32_wrapper/runscript_exe.c
+++ b/Build/source/texk/texlive/windows_mingw_wrapper/runscript_exe.c
diff --git a/Build/source/texk/texlive/w64_mingw_wrapper/tl-tray-menu.c b/Build/source/texk/texlive/windows_mingw_wrapper/tl-tray-menu.c
index fe65d54515a..fe65d54515a 100644
--- a/Build/source/texk/texlive/w64_mingw_wrapper/tl-tray-menu.c
+++ b/Build/source/texk/texlive/windows_mingw_wrapper/tl-tray-menu.c
diff --git a/Build/source/texk/texlive/w32_wrapper/tlmgr-gui.txt b/Build/source/texk/texlive/windows_mingw_wrapper/tlmgr-gui.txt
index 559d97ed3f2..559d97ed3f2 100644
--- a/Build/source/texk/texlive/w32_wrapper/tlmgr-gui.txt
+++ b/Build/source/texk/texlive/windows_mingw_wrapper/tlmgr-gui.txt
diff --git a/Build/source/texk/texlive/w32_wrapper/tlmgr.ico b/Build/source/texk/texlive/windows_mingw_wrapper/tlmgr.ico
index 6f0c37f54e0..6f0c37f54e0 100644
--- a/Build/source/texk/texlive/w32_wrapper/tlmgr.ico
+++ b/Build/source/texk/texlive/windows_mingw_wrapper/tlmgr.ico
Binary files differ
diff --git a/Build/source/texk/texlive/w32_wrapper/tlmgr.svg b/Build/source/texk/texlive/windows_mingw_wrapper/tlmgr.svg
index 6e60a8f273c..6e60a8f273c 100644
--- a/Build/source/texk/texlive/w32_wrapper/tlmgr.svg
+++ b/Build/source/texk/texlive/windows_mingw_wrapper/tlmgr.svg
diff --git a/Build/source/texk/texlive/w32_wrapper/wrunscript_exe.c b/Build/source/texk/texlive/windows_mingw_wrapper/wrunscript_exe.c
index 573501ae757..573501ae757 100644
--- a/Build/source/texk/texlive/w32_wrapper/wrunscript_exe.c
+++ b/Build/source/texk/texlive/windows_mingw_wrapper/wrunscript_exe.c
diff --git a/Build/source/texk/texlive/w64_mingw_wrapper/README b/Build/source/texk/texlive/windows_wrapper/README
index 33eb4ae5181..5377c7ac07b 100644
--- a/Build/source/texk/texlive/w64_mingw_wrapper/README
+++ b/Build/source/texk/texlive/windows_wrapper/README
@@ -1,8 +1,8 @@
-This file and the graphics are public domain.
-
-This directory is for the generic TeX Live wrapper on Windows that is
-used for most scripts. The main file is runscript.tlu.
-
-*.svg are the sources for *.ico,
-and the *.ico are used in wrappers.
-Hence their locaton here.
+This file and the graphics are public domain.
+
+This directory is for the generic TeX Live wrapper on Windows that is
+used for most scripts. The main file is runscript.tlu.
+
+*.svg are the sources for *.ico,
+and the *.ico are used in wrappers.
+Hence their locaton here.
diff --git a/Build/source/texk/texlive/w64_mingw_wrapper/bitmap2eps.ico b/Build/source/texk/texlive/windows_wrapper/bitmap2eps.ico
index be4be44b3d1..be4be44b3d1 100644
--- a/Build/source/texk/texlive/w64_mingw_wrapper/bitmap2eps.ico
+++ b/Build/source/texk/texlive/windows_wrapper/bitmap2eps.ico
Binary files differ
diff --git a/Build/source/texk/texlive/w64_mingw_wrapper/bitmap2eps.svg b/Build/source/texk/texlive/windows_wrapper/bitmap2eps.svg
index aac123a3914..aac123a3914 100644
--- a/Build/source/texk/texlive/w64_mingw_wrapper/bitmap2eps.svg
+++ b/Build/source/texk/texlive/windows_wrapper/bitmap2eps.svg
diff --git a/Build/source/texk/texlive/w64_mingw_wrapper/calldll.c b/Build/source/texk/texlive/windows_wrapper/calldll.c
index ddb17f31055..68646929cdf 100644
--- a/Build/source/texk/texlive/w64_mingw_wrapper/calldll.c
+++ b/Build/source/texk/texlive/windows_wrapper/calldll.c
@@ -1,13 +1,13 @@
-/* Public domain.
- * Originally written by Akira Kakuto <kakuto@fuk.kindai.ac.jp>
- *
- * DLL calling main program for TeX & Co
- * DLLPROC must be defined in the Makefile as,
- * e.g., -DDLLPROC=dlltexmain.
- */
-
-__declspec(dllimport) DLLPROC(int ac, char **av);
-int main(int ac, char **av)
-{
- return (DLLPROC(ac, av));
-}
+/* Public domain.
+ * Originally written by Akira Kakuto <kakuto@fuk.kindai.ac.jp>
+ *
+ * DLL calling main program for TeX & Co
+ * DLLPROC must be defined in the Makefile as,
+ * e.g., -DDLLPROC=dlltexmain.
+ */
+
+__declspec(dllimport) DLLPROC(int ac, char **av);
+int main(int ac, char **av)
+{
+ return (DLLPROC(ac, av));
+}
diff --git a/Build/source/texk/texlive/w64_mingw_wrapper/callexe.c b/Build/source/texk/texlive/windows_wrapper/callexe.c
index 2aa041ea0da..62e86979bc1 100644
--- a/Build/source/texk/texlive/w64_mingw_wrapper/callexe.c
+++ b/Build/source/texk/texlive/windows_wrapper/callexe.c
@@ -1,43 +1,43 @@
-/* Public domain.
- * Originally written by Akira Kakuto <kakuto@fuk.kindai.ac.jp>
- *
- * WIN32 wrapper program replacing Unix symlinks such as,
- * e.g., ofm2opl -> omfonts.
- *
- * EXEPROG must be defined in the Makefile as,
- * e.g., -DEXEPROG=\"omfonts.exe\".
- */
-#include <stdio.h>
-#include <stdlib.h>
-#include <process.h>
-#include <string.h>
-#include <malloc.h>
-
-static int is_include_space(char *s)
-{
- char *p;
- p = strchr(s, ' ');
- if(p) return 1;
- p = strchr(s, '\t');
- if(p) return 1;
- return 0;
-}
-
-int main(int argc, char *argv[])
-{
- int i;
- char *p;
-
- for(i = 0; i < argc; i++) {
- if(is_include_space(argv[i])) {
- p = (char *)malloc(strlen(argv[i])+3);
- strcpy(p, "\"");
- strcat(p, argv[i]);
- strcat(p, "\"");
- free(argv[i]);
- argv[i] = p;
- }
- }
- argv[argc] = NULL;
- return _spawnvp(_P_WAIT, EXEPROG, (const char * const *)argv);
-}
+/* Public domain.
+ * Originally written by Akira Kakuto <kakuto@fuk.kindai.ac.jp>
+ *
+ * WIN32 wrapper program replacing Unix symlinks such as,
+ * e.g., ofm2opl -> omfonts.
+ *
+ * EXEPROG must be defined in the Makefile as,
+ * e.g., -DEXEPROG=\"omfonts.exe\".
+ */
+#include <stdio.h>
+#include <stdlib.h>
+#include <process.h>
+#include <string.h>
+#include <malloc.h>
+
+static int is_include_space(char *s)
+{
+ char *p;
+ p = strchr(s, ' ');
+ if(p) return 1;
+ p = strchr(s, '\t');
+ if(p) return 1;
+ return 0;
+}
+
+int main(int argc, char *argv[])
+{
+ int i;
+ char *p;
+
+ for(i = 0; i < argc; i++) {
+ if(is_include_space(argv[i])) {
+ p = (char *)malloc(strlen(argv[i])+3);
+ strcpy(p, "\"");
+ strcat(p, argv[i]);
+ strcat(p, "\"");
+ free(argv[i]);
+ argv[i] = p;
+ }
+ }
+ argv[argc] = NULL;
+ return _spawnvp(_P_WAIT, EXEPROG, (const char * const *)argv);
+}
diff --git a/Build/source/texk/texlive/w64_mingw_wrapper/context/mtxrun_dll.c b/Build/source/texk/texlive/windows_wrapper/context/mtxrun_dll.c
index fc2e260f5a2..f5688c71870 100644
--- a/Build/source/texk/texlive/w64_mingw_wrapper/context/mtxrun_dll.c
+++ b/Build/source/texk/texlive/windows_wrapper/context/mtxrun_dll.c
@@ -1,306 +1,306 @@
-/************************************************************************
-
- Copyright:
-
- Public Domain
- Originally written in 2010 by Tomasz M. Trzeciak and Hans Hagen
-
- This program is derived from the 'runscript' program originally
- written in 2009 by T.M. Trzeciak. It has been adapted for use in
- ConTeXt MkIV.
-
- Comment:
-
- In ConTeXt MkIV we have two core scripts: luatools.lua and
- mtxrun.lua where the second one is used to launch other scripts.
- Normally a user will use a call like:
-
- mtxrun --script font --reload
-
- Here mtxrun is a lua script. In order to avoid the usage of a cmd
- file on windows this runner will start texlua directly. If the
- shared library luatex.dll is available, texlua will be started in
- the same process avoiding thus any additional overhead. Otherwise
- it will be spawned in a new proces.
-
- We also don't want to use other runners, like those that use kpse
- to locate the script as this is exactly what mtxrun itself is doing
- already. Therefore the runscript program is adapted to a more direct
- approach suitable for mtxrun.
-
- Compilation:
-
- with gcc (size optimized):
-
- gcc -Os -s -shared -o mtxrun.dll mtxrun_dll.c
- gcc -Os -s -o mtxrun.exe mtxrun_exe.c -L./ -lmtxrun
-
- with tcc (extra small size):
-
- tcc -shared -o mtxrun.dll mtxrun_dll.c
- tcc -o mtxrun.exe mtxrun_exe.c mtxrun.def
-
-************************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <windows.h>
-
-//#define STATIC
-#define IS_WHITESPACE(c) ((c == ' ') || (c == '\t'))
-#define MAX_CMD 32768
-#define DIE(...) { \
- fprintf( stderr, "mtxrun: " ); \
- fprintf( stderr, __VA_ARGS__ ); \
- return 1; \
-}
-
-static char cmdline[MAX_CMD];
-static char dirpath[MAX_PATH];
-static char progname[MAX_PATH];
-static char scriptpath[MAX_PATH];
-static char luatexpath[MAX_PATH];
-HMODULE dllluatex = NULL;
-typedef int ( *mainlikeproc )( int, char ** );
-
-#ifdef STATIC
-int main( int argc, char *argv[] )
-#else
-__declspec(dllexport) int dllrunscript( int argc, char *argv[] )
-#endif
-{
- char *binary, *s, *luatexfname, *argstr, **lua_argv;
- int k, quoted, lua_argc;
- int passprogname = 0;
- unsigned char is_jit=0;
-
- // directory of this module/executable
- HMODULE module_handle = GetModuleHandle( "mtxrun.dll" );
- // if ( module_handle == NULL ) exe path will be used, which is OK too
- k = (int) GetModuleFileName( module_handle, dirpath, MAX_PATH );
- if ( !k || ( k == MAX_PATH ) )
- DIE( "unable to determine a valid module name\n" );
- s = strrchr(dirpath, '\\');
- if ( s == NULL ) DIE( "no directory part in module path: %s\n", dirpath );
- *(++s) = '\0'; //remove file name, leave trailing backslash
-
- // program name
- k = strlen(argv[0]);
- while ( k && (argv[0][k-1] != '/') && (argv[0][k-1] != '\\') ) k--;
- strcpy(progname, &argv[0][k]);
- s = progname;
- if ( s = strrchr(s, '.') ) *s = '\0'; // remove file extension part
-
- /* check "jit" : strlen("jit") = 3 */
- if (strncmp(progname + strlen(progname) - 3, "jit", 3) == 0) {
- is_jit = 1;
- progname[strlen(progname) - 3]='\0';
- }
- else
- is_jit = 0;
-
- // script path
-
- strcpy( scriptpath, dirpath );
- k = strlen(progname);
- if ( k < 6 ) k = 6; // in case the program name is shorter than "mtxrun"
- if ( strlen(dirpath) + k + 4 >= MAX_PATH )
- DIE( "path too long: %s%s\n", dirpath, progname );
-
- if ( strcmpi(progname,"mtxrun") == 0 ) {
- strcat( scriptpath, progname );
- strcat( scriptpath, ".lua" );
- } else if ( strcmpi(progname,"luatools") == 0 ) {
- strcat( scriptpath, "mtxrun.lua" );
- strcpy( progname, "base" );
- passprogname = 1;
- } else if ( strcmpi(progname,"texmfstart") == 0 ) {
- strcat( scriptpath, "mtxrun.lua" );
- } else {
- strcat( scriptpath, "mtxrun.lua" );
- passprogname = 1;
- }
- if ( GetFileAttributes(scriptpath) == INVALID_FILE_ATTRIBUTES )
- DIE( "file not found: %s\n", scriptpath );
-
- // find luatex.exe /luajittex.exe
- if ( SearchPath(
- dirpath, // was getenv( "PATH" ), // path to search (optional)
- (is_jit ? "luajittex.exe":"luatex.exe"), // file name to search
- NULL, // file extension to add (optional)
- MAX_PATH, // output buffer size
- luatexpath, // output buffer pointer
- &luatexfname ) // pointer to a file part in the output buffer (optional)
- ) {
- binary = (is_jit ? "luajittex.exe":"luatex.exe");
- } else if ( SearchPath(
- dirpath, // was getenv( "PATH" ), // path to search (optional)
- (is_jit ? "texluajit.exe":"texlua.exe"), // file name to search
- NULL, // file extension to add (optional)
- MAX_PATH, // output buffer size
- luatexpath, // output buffer pointer
- &luatexfname ) // pointer to a file part in the output buffer (optional)
- ) {
- binary = (is_jit ? "texluajit.exe":"texlua.exe");
- } else if ( SearchPath(
- getenv("PATH"), // was dirpath, // path to search (optional)
- (is_jit ? "luajittex.exe":"luatex.exe"), // file name to search
- NULL, // file extension to add (optional)
- MAX_PATH, // output buffer size
- luatexpath, // output buffer pointer
- &luatexfname ) // pointer to a file part in the output buffer (optional)
- ) {
- binary = (is_jit ? "luajittex.exe":"luatex.exe");
- } else if ( SearchPath(
- getenv("PATH") , // was dirpath, // path to search (optional)
- (is_jit ? "texluajit.exe":"texlua.exe"), // file name to search
- NULL, // file extension to add (optional)
- MAX_PATH, // output buffer size
- luatexpath, // output buffer pointer
- &luatexfname ) // pointer to a file part in the output buffer (optional)
- ) {
- binary = (is_jit ? "texluajit.exe":"texlua.exe");
- }else {
- DIE( "unable to locate texlua.exe on the search path" );
- }
-
- /* if ( SearchPath( */
- /* dirpath, // was getenv( "PATH" ), // path to search (optional) */
- /* (is_jit ? "luajittex.exe":"luatex.exe"), // file name to search */
- /* NULL, // file extension to add (optional) */
- /* MAX_PATH, // output buffer size */
- /* luatexpath, // output buffer pointer */
- /* &luatexfname ) // pointer to a file part in the output buffer (optional) */
- /* ) { */
- /* binary = (is_jit ? "luajittex.exe":"luatex.exe"); */
- /* }else if ( SearchPath( */
- /* getenv("PATH"), // was dirpath, // path to search (optional) */
- /* (is_jit ? "luajittex.exe":"luatex.exe"), // file name to search */
- /* NULL, // file extension to add (optional) */
- /* MAX_PATH, // output buffer size */
- /* luatexpath, // output buffer pointer */
- /* &luatexfname ) // pointer to a file part in the output buffer (optional) */
- /* ) { */
- /* binary = (is_jit ? "luajittex.exe":"luatex.exe"); */
- /* }else if ( SearchPath( */
- /* dirpath, // was getenv( "PATH" ), // path to search (optional) */
- /* (is_jit ? "texluajit.exe":"texlua.exe"), // file name to search */
- /* NULL, // file extension to add (optional) */
- /* MAX_PATH, // output buffer size */
- /* luatexpath, // output buffer pointer */
- /* &luatexfname ) // pointer to a file part in the output buffer (optional) */
- /* ) { */
- /* binary = (is_jit ? "texluajit.exe":"texlua.exe"); */
- /* }else if ( SearchPath( */
- /* getenv("PATH") , // was dirpath, // path to search (optional) */
- /* (is_jit ? "texluajit.exe":"texlua.exe"), // file name to search */
- /* NULL, // file extension to add (optional) */
- /* MAX_PATH, // output buffer size */
- /* luatexpath, // output buffer pointer */
- /* &luatexfname ) // pointer to a file part in the output buffer (optional) */
- /* ) { */
- /* binary = (is_jit ? "texluajit.exe":"texlua.exe"); */
- /* }else { */
- /* DIE( "unable to locate texlua.exe on the search path" ); */
- /* } */
-
-
-
-
- // link directly with luatex.dll if available in texlua's dir
- strcpy( luatexfname, (is_jit ? "luajittex.dll":"luatex.dll") );
- if ( dllluatex = LoadLibrary(luatexpath) )
- {
- mainlikeproc dllluatexmain = (mainlikeproc) GetProcAddress( dllluatex, (is_jit ? "dllluajittexmain": "dllluatexmain" ));
- if ( dllluatexmain == NULL )
- if (is_jit)
- DIE( "unable to locate dllluatexmain procedure in luajittex.dll" )
- else
- DIE( "unable to locate dllluatexmain procedure in luatex.dll" );
-
- // set up argument list for texlua script
-
- lua_argv = (char **)malloc( (argc + 5) * sizeof(char *) );
- if ( lua_argv == NULL ) DIE( "out of memory\n" );
- lua_argv[lua_argc=0] = luatexfname;
- lua_argv[++lua_argc] = "--luaonly";
- lua_argv[++lua_argc] = scriptpath; // script to execute
- if (passprogname) {
- lua_argv[++lua_argc] = "--script";
- lua_argv[++lua_argc] = progname;
- }
- for ( k = 1; k < argc; k++ ) lua_argv[++lua_argc] = argv[k];
- lua_argv[++lua_argc] = NULL;
-
- // call texlua interpreter
- // dllluatexmain never returns, but we pretend that it does
-
- k = dllluatexmain( lua_argc, lua_argv );
- if (lua_argv) free( lua_argv );
- return k;
- }
- // we are still here, so no luatex.dll; spawn texlua.exe instead
-
- strcpy( luatexfname,binary);
- strcpy( cmdline, " --luaonly " );
- strcpy( cmdline, "\"" );
- strcat( cmdline, luatexpath );
- strcat( cmdline, "\" \"" );
- strcat( cmdline, scriptpath );
- strcat( cmdline, "\"" );
- if (passprogname) {
- strcat( cmdline, " --script " );
- strcat( cmdline, progname );
- }
- argstr = GetCommandLine(); // get the command line of this process
- if ( argstr == NULL ) DIE( "unable to retrieve the command line string\n" );
-
- // skip over argv[0] in the argument string
- // (it can contain embedded double quotes if launched from cmd.exe!)
-
- for ( quoted = 0; (*argstr) && ( !IS_WHITESPACE(*argstr) || quoted ); argstr++ )
- if (*argstr == '"') quoted = !quoted;
-
- // pass through all the arguments
-
- if ( strlen(cmdline) + strlen(argstr) >= MAX_CMD )
- DIE( "command line string too long:\n%s%s\n", cmdline, argstr );
- strcat( cmdline, argstr );
-
- // create child process
-
- STARTUPINFO si;
- PROCESS_INFORMATION pi;
- ZeroMemory( &si, sizeof(si) );
- si.cb = sizeof(si);
- si.dwFlags = STARTF_USESTDHANDLES;// | STARTF_USESHOWWINDOW;
- //si.dwFlags = STARTF_USESHOWWINDOW;
- //si.wShowWindow = SW_HIDE ; // can be used to hide console window (requires STARTF_USESHOWWINDOW flag)
- si.hStdInput = GetStdHandle( STD_INPUT_HANDLE );
- si.hStdOutput = GetStdHandle( STD_OUTPUT_HANDLE );
- si.hStdError = GetStdHandle( STD_ERROR_HANDLE );
- ZeroMemory( &pi, sizeof(pi) );
- if( !CreateProcess(
- NULL, // module name (uses command line if NULL)
- cmdline, // command line
- NULL, // process security atrributes
- NULL, // thread security atrributes
- TRUE, // handle inheritance
- 0, // creation flags, e.g. CREATE_NEW_CONSOLE, CREATE_NO_WINDOW, DETACHED_PROCESS
- NULL, // pointer to environment block (uses parent if NULL)
- NULL, // starting directory (uses parent if NULL)
- &si, // STARTUPINFO structure
- &pi ) // PROCESS_INFORMATION structure
- ) DIE( "command execution failed: %s\n", cmdline );
- DWORD ret = 0;
- CloseHandle( pi.hThread ); // thread handle is not needed
- if ( WaitForSingleObject( pi.hProcess, INFINITE ) == WAIT_OBJECT_0 ) {
- if ( !GetExitCodeProcess( pi.hProcess, &ret) )
- DIE( "unable to retrieve process exit code: %s\n", cmdline );
- } else DIE( "failed to wait for process termination: %s\n", cmdline );
- CloseHandle( pi.hProcess );
-
- // propagate exit code from the child process
- return ret;
-
-}
+/************************************************************************
+
+ Copyright:
+
+ Public Domain
+ Originally written in 2010 by Tomasz M. Trzeciak and Hans Hagen
+
+ This program is derived from the 'runscript' program originally
+ written in 2009 by T.M. Trzeciak. It has been adapted for use in
+ ConTeXt MkIV.
+
+ Comment:
+
+ In ConTeXt MkIV we have two core scripts: luatools.lua and
+ mtxrun.lua where the second one is used to launch other scripts.
+ Normally a user will use a call like:
+
+ mtxrun --script font --reload
+
+ Here mtxrun is a lua script. In order to avoid the usage of a cmd
+ file on windows this runner will start texlua directly. If the
+ shared library luatex.dll is available, texlua will be started in
+ the same process avoiding thus any additional overhead. Otherwise
+ it will be spawned in a new proces.
+
+ We also don't want to use other runners, like those that use kpse
+ to locate the script as this is exactly what mtxrun itself is doing
+ already. Therefore the runscript program is adapted to a more direct
+ approach suitable for mtxrun.
+
+ Compilation:
+
+ with gcc (size optimized):
+
+ gcc -Os -s -shared -o mtxrun.dll mtxrun_dll.c
+ gcc -Os -s -o mtxrun.exe mtxrun_exe.c -L./ -lmtxrun
+
+ with tcc (extra small size):
+
+ tcc -shared -o mtxrun.dll mtxrun_dll.c
+ tcc -o mtxrun.exe mtxrun_exe.c mtxrun.def
+
+************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <windows.h>
+
+//#define STATIC
+#define IS_WHITESPACE(c) ((c == ' ') || (c == '\t'))
+#define MAX_CMD 32768
+#define DIE(...) { \
+ fprintf( stderr, "mtxrun: " ); \
+ fprintf( stderr, __VA_ARGS__ ); \
+ return 1; \
+}
+
+static char cmdline[MAX_CMD];
+static char dirpath[MAX_PATH];
+static char progname[MAX_PATH];
+static char scriptpath[MAX_PATH];
+static char luatexpath[MAX_PATH];
+HMODULE dllluatex = NULL;
+typedef int ( *mainlikeproc )( int, char ** );
+
+#ifdef STATIC
+int main( int argc, char *argv[] )
+#else
+__declspec(dllexport) int dllrunscript( int argc, char *argv[] )
+#endif
+{
+ char *binary, *s, *luatexfname, *argstr, **lua_argv;
+ int k, quoted, lua_argc;
+ int passprogname = 0;
+ unsigned char is_jit=0;
+
+ // directory of this module/executable
+ HMODULE module_handle = GetModuleHandle( "mtxrun.dll" );
+ // if ( module_handle == NULL ) exe path will be used, which is OK too
+ k = (int) GetModuleFileName( module_handle, dirpath, MAX_PATH );
+ if ( !k || ( k == MAX_PATH ) )
+ DIE( "unable to determine a valid module name\n" );
+ s = strrchr(dirpath, '\\');
+ if ( s == NULL ) DIE( "no directory part in module path: %s\n", dirpath );
+ *(++s) = '\0'; //remove file name, leave trailing backslash
+
+ // program name
+ k = strlen(argv[0]);
+ while ( k && (argv[0][k-1] != '/') && (argv[0][k-1] != '\\') ) k--;
+ strcpy(progname, &argv[0][k]);
+ s = progname;
+ if ( s = strrchr(s, '.') ) *s = '\0'; // remove file extension part
+
+ /* check "jit" : strlen("jit") = 3 */
+ if (strncmp(progname + strlen(progname) - 3, "jit", 3) == 0) {
+ is_jit = 1;
+ progname[strlen(progname) - 3]='\0';
+ }
+ else
+ is_jit = 0;
+
+ // script path
+
+ strcpy( scriptpath, dirpath );
+ k = strlen(progname);
+ if ( k < 6 ) k = 6; // in case the program name is shorter than "mtxrun"
+ if ( strlen(dirpath) + k + 4 >= MAX_PATH )
+ DIE( "path too long: %s%s\n", dirpath, progname );
+
+ if ( strcmpi(progname,"mtxrun") == 0 ) {
+ strcat( scriptpath, progname );
+ strcat( scriptpath, ".lua" );
+ } else if ( strcmpi(progname,"luatools") == 0 ) {
+ strcat( scriptpath, "mtxrun.lua" );
+ strcpy( progname, "base" );
+ passprogname = 1;
+ } else if ( strcmpi(progname,"texmfstart") == 0 ) {
+ strcat( scriptpath, "mtxrun.lua" );
+ } else {
+ strcat( scriptpath, "mtxrun.lua" );
+ passprogname = 1;
+ }
+ if ( GetFileAttributes(scriptpath) == INVALID_FILE_ATTRIBUTES )
+ DIE( "file not found: %s\n", scriptpath );
+
+ // find luatex.exe /luajittex.exe
+ if ( SearchPath(
+ dirpath, // was getenv( "PATH" ), // path to search (optional)
+ (is_jit ? "luajittex.exe":"luatex.exe"), // file name to search
+ NULL, // file extension to add (optional)
+ MAX_PATH, // output buffer size
+ luatexpath, // output buffer pointer
+ &luatexfname ) // pointer to a file part in the output buffer (optional)
+ ) {
+ binary = (is_jit ? "luajittex.exe":"luatex.exe");
+ } else if ( SearchPath(
+ dirpath, // was getenv( "PATH" ), // path to search (optional)
+ (is_jit ? "texluajit.exe":"texlua.exe"), // file name to search
+ NULL, // file extension to add (optional)
+ MAX_PATH, // output buffer size
+ luatexpath, // output buffer pointer
+ &luatexfname ) // pointer to a file part in the output buffer (optional)
+ ) {
+ binary = (is_jit ? "texluajit.exe":"texlua.exe");
+ } else if ( SearchPath(
+ getenv("PATH"), // was dirpath, // path to search (optional)
+ (is_jit ? "luajittex.exe":"luatex.exe"), // file name to search
+ NULL, // file extension to add (optional)
+ MAX_PATH, // output buffer size
+ luatexpath, // output buffer pointer
+ &luatexfname ) // pointer to a file part in the output buffer (optional)
+ ) {
+ binary = (is_jit ? "luajittex.exe":"luatex.exe");
+ } else if ( SearchPath(
+ getenv("PATH") , // was dirpath, // path to search (optional)
+ (is_jit ? "texluajit.exe":"texlua.exe"), // file name to search
+ NULL, // file extension to add (optional)
+ MAX_PATH, // output buffer size
+ luatexpath, // output buffer pointer
+ &luatexfname ) // pointer to a file part in the output buffer (optional)
+ ) {
+ binary = (is_jit ? "texluajit.exe":"texlua.exe");
+ }else {
+ DIE( "unable to locate texlua.exe on the search path" );
+ }
+
+ /* if ( SearchPath( */
+ /* dirpath, // was getenv( "PATH" ), // path to search (optional) */
+ /* (is_jit ? "luajittex.exe":"luatex.exe"), // file name to search */
+ /* NULL, // file extension to add (optional) */
+ /* MAX_PATH, // output buffer size */
+ /* luatexpath, // output buffer pointer */
+ /* &luatexfname ) // pointer to a file part in the output buffer (optional) */
+ /* ) { */
+ /* binary = (is_jit ? "luajittex.exe":"luatex.exe"); */
+ /* }else if ( SearchPath( */
+ /* getenv("PATH"), // was dirpath, // path to search (optional) */
+ /* (is_jit ? "luajittex.exe":"luatex.exe"), // file name to search */
+ /* NULL, // file extension to add (optional) */
+ /* MAX_PATH, // output buffer size */
+ /* luatexpath, // output buffer pointer */
+ /* &luatexfname ) // pointer to a file part in the output buffer (optional) */
+ /* ) { */
+ /* binary = (is_jit ? "luajittex.exe":"luatex.exe"); */
+ /* }else if ( SearchPath( */
+ /* dirpath, // was getenv( "PATH" ), // path to search (optional) */
+ /* (is_jit ? "texluajit.exe":"texlua.exe"), // file name to search */
+ /* NULL, // file extension to add (optional) */
+ /* MAX_PATH, // output buffer size */
+ /* luatexpath, // output buffer pointer */
+ /* &luatexfname ) // pointer to a file part in the output buffer (optional) */
+ /* ) { */
+ /* binary = (is_jit ? "texluajit.exe":"texlua.exe"); */
+ /* }else if ( SearchPath( */
+ /* getenv("PATH") , // was dirpath, // path to search (optional) */
+ /* (is_jit ? "texluajit.exe":"texlua.exe"), // file name to search */
+ /* NULL, // file extension to add (optional) */
+ /* MAX_PATH, // output buffer size */
+ /* luatexpath, // output buffer pointer */
+ /* &luatexfname ) // pointer to a file part in the output buffer (optional) */
+ /* ) { */
+ /* binary = (is_jit ? "texluajit.exe":"texlua.exe"); */
+ /* }else { */
+ /* DIE( "unable to locate texlua.exe on the search path" ); */
+ /* } */
+
+
+
+
+ // link directly with luatex.dll if available in texlua's dir
+ strcpy( luatexfname, (is_jit ? "luajittex.dll":"luatex.dll") );
+ if ( dllluatex = LoadLibrary(luatexpath) )
+ {
+ mainlikeproc dllluatexmain = (mainlikeproc) GetProcAddress( dllluatex, (is_jit ? "dllluajittexmain": "dllluatexmain" ));
+ if ( dllluatexmain == NULL )
+ if (is_jit)
+ DIE( "unable to locate dllluatexmain procedure in luajittex.dll" )
+ else
+ DIE( "unable to locate dllluatexmain procedure in luatex.dll" );
+
+ // set up argument list for texlua script
+
+ lua_argv = (char **)malloc( (argc + 5) * sizeof(char *) );
+ if ( lua_argv == NULL ) DIE( "out of memory\n" );
+ lua_argv[lua_argc=0] = luatexfname;
+ lua_argv[++lua_argc] = "--luaonly";
+ lua_argv[++lua_argc] = scriptpath; // script to execute
+ if (passprogname) {
+ lua_argv[++lua_argc] = "--script";
+ lua_argv[++lua_argc] = progname;
+ }
+ for ( k = 1; k < argc; k++ ) lua_argv[++lua_argc] = argv[k];
+ lua_argv[++lua_argc] = NULL;
+
+ // call texlua interpreter
+ // dllluatexmain never returns, but we pretend that it does
+
+ k = dllluatexmain( lua_argc, lua_argv );
+ if (lua_argv) free( lua_argv );
+ return k;
+ }
+ // we are still here, so no luatex.dll; spawn texlua.exe instead
+
+ strcpy( luatexfname,binary);
+ strcpy( cmdline, " --luaonly " );
+ strcpy( cmdline, "\"" );
+ strcat( cmdline, luatexpath );
+ strcat( cmdline, "\" \"" );
+ strcat( cmdline, scriptpath );
+ strcat( cmdline, "\"" );
+ if (passprogname) {
+ strcat( cmdline, " --script " );
+ strcat( cmdline, progname );
+ }
+ argstr = GetCommandLine(); // get the command line of this process
+ if ( argstr == NULL ) DIE( "unable to retrieve the command line string\n" );
+
+ // skip over argv[0] in the argument string
+ // (it can contain embedded double quotes if launched from cmd.exe!)
+
+ for ( quoted = 0; (*argstr) && ( !IS_WHITESPACE(*argstr) || quoted ); argstr++ )
+ if (*argstr == '"') quoted = !quoted;
+
+ // pass through all the arguments
+
+ if ( strlen(cmdline) + strlen(argstr) >= MAX_CMD )
+ DIE( "command line string too long:\n%s%s\n", cmdline, argstr );
+ strcat( cmdline, argstr );
+
+ // create child process
+
+ STARTUPINFO si;
+ PROCESS_INFORMATION pi;
+ ZeroMemory( &si, sizeof(si) );
+ si.cb = sizeof(si);
+ si.dwFlags = STARTF_USESTDHANDLES;// | STARTF_USESHOWWINDOW;
+ //si.dwFlags = STARTF_USESHOWWINDOW;
+ //si.wShowWindow = SW_HIDE ; // can be used to hide console window (requires STARTF_USESHOWWINDOW flag)
+ si.hStdInput = GetStdHandle( STD_INPUT_HANDLE );
+ si.hStdOutput = GetStdHandle( STD_OUTPUT_HANDLE );
+ si.hStdError = GetStdHandle( STD_ERROR_HANDLE );
+ ZeroMemory( &pi, sizeof(pi) );
+ if( !CreateProcess(
+ NULL, // module name (uses command line if NULL)
+ cmdline, // command line
+ NULL, // process security atrributes
+ NULL, // thread security atrributes
+ TRUE, // handle inheritance
+ 0, // creation flags, e.g. CREATE_NEW_CONSOLE, CREATE_NO_WINDOW, DETACHED_PROCESS
+ NULL, // pointer to environment block (uses parent if NULL)
+ NULL, // starting directory (uses parent if NULL)
+ &si, // STARTUPINFO structure
+ &pi ) // PROCESS_INFORMATION structure
+ ) DIE( "command execution failed: %s\n", cmdline );
+ DWORD ret = 0;
+ CloseHandle( pi.hThread ); // thread handle is not needed
+ if ( WaitForSingleObject( pi.hProcess, INFINITE ) == WAIT_OBJECT_0 ) {
+ if ( !GetExitCodeProcess( pi.hProcess, &ret) )
+ DIE( "unable to retrieve process exit code: %s\n", cmdline );
+ } else DIE( "failed to wait for process termination: %s\n", cmdline );
+ CloseHandle( pi.hProcess );
+
+ // propagate exit code from the child process
+ return ret;
+
+}
diff --git a/Build/source/texk/texlive/w64_mingw_wrapper/context/mtxrun_exe.c b/Build/source/texk/texlive/windows_wrapper/context/mtxrun_exe.c
index 0c27c272e37..d711f85300e 100644
--- a/Build/source/texk/texlive/w64_mingw_wrapper/context/mtxrun_exe.c
+++ b/Build/source/texk/texlive/windows_wrapper/context/mtxrun_exe.c
@@ -1,8 +1,8 @@
-// This is the .exe part of the mtxrun program, see mtxrun_dll.c
-// for more details.
-
-#include <windows.h>
-
-__declspec(dllimport) int dllrunscript( int argc, char *argv[] );
-
-int main( int argc, char *argv[] ) { return dllrunscript( argc, argv ); }
+// This is the .exe part of the mtxrun program, see mtxrun_dll.c
+// for more details.
+
+#include <windows.h>
+
+__declspec(dllimport) int dllrunscript( int argc, char *argv[] );
+
+int main( int argc, char *argv[] ) { return dllrunscript( argc, argv ); }
diff --git a/Build/source/texk/texlive/w64_mingw_wrapper/context/readme.txt b/Build/source/texk/texlive/windows_wrapper/context/readme.txt
index 72892ee2f11..4eae76a1e20 100644
--- a/Build/source/texk/texlive/w64_mingw_wrapper/context/readme.txt
+++ b/Build/source/texk/texlive/windows_wrapper/context/readme.txt
@@ -1,40 +1,40 @@
-Copyright:
-
-The originally 'runscript' program was written by in 2009 by T.M.Trzeciak and is
-public domain. This derived mtxrun program is an adapted version by Hans Hagen and
-Luigi Scarso.
-
-Comment:
-
-In ConTeXt MkIV we have two core scripts: luatools.lua and mtxrun.lua where the
-second one is used to launch other scripts. The mtxrun.exe program calls luatex.exe.
-
-Normally a user will use a call like:
-
- mtxrun --script font --reload
-
-Here mtxrun is a lua script. In order to avoid the usage of a cmd file on windows this
-runner will start texlua directly. In TeXlive a runner is added for each cmd file but
-we don't want that overhead (and extra files). By using an exe we can call these
-scripts in batch files without the need for using call.
-
-The mtxrun.exe file can be copied to a mtxrunjit.exe file in which case luajittex.exe
-is called.
-
- mtxrunjit --script font --reload
-
-We also don't want to use other runners, like those that use kpse to locate the script
-as this is exactly what mtxrun itself is doing already. Therefore the runscript program
-is adapted to a more direct approach suitable for mtxrun.
-
-Compilation:
-
-with gcc (size optimized):
-
- gcc -Os -s -shared -o mtxrun.dll mtxrun_dll.c
- gcc -Os -s -o mtxrun.exe mtxrun_exe.c -L./ -lmtxrun
-
-with tcc (ver. 0.9.24), extra small size
-
- tcc -shared -o runscript.dll runscript_dll.c
- tcc -o runscript.exe runscript_exe.c runscript.def
+Copyright:
+
+The originally 'runscript' program was written by in 2009 by T.M.Trzeciak and is
+public domain. This derived mtxrun program is an adapted version by Hans Hagen and
+Luigi Scarso.
+
+Comment:
+
+In ConTeXt MkIV we have two core scripts: luatools.lua and mtxrun.lua where the
+second one is used to launch other scripts. The mtxrun.exe program calls luatex.exe.
+
+Normally a user will use a call like:
+
+ mtxrun --script font --reload
+
+Here mtxrun is a lua script. In order to avoid the usage of a cmd file on windows this
+runner will start texlua directly. In TeXlive a runner is added for each cmd file but
+we don't want that overhead (and extra files). By using an exe we can call these
+scripts in batch files without the need for using call.
+
+The mtxrun.exe file can be copied to a mtxrunjit.exe file in which case luajittex.exe
+is called.
+
+ mtxrunjit --script font --reload
+
+We also don't want to use other runners, like those that use kpse to locate the script
+as this is exactly what mtxrun itself is doing already. Therefore the runscript program
+is adapted to a more direct approach suitable for mtxrun.
+
+Compilation:
+
+with gcc (size optimized):
+
+ gcc -Os -s -shared -o mtxrun.dll mtxrun_dll.c
+ gcc -Os -s -o mtxrun.exe mtxrun_exe.c -L./ -lmtxrun
+
+with tcc (ver. 0.9.24), extra small size
+
+ tcc -shared -o runscript.dll runscript_dll.c
+ tcc -o runscript.exe runscript_exe.c runscript.def
diff --git a/Build/source/texk/texlive/w32_wrapper/readme.txt b/Build/source/texk/texlive/windows_wrapper/readme.txt
index 7914b67aa7a..8f4f3d17509 100644
--- a/Build/source/texk/texlive/w32_wrapper/readme.txt
+++ b/Build/source/texk/texlive/windows_wrapper/readme.txt
@@ -1,225 +1,225 @@
-
- Script wrappers in TeX Live on Windows
-
- Rationale
-
- Wrappers enable use of scripts on Windows as regular programs.
- They are also required for some binary programs to set up the
- right environment for them.
-
- Batch scripts can be used for wrapping but they are not as universal
- as binaries (there are some odd cases where they don't work) and
- it is hard to make them robust and secure. Compiled binary wrappers
- don't suffer from these problems but they are harder to write, debug
- and maintain in comparison to scripts. For these reasons a hybrid
- approach is taken that combines a binary stub with a launcher script.
-
- Adding wrappers for user scripts
-
- The script wrapping machinery is not limited to scripts shipped with
- TeX Live. You can also use it for script programs from manually
- installed packages. This should minimize problems when using them
- with TeX Live.
-
- First, make sure that there is an interpreter program available on
- your system for the script you want to use. Interpreters for Perl
- and Lua are bundled with TeX Live, all others have to be installed
- independently. Lua scripts are the most efficient to run, so if you
- consider writing a new script, that would be the recommended choice.
-
- The following script types and their file extensions are currently
- supported and searched in that order:
-
- Lua (.tlu;.texlua;.lua) -- included
- Perl (.pl) -- included
- Ruby (.rb) -- requires installation
- Python (.py) -- requires installation
- Tcl (.tcl) -- requires installation
- Java (.jar) -- requires installation
- VBScript (.vbs) -- part of Windows
- JScript (.js) -- part of Windows
- Batch (.bat;.cmd) -- part of Windows
-
- 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
- documentation or texmf/web2c/texmf.cnf file for a list). You may
- need to update the file search database afterwards with:
-
- mktexlsr [TEXMFDIR]
-
- It is also possible to use scripts that are outside of TEXMF hierarchy
- by adjusting TEXMFSCRIPTS environment or kpathsea variable, see
- kpathsea documentation for more information on setting its variables.
-
- Test if the script can be located with:
-
- kpsewhich --format=texmfscripts <script-name>.<ext>
-
- 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]
-
- If you prefer to call the script program simply by its name, copy
- and rename bin/win32/runscript.exe to <script-name>.exe and put it
- somewhere on the search path.
-
- Wrapper structure
-
- Wrappers consist of small binary stubs and a common texlua script.
- The binary stubs are all the same, just different names (but CLI
- and GUI stubs differ, see below, and GUI stubs are actually all
- different due to different embedded icons).
-
- The job of the binary stub is twofold: (a) call the texlua launcher
- script 'runscript.tlu' from the same directory (or more precisely
- from the directory containing 'runscript.dll') and (b) pass to it
- argv[0] and the unparsed argument string as the last two arguments
- (after adding a sentinel argument, which ends with a new line
- character). Arbitrary C strings can be passed, because the script
- is executed by linking with luatex.dll and calling the lua
- interpreter internally rather than by spawning a new process.
-
- There are two flavours of the binary stub: one for CLI programs
- and another one for GUI programs. The GUI variant does not open
- a console window nor does it block the command prompt if started
- from there. It also uses a dialog box to display an error message
- in addition to outputting to stderr.
-
- The stubs are further split into a common DLL and EXE proxies
- to it. This is for maintenance reasons - updates can be done by
- replacement of a single DLL rather than all binary stubs.
-
- The launcher script knows, which variant has been used to invoke it
- based on the sentinel argument. The lack of this argument means
- that it was invoked in a standard way, i.e., through texlua.exe.
-
- All the hard work of locating a script/program to execute happens
- in the launcher script. The located script/program is always
- executed directly by spawning its interpreter (or binary) in a new
- 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. Execution is done
- using a protected call, so any compile or runtime errors are catched.
-
- Source files
-
- runscript.tlu launcher script for locating and dispatching
- target scripts/programs
- runscript_dll.c common DLL part of the binary stubs; locates and
- calls the launcher script
- runscript_exe.c EXE proxy to the common DLL for CLI mode stubs
- wrunscript_exe.c EXE proxy to the common DLL for GUI mode stubs
-
- Compilation of binaries (requires luatex.dll in the same directory)
-
- with gcc (size optimized):
-
- gcc -Os -s -shared -o runscript.dll runscript_dll.c -L./ -lluatex
- gcc -Os -s -o runscript.exe runscript_exe.c -L./ -lrunscript
- gcc -mwindows -Os -s -o wrunscript.exe wrunscript_exe.c -L./ -lrunscript
-
- with tcc (extra small size):
-
- tiny_impdef luatex.dll
- tcc -shared -o runscript.dll runscript_dll.c luatex.def
- tcc -o runscript.exe runscript_exe.c runscript.def
- tcc -o wrunscript.exe wrunscript_exe.c runscript.def
-
- License
-
- Originally written in 2009 by Tomasz M. Trzeciak, Public Domain.
-
- Prior work:
- 'tl-w32-wrapper.texlua' by Reinhard Kotucha and Norbert Preining.
- 'tl-w32-wrapper.cmd' by Tomasz M. Trzeciak.
-
- Changelog
-
- 2009/12/04
- - initial version
- 2009/12/15
- - minor fixes for path & extension list parsing
- 2010/01/09
- - added support for GUI mode stubs
- 2010/02/28
- - enable GUI mode stubs for dviout, psv and texworks;
- - added generic handling of sys programs
- - added restricted repstopdf to alias_table
- 2010/03/13
- - added 'readme.txt' and changelog
- - added support and docs for calling user added scripts;
- (use path of 'runscript.dll' instead of .exe stub to
- locate 'runscript.tlu' script)
- - limit search for shell_escape_commands to system trees
- - added function for creating directory hierarchy
- - fixed directory creation for dviout & texworks aliases
- - fixed arg[0] of repstopdf & rpdfcrop
- 2010/03/28
- - restructured docs, added --help and --version options
- (available only when invoked under 'runscript' name)
- - use TEXMF_RESTRICTED_SCRIPTS kpse var for searching
- shell_escape_commands
- - changed command validation to handle a list of commands
- - prepend GUI mode command(s) to the command list
- - added support for .tcl scripts
- 2010/03/31
- - fixed fatal bug in extention_map definition for GUI mode
- 2010/04/15
- - encapsulated main chunk in a function to execute with
- pcall for more robustness and better error catching
- - added texdoctk to scripts4tlperl table
- - 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
- 2010/05/30
- - Windows XP or newer required to run TeXworks
- 2010/06/04
- - added support for Perl scripts starting with eval-exec-perl
- construct in place of she-bang (#!)
- 2010/06/25
- - run internal tlperl only with our Perl
- - added fontinst to alias_table
- - added support for all tex4ht commands from mk4ht.pl
- - removed some unsued aliases
- - some code refactoring and cleanup
- 2010/12/28
- - use of external Perl now requires kpathsea variable
- TEXLIVE_WINDOWS_TRY_EXTERNAL_PERL to be explicitly set to 1
- - alias_table replaced with if-elseif-end tests to streamline
- special cases and to avoid hardcoding of texmf* file paths
- - added a2ping to special cases (requires -x switch to Perl)
- - set ASYMPTOTE_GS (for asy) to full path to tlgs
- 2011/01/09
- - removed tex4ht commands starting with ht from mk4ht aliases;
- they have their own scripts and mk4ht calls them internally,
- so aliasing results in an infinite recursion
- - removed alias for fontinst (no fontinst.exe any more)
- - fixed GUI-mode interpreter for Ruby
- 2011/09/10
- - added -dDisableFAPI=true to psview argument list. Needed by
- gs-9.xx
- 2012/03/12
- - added '-i', '.' to psview argument list (author's request)
- - added environment clean up from Perl specific variables
- (when not using external Perl)
- 2012/08/05
- - added alias for fmtutil
- 2013/05/09
- - added alias mkluatexfontdb -> luaotfload-tool
- 2013/07/03
- - fix for psview and UNC paths in unix-style
- - remove not needed is_abs_path function
-
+
+ Script wrappers in TeX Live on Windows
+
+ Rationale
+
+ Wrappers enable use of scripts on Windows as regular programs.
+ They are also required for some binary programs to set up the
+ right environment for them.
+
+ Batch scripts can be used for wrapping but they are not as universal
+ as binaries (there are some odd cases where they don't work) and
+ it is hard to make them robust and secure. Compiled binary wrappers
+ don't suffer from these problems but they are harder to write, debug
+ and maintain in comparison to scripts. For these reasons a hybrid
+ approach is taken that combines a binary stub with a launcher script.
+
+ Adding wrappers for user scripts
+
+ The script wrapping machinery is not limited to scripts shipped with
+ TeX Live. You can also use it for script programs from manually
+ installed packages. This should minimize problems when using them
+ with TeX Live.
+
+ First, make sure that there is an interpreter program available on
+ your system for the script you want to use. Interpreters for Perl
+ and Lua are bundled with TeX Live, all others have to be installed
+ independently. Lua scripts are the most efficient to run, so if you
+ consider writing a new script, that would be the recommended choice.
+
+ The following script types and their file extensions are currently
+ supported and searched in that order:
+
+ Lua (.tlu;.texlua;.lua) -- included
+ Perl (.pl) -- included
+ Ruby (.rb) -- requires installation
+ Python (.py) -- requires installation
+ Tcl (.tcl) -- requires installation
+ Java (.jar) -- requires installation
+ VBScript (.vbs) -- part of Windows
+ JScript (.js) -- part of Windows
+ Batch (.bat;.cmd) -- part of Windows
+
+ 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
+ documentation or texmf/web2c/texmf.cnf file for a list). You may
+ need to update the file search database afterwards with:
+
+ mktexlsr [TEXMFDIR]
+
+ It is also possible to use scripts that are outside of TEXMF hierarchy
+ by adjusting TEXMFSCRIPTS environment or kpathsea variable, see
+ kpathsea documentation for more information on setting its variables.
+
+ Test if the script can be located with:
+
+ kpsewhich --format=texmfscripts <script-name>.<ext>
+
+ 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]
+
+ If you prefer to call the script program simply by its name, copy
+ and rename bin/win32/runscript.exe to <script-name>.exe and put it
+ somewhere on the search path.
+
+ Wrapper structure
+
+ Wrappers consist of small binary stubs and a common texlua script.
+ The binary stubs are all the same, just different names (but CLI
+ and GUI stubs differ, see below, and GUI stubs are actually all
+ different due to different embedded icons).
+
+ The job of the binary stub is twofold: (a) call the texlua launcher
+ script 'runscript.tlu' from the same directory (or more precisely
+ from the directory containing 'runscript.dll') and (b) pass to it
+ argv[0] and the unparsed argument string as the last two arguments
+ (after adding a sentinel argument, which ends with a new line
+ character). Arbitrary C strings can be passed, because the script
+ is executed by linking with luatex.dll and calling the lua
+ interpreter internally rather than by spawning a new process.
+
+ There are two flavours of the binary stub: one for CLI programs
+ and another one for GUI programs. The GUI variant does not open
+ a console window nor does it block the command prompt if started
+ from there. It also uses a dialog box to display an error message
+ in addition to outputting to stderr.
+
+ The stubs are further split into a common DLL and EXE proxies
+ to it. This is for maintenance reasons - updates can be done by
+ replacement of a single DLL rather than all binary stubs.
+
+ The launcher script knows, which variant has been used to invoke it
+ based on the sentinel argument. The lack of this argument means
+ that it was invoked in a standard way, i.e., through texlua.exe.
+
+ All the hard work of locating a script/program to execute happens
+ in the launcher script. The located script/program is always
+ executed directly by spawning its interpreter (or binary) in a new
+ 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. Execution is done
+ using a protected call, so any compile or runtime errors are catched.
+
+ Source files
+
+ runscript.tlu launcher script for locating and dispatching
+ target scripts/programs
+ runscript_dll.c common DLL part of the binary stubs; locates and
+ calls the launcher script
+ runscript_exe.c EXE proxy to the common DLL for CLI mode stubs
+ wrunscript_exe.c EXE proxy to the common DLL for GUI mode stubs
+
+ Compilation of binaries (requires luatex.dll in the same directory)
+
+ with gcc (size optimized):
+
+ gcc -Os -s -shared -o runscript.dll runscript_dll.c -L./ -lluatex
+ gcc -Os -s -o runscript.exe runscript_exe.c -L./ -lrunscript
+ gcc -mwindows -Os -s -o wrunscript.exe wrunscript_exe.c -L./ -lrunscript
+
+ with tcc (extra small size):
+
+ tiny_impdef luatex.dll
+ tcc -shared -o runscript.dll runscript_dll.c luatex.def
+ tcc -o runscript.exe runscript_exe.c runscript.def
+ tcc -o wrunscript.exe wrunscript_exe.c runscript.def
+
+ License
+
+ Originally written in 2009 by Tomasz M. Trzeciak, Public Domain.
+
+ Prior work:
+ 'tl-w32-wrapper.texlua' by Reinhard Kotucha and Norbert Preining.
+ 'tl-w32-wrapper.cmd' by Tomasz M. Trzeciak.
+
+ Changelog
+
+ 2009/12/04
+ - initial version
+ 2009/12/15
+ - minor fixes for path & extension list parsing
+ 2010/01/09
+ - added support for GUI mode stubs
+ 2010/02/28
+ - enable GUI mode stubs for dviout, psv and texworks;
+ - added generic handling of sys programs
+ - added restricted repstopdf to alias_table
+ 2010/03/13
+ - added 'readme.txt' and changelog
+ - added support and docs for calling user added scripts;
+ (use path of 'runscript.dll' instead of .exe stub to
+ locate 'runscript.tlu' script)
+ - limit search for shell_escape_commands to system trees
+ - added function for creating directory hierarchy
+ - fixed directory creation for dviout & texworks aliases
+ - fixed arg[0] of repstopdf & rpdfcrop
+ 2010/03/28
+ - restructured docs, added --help and --version options
+ (available only when invoked under 'runscript' name)
+ - use TEXMF_RESTRICTED_SCRIPTS kpse var for searching
+ shell_escape_commands
+ - changed command validation to handle a list of commands
+ - prepend GUI mode command(s) to the command list
+ - added support for .tcl scripts
+ 2010/03/31
+ - fixed fatal bug in extention_map definition for GUI mode
+ 2010/04/15
+ - encapsulated main chunk in a function to execute with
+ pcall for more robustness and better error catching
+ - added texdoctk to scripts4tlperl table
+ - 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
+ 2010/05/30
+ - Windows XP or newer required to run TeXworks
+ 2010/06/04
+ - added support for Perl scripts starting with eval-exec-perl
+ construct in place of she-bang (#!)
+ 2010/06/25
+ - run internal tlperl only with our Perl
+ - added fontinst to alias_table
+ - added support for all tex4ht commands from mk4ht.pl
+ - removed some unsued aliases
+ - some code refactoring and cleanup
+ 2010/12/28
+ - use of external Perl now requires kpathsea variable
+ TEXLIVE_WINDOWS_TRY_EXTERNAL_PERL to be explicitly set to 1
+ - alias_table replaced with if-elseif-end tests to streamline
+ special cases and to avoid hardcoding of texmf* file paths
+ - added a2ping to special cases (requires -x switch to Perl)
+ - set ASYMPTOTE_GS (for asy) to full path to tlgs
+ 2011/01/09
+ - removed tex4ht commands starting with ht from mk4ht aliases;
+ they have their own scripts and mk4ht calls them internally,
+ so aliasing results in an infinite recursion
+ - removed alias for fontinst (no fontinst.exe any more)
+ - fixed GUI-mode interpreter for Ruby
+ 2011/09/10
+ - added -dDisableFAPI=true to psview argument list. Needed by
+ gs-9.xx
+ 2012/03/12
+ - added '-i', '.' to psview argument list (author's request)
+ - added environment clean up from Perl specific variables
+ (when not using external Perl)
+ 2012/08/05
+ - added alias for fmtutil
+ 2013/05/09
+ - added alias mkluatexfontdb -> luaotfload-tool
+ 2013/07/03
+ - fix for psview and UNC paths in unix-style
+ - remove not needed is_abs_path function
+
diff --git a/Build/source/texk/texlive/w32_wrapper/runscript.tlu b/Build/source/texk/texlive/windows_wrapper/runscript.tlu
index e57778e1045..e57778e1045 100755..100644
--- a/Build/source/texk/texlive/w32_wrapper/runscript.tlu
+++ b/Build/source/texk/texlive/windows_wrapper/runscript.tlu
diff --git a/Build/source/texk/texlive/w32_wrapper/runscript_dll.c b/Build/source/texk/texlive/windows_wrapper/runscript_dll.c
index 617a00f7319..c9f540f4a36 100644
--- a/Build/source/texk/texlive/w32_wrapper/runscript_dll.c
+++ b/Build/source/texk/texlive/windows_wrapper/runscript_dll.c
@@ -1,121 +1,121 @@
-/************************************************************************
-
- This file is a part of the wrapper program for launching scripts
- and programs in TeX Live on Windows. See readme.txt for more details.
-
- This file was originally written in 2009 by Tomasz M. Trzeciak and
- was placed in the Public Domain.
-
-************************************************************************/
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <windows.h>
-#define IS_WHITESPACE(c) ((c == ' ') || (c == '\t'))
-#define MAX_MSG 2*MAX_PATH
-#define DIE(...) { _snprintf( msg_buf, MAX_MSG - 1, __VA_ARGS__ ); goto DIE; }
-
-char module_name[] = "runscript.dll";
-char script_name[] = "runscript.tlu";
-char texlua_name[] = "texlua"; // just a bare name, luatex strips the rest anyway
-char subsys_mode[] = "CUI_MODE\n";
-char err_env_var[] = "RUNSCRIPT_ERROR_MESSAGE";
-char msg_buf[MAX_MSG];
-
-__declspec(dllimport) int dllluatexmain( int argc, char *argv[] );
-
-__declspec(dllexport) int dllrunscript( int argc, char *argv[] )
-{
- static char own_path[MAX_PATH];
- static char fpath[MAX_PATH];
- char *fname, *argline, **lua_argv;
- int k, quoted, lua_argc;
- HMODULE module_handle = NULL;
-
- // file path of the executable
- k = (int) GetModuleFileName(NULL, own_path, MAX_PATH);
- if ( !k || (k == MAX_PATH) )
- DIE("cannot get own path (may be too long): %s\n", own_path);
-
- // script path (the dir of this library)
- module_handle = GetModuleHandle(module_name);
- // if ( module_handle == NULL ) exe path will be used, which is OK too
- k = (int) GetModuleFileName(module_handle, fpath, MAX_PATH);
- if ( !k || (k == MAX_PATH) )
- DIE("cannot get module path (may be too long): %s\n", fpath);
- fname = strrchr(fpath, '\\');
- if ( fname == NULL ) DIE("no directory part in module path: %s\n", fpath);
- fname++;
- if ( fname + strlen(script_name) >= fpath + MAX_PATH - 1 )
- DIE("path too long: %s\n", fpath);
- strcpy(fname, script_name);
- if ( GetFileAttributes(fpath) == INVALID_FILE_ATTRIBUTES )
- DIE("main lua script not found: %s\n", fpath);
-
- // get command line of this process
- argline = GetCommandLine();
- if ( argline == NULL ) DIE("failed to retrieve command line string\n");
- // skip over argv[0] (it can contain embedded double quotes if launched from cmd.exe!)
- for ( quoted = 0; (*argline) && ( !IS_WHITESPACE(*argline) || quoted ); argline++ )
- if ( *argline == '"' ) quoted = !quoted;
- while ( IS_WHITESPACE(*argline) ) argline++; // remove leading whitespace if any
-
- // set up argument list for texlua script
- lua_argv = (char **)malloc( (argc + 6) * sizeof(char *) );
- lua_argv[lua_argc=0] = texlua_name;
- lua_argv[++lua_argc] = fpath; // script to execute
- for ( k = 1; k < argc; k++ ) lua_argv[++lua_argc] = argv[k]; // copy argument list
- lua_argv[++lua_argc] = subsys_mode; // sentinel argument
- lua_argv[++lua_argc] = argc ? argv[0] : own_path; // original argv[0]
- lua_argv[++lua_argc] = argline; // unparsed arguments
- lua_argv[++lua_argc] = NULL;
-
- // call texlua interpreter
- // dllluatexmain never returns, but we pretend that it does
- k = dllluatexmain( lua_argc, lua_argv );
- if (lua_argv) free(lua_argv);
- return k;
-
-DIE:
- fprintf(stderr, "%s: ", module_name);
- fprintf(stderr, msg_buf);
- if (*subsys_mode == 'G')
- MessageBox( NULL, msg_buf, module_name, MB_ICONERROR | MB_SETFOREGROUND );
- return 1;
-}
-
-void finalize( void )
-{
- // check for and display error message if any
- char *err_msg;
- if ( err_msg = (char *) getenv(err_env_var) )
- MessageBox( NULL, err_msg, script_name, MB_ICONERROR | MB_SETFOREGROUND );
-}
-
-__declspec(dllexport) int dllwrunscript(
- HINSTANCE hInstance,
- HINSTANCE hPrevInstance,
- char *argline,
- int winshow
-) {
- // set sentinel argument (G for GUI_MODE)
- *subsys_mode = 'G';
- // clear error var in case it exists already
- SetEnvironmentVariable(err_env_var, NULL);
- // register atexit handler to recover control before terminating
- atexit( finalize );
- // call the console entry point routine
-#ifdef __MSVCRT__
- // WinMain doesn't provide argc & argv, call MSVCRT proc to get them
- int argc = 0;
- char **argv, **env;
- int expand_wildcards = 0;
- int new_mode;
- __getmainargs(&argc, &argv, &env, expand_wildcards, &new_mode);
- return dllrunscript( argc, argv );
-#else
- return dllrunscript( 0, NULL );
-#endif
-}
-
-
+/************************************************************************
+
+ This file is a part of the wrapper program for launching scripts
+ and programs in TeX Live on Windows. See readme.txt for more details.
+
+ This file was originally written in 2009 by Tomasz M. Trzeciak and
+ was placed in the Public Domain.
+
+************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <windows.h>
+#define IS_WHITESPACE(c) ((c == ' ') || (c == '\t'))
+#define MAX_MSG 2*MAX_PATH
+#define DIE(...) { _snprintf( msg_buf, MAX_MSG - 1, __VA_ARGS__ ); goto DIE; }
+
+char module_name[] = "runscript.dll";
+char script_name[] = "runscript.tlu";
+char texlua_name[] = "texlua"; // just a bare name, luatex strips the rest anyway
+char subsys_mode[] = "CUI_MODE\n";
+char err_env_var[] = "RUNSCRIPT_ERROR_MESSAGE";
+char msg_buf[MAX_MSG];
+
+__declspec(dllimport) int dllluatexmain( int argc, char *argv[] );
+
+__declspec(dllexport) int dllrunscript( int argc, char *argv[] )
+{
+ static char own_path[MAX_PATH];
+ static char fpath[MAX_PATH];
+ char *fname, *argline, **lua_argv;
+ int k, quoted, lua_argc;
+ HMODULE module_handle = NULL;
+
+ // file path of the executable
+ k = (int) GetModuleFileName(NULL, own_path, MAX_PATH);
+ if ( !k || (k == MAX_PATH) )
+ DIE("cannot get own path (may be too long): %s\n", own_path);
+
+ // script path (the dir of this library)
+ module_handle = GetModuleHandle(module_name);
+ // if ( module_handle == NULL ) exe path will be used, which is OK too
+ k = (int) GetModuleFileName(module_handle, fpath, MAX_PATH);
+ if ( !k || (k == MAX_PATH) )
+ DIE("cannot get module path (may be too long): %s\n", fpath);
+ fname = strrchr(fpath, '\\');
+ if ( fname == NULL ) DIE("no directory part in module path: %s\n", fpath);
+ fname++;
+ if ( fname + strlen(script_name) >= fpath + MAX_PATH - 1 )
+ DIE("path too long: %s\n", fpath);
+ strcpy(fname, script_name);
+ if ( GetFileAttributes(fpath) == INVALID_FILE_ATTRIBUTES )
+ DIE("main lua script not found: %s\n", fpath);
+
+ // get command line of this process
+ argline = GetCommandLine();
+ if ( argline == NULL ) DIE("failed to retrieve command line string\n");
+ // skip over argv[0] (it can contain embedded double quotes if launched from cmd.exe!)
+ for ( quoted = 0; (*argline) && ( !IS_WHITESPACE(*argline) || quoted ); argline++ )
+ if ( *argline == '"' ) quoted = !quoted;
+ while ( IS_WHITESPACE(*argline) ) argline++; // remove leading whitespace if any
+
+ // set up argument list for texlua script
+ lua_argv = (char **)malloc( (argc + 6) * sizeof(char *) );
+ lua_argv[lua_argc=0] = texlua_name;
+ lua_argv[++lua_argc] = fpath; // script to execute
+ for ( k = 1; k < argc; k++ ) lua_argv[++lua_argc] = argv[k]; // copy argument list
+ lua_argv[++lua_argc] = subsys_mode; // sentinel argument
+ lua_argv[++lua_argc] = argc ? argv[0] : own_path; // original argv[0]
+ lua_argv[++lua_argc] = argline; // unparsed arguments
+ lua_argv[++lua_argc] = NULL;
+
+ // call texlua interpreter
+ // dllluatexmain never returns, but we pretend that it does
+ k = dllluatexmain( lua_argc, lua_argv );
+ if (lua_argv) free(lua_argv);
+ return k;
+
+DIE:
+ fprintf(stderr, "%s: ", module_name);
+ fprintf(stderr, msg_buf);
+ if (*subsys_mode == 'G')
+ MessageBox( NULL, msg_buf, module_name, MB_ICONERROR | MB_SETFOREGROUND );
+ return 1;
+}
+
+void finalize( void )
+{
+ // check for and display error message if any
+ char *err_msg;
+ if ( err_msg = (char *) getenv(err_env_var) )
+ MessageBox( NULL, err_msg, script_name, MB_ICONERROR | MB_SETFOREGROUND );
+}
+
+__declspec(dllexport) int dllwrunscript(
+ HINSTANCE hInstance,
+ HINSTANCE hPrevInstance,
+ char *argline,
+ int winshow
+) {
+ // set sentinel argument (G for GUI_MODE)
+ *subsys_mode = 'G';
+ // clear error var in case it exists already
+ SetEnvironmentVariable(err_env_var, NULL);
+ // register atexit handler to recover control before terminating
+ atexit( finalize );
+ // call the console entry point routine
+#ifdef __MSVCRT__
+ // WinMain doesn't provide argc & argv, call MSVCRT proc to get them
+ int argc = 0;
+ char **argv, **env;
+ int expand_wildcards = 0;
+ int new_mode;
+ __getmainargs(&argc, &argv, &env, expand_wildcards, &new_mode);
+ return dllrunscript( argc, argv );
+#else
+ return dllrunscript( 0, NULL );
+#endif
+}
+
+
diff --git a/Build/source/texk/texlive/w64_mingw_wrapper/runscript_exe.c b/Build/source/texk/texlive/windows_wrapper/runscript_exe.c
index 29d04a93a43..c97989c9a6b 100644
--- a/Build/source/texk/texlive/w64_mingw_wrapper/runscript_exe.c
+++ b/Build/source/texk/texlive/windows_wrapper/runscript_exe.c
@@ -1,15 +1,15 @@
-/************************************************************************
-
- This file is a part of the wrapper program for launching scripts
- and programs in TeX Live on Windows. See readme.txt for more details.
-
- This file was originally written in 2009 by Tomasz M. Trzeciak and
- was placed in the Public Domain.
-
-************************************************************************/
-
-#include <windows.h>
-
-__declspec(dllimport) int dllrunscript( int argc, char *argv[] );
-
-int main( int argc, char *argv[] ) { return dllrunscript( argc, argv ); }
+/************************************************************************
+
+ This file is a part of the wrapper program for launching scripts
+ and programs in TeX Live on Windows. See readme.txt for more details.
+
+ This file was originally written in 2009 by Tomasz M. Trzeciak and
+ was placed in the Public Domain.
+
+************************************************************************/
+
+#include <windows.h>
+
+__declspec(dllimport) int dllrunscript( int argc, char *argv[] );
+
+int main( int argc, char *argv[] ) { return dllrunscript( argc, argv ); }
diff --git a/Build/source/texk/texlive/w32_wrapper/tl-tray-menu.c b/Build/source/texk/texlive/windows_wrapper/tl-tray-menu.c
index e223d39bbf3..7d8676a876e 100644
--- a/Build/source/texk/texlive/w32_wrapper/tl-tray-menu.c
+++ b/Build/source/texk/texlive/windows_wrapper/tl-tray-menu.c
@@ -1,348 +1,348 @@
-/*
-
-Simple tray menu
-
-Originally written in 2011 by Tomasz M. Trzeciak, Public Domain
-
-2019 updates, by Siep Kroonenberg:
-- added option to open data files with default application
-- updated menu content
-
-compiling with gcc (size optimized):
-echo 1 ICON "tl-tray-menu.ico">tl-tray-menu.rc
-windres tl-tray-menu.rc tl-tray-menu-rc.o
-gcc -Os -s -mwindows -o tl-tray-menu.exe tl-tray-menu-rc.o tl-tray-menu.c
-
-*/
-
-#define _WIN32_IE 0X0500 // minimum support for tray baloon (IE5)
-
-#include <windows.h>
-#include <shellapi.h>
-#include <process.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-#define MAX_STR 32768
-
-static char strBuf[MAX_STR];
-
-#define DIE(...) { \
- _snprintf( strBuf, 4*MAX_PATH, __VA_ARGS__ ); \
- MessageBox( NULL, strBuf, "ERROR!", MB_ICONERROR | MB_SETFOREGROUND );\
- return 1; \
-}
-
-#define IDI_ICON 1 // resource number of icon
-#define IDI_TRAY 100
-#define WM_TRAYMSG 101
-
-#define MAX_MENU_ENTRIES 31
-#define MENU_CONFIG ( MAX_MENU_ENTRIES + 1 )
-#define MENU_EXIT ( MAX_MENU_ENTRIES + 2 )
-
-// buffer holding menu labels and commands
-// (used only with config file)
-static char menuStrings[MAX_STR];
-
-// default menu labels
-char *menuLabels[MAX_MENU_ENTRIES] = {
-"&Package Manager",
-"&Documentation",
-"&Editor",
-"&Command Prompt",
-NULL };
-
-// default menu commands
-char *menuCommands[MAX_MENU_ENTRIES] = {
-"bin\\win32\\tlshell.exe",
-"doc.html",
-"bin\\win32\\texworks.exe",
-"tlpkg\\installer\\tl-cmd.bat",
-NULL };
-
-char configInfo[4*MAX_PATH] = "\
-The menu can be customized with a configuration file.\n\
-For an example and instructions see:\n";
-
-HMENU hPopMenu;
-NOTIFYICONDATA nid;
-
-// has s executable extension according to PATHEXT?
-int is_exe ( char * s ) {
- int i, j, extl;
- char * pathext, * ext, * t, * t1;
- if ( !s || !(*s)) DIE( "is_exe invoked with NULL or empty string" );
- pathext = getenv( "PATHEXT" );
- if (!pathext) return 1;
- ext = strrchr( s, '.' );
- if (!ext) return 1;
- extl = strlen( ext );
- t = s;
- while ( 1 ) {
- t1 = strchr( t, ';' );
- if ( !t1 ) t1 = s + strlen( s );
- if ( t1 - t == extl && !_strnicmp( ext, t, extl )) {
- return 1;
- } else if ( *t1 ) {
- t = ++t1;
- } else {
- return 0;
- }
- }
- return 0;
-}
-
-LRESULT CALLBACK WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
-{
- switch ( msg )
- {
- case WM_CREATE:
- {
- hPopMenu = CreatePopupMenu();
- int i;
- for ( i = 0; menuLabels[i]; i++ )
- {
- if ( menuCommands[i] )
- AppendMenu( hPopMenu, MF_STRING, i, menuLabels[i] );
- }
- AppendMenu( hPopMenu, MF_SEPARATOR, 0, NULL );
- AppendMenu( hPopMenu, MF_STRING, MENU_CONFIG, "More..." );
- AppendMenu( hPopMenu, MF_STRING, MENU_EXIT, "E&xit" );
- }
- break;
-
- case WM_TRAYMSG:
- {
- switch ( lParam )
- {
- case WM_LBUTTONUP:
- case WM_RBUTTONUP:
- {
- POINT pnt;
- GetCursorPos( &pnt );
- SetForegroundWindow( hWnd ); // needed to get keyboard focus
- TrackPopupMenu( hPopMenu, TPM_LEFTALIGN, pnt.x, pnt.y, 0, hWnd, NULL );
- }
- break;
- }
- }
- break;
-
- case WM_COMMAND:
- {
- switch ( LOWORD( wParam ) )
- {
- case MENU_CONFIG:
- MessageBox( NULL, configInfo, nid.szTip, MB_SETFOREGROUND );
- break;
-
- case MENU_EXIT:
- Shell_NotifyIcon( NIM_DELETE, &nid );
- ExitProcess(0);
- break;
-
- default:
- {
- if (is_exe( menuCommands[LOWORD(wParam )])) {
- STARTUPINFO si;
- PROCESS_INFORMATION pi;
- ZeroMemory( &si, sizeof(si) );
- si.cb = sizeof(si);
- //si.dwFlags = STARTF_USESHOWWINDOW;
- //si.wShowWindow = SW_HIDE ;
- ZeroMemory( &pi, sizeof(pi) );
- if( !CreateProcess(
- NULL, // module name (uses command line if NULL)
- menuCommands[LOWORD(wParam)], // command line
- NULL, // process security atrributes
- NULL, // thread security atrributes
- TRUE, // handle inheritance
- 0, // creation flags, e.g. CREATE_NO_WINDOW,
- // DETACHED_PROCESS
- NULL, // pointer to environment block (uses parent if NULL)
- NULL, // starting directory (uses parent if NULL)
- &si, // STARTUPINFO structure
- &pi ) // PROCESS_INFORMATION structure
- ) DIE( "Failed to spawn command (error code %d):\n%s",
- GetLastError(), menuCommands[LOWORD(wParam)] );
- } else {
- // data file; try to open with default application
- ShellExecute( NULL, NULL, menuCommands[LOWORD(wParam)],
- NULL, NULL, SW_SHOWNORMAL );
- }
- }
- }
- }
- break;
-
- default:
- return DefWindowProc( hWnd, msg, wParam, lParam );
-
- }
-
- return 0;
-}
-
-int APIENTRY WinMain(
- HINSTANCE hInstance,
- HINSTANCE hPrevInstance,
- LPSTR lpCmdLine,
- int nCmdShow )
-{
-
- // scratch variables
-
- char *s;
-
- // get file name of this executable
-
- static char dirSelf[MAX_PATH];
- DWORD nchars = GetModuleFileName(NULL, dirSelf, MAX_PATH);
- if ( !nchars || ( nchars == MAX_PATH ) ) DIE( "Cannot get own path." );
- if ( s = strrchr( dirSelf, '\\' ) ) *s = '\0'; // remove file name part
-
- // set current directory
-
- if ( !SetCurrentDirectory( dirSelf ) )
- DIE( "Failed to change current directory to:\n%s", dirSelf );
-
- // prepend bin/win32 to PATH
-
- strcpy( strBuf, dirSelf );
- if ( strlen( dirSelf ) + strlen( "\\bin\\win32;" )
- + strlen( getenv( "PATH" )) >= MAX_STR )
- DIE( "Path getting too long" );
- strcat( strBuf, "\\bin\\win32;" );
- strcat( strBuf, getenv( "PATH" ) );
- SetEnvironmentVariable( "PATH", strBuf );
-
- // configuration
-
- static char fileConfig[MAX_PATH];
- s = dirSelf + strlen(dirSelf) + 1;
- strcpy( fileConfig, s );
- if ( s = strrchr( fileConfig, '.' ) ) *s = '\0'; // remove file extension part
- strcat( fileConfig, ".ini" );
-
- strcat( configInfo, dirSelf );
- strcat( configInfo, "\\tlpkg\\installer\\" );
- strcat( configInfo, fileConfig );
-
- if ( GetFileAttributes( fileConfig ) == INVALID_FILE_ATTRIBUTES ) {
-
- // validate default configuration (menuCommands should be existing files)
-
- int i;
- for ( i = 0; menuLabels[i]; i++ )
- if ( GetFileAttributes( menuCommands[i] ) == INVALID_FILE_ATTRIBUTES )
- menuCommands[i] = NULL;
-
- } else {
-
- // read menu configuration from ini file
-
- FILE *CONFIG = fopen( fileConfig, "rt" );
- if ( CONFIG == NULL )
- DIE( "Failed to open configuration file:\n%s\\%s", dirSelf, fileConfig );
-
- char strSect[] = "[menu]";
- int menuItem = -1;
- int i = 0;
- int lineNo;
- for ( lineNo = 1 ; fgets( strBuf, MAX_STR, CONFIG )
- && menuItem < MAX_MENU_ENTRIES ; lineNo++ )
- {
- if ( menuItem < 0 )
- {
- if ( *strBuf == '[' &&
- strncmp( strBuf, strSect, strlen( strSect ) ) == 0 ) menuItem++;
- continue;
- }
- if ( *strBuf == ';' ) continue; // skip comments
- if ( *strBuf == '[' ) break; // next section
- s = &menuStrings[i];
- i += ExpandEnvironmentStrings( strBuf, s, MAX_STR - i );
- if ( i >= MAX_STR )
- DIE( "Exceeded 32KB limit for configuration." );
- if ( i-2 && menuStrings[i-2] == '\n' ) { menuStrings[i-2] = '\0'; i--; }
- menuLabels[menuItem] = s;
- while ( *s && *s != '=' ) s++;
- if ( *s == '\0' )
- DIE( "Missing '=' on line %d in configuration file:\n%s\\%s",
- lineNo, dirSelf, fileConfig );
- *s++ = '\0'; // assign first, then increment
- menuCommands[menuItem] = s;
- menuItem++;
- }
- if ( menuItem < 0 )
- DIE( "Missing [menu] section in configuration file:\n%s\\%s",
- dirSelf, fileConfig );
- menuLabels[menuItem] = NULL;
- menuCommands[menuItem] = NULL;
-
- fclose( CONFIG );
-
- }
-
- // create a hidden window for messaging
-
- MSG msg;
- WNDCLASS wc;
- HWND hWnd;
- char szAppName[] = "TrayMenu";
-
- ZeroMemory( &wc, sizeof wc );
- wc.hInstance = hInstance;
- wc.lpszClassName = szAppName;
- wc.lpfnWndProc = (WNDPROC)WndProc;
- wc.style = 0;
- wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
- wc.hIcon = LoadIcon( NULL, IDI_APPLICATION );
- wc.hCursor = LoadCursor( NULL, IDC_ARROW );
-
- if ( FALSE == RegisterClass( &wc ) ) DIE( "Failed to register window class" );
-
- hWnd = CreateWindow(
- szAppName,
- "",
- 0,
- CW_USEDEFAULT,
- CW_USEDEFAULT,
- CW_USEDEFAULT,
- CW_USEDEFAULT,
- 0,
- 0,
- hInstance,
- 0);
-
- if ( hWnd == NULL ) DIE( "Failed to create window" );
-
- // tray icon stuff
-
- nid.cbSize = sizeof nid;
- nid.hWnd = hWnd;
- nid.uID = IDI_TRAY;
- nid.uFlags = NIF_ICON|NIF_MESSAGE|NIF_TIP;
- nid.hIcon = LoadIcon( hInstance, MAKEINTRESOURCE( IDI_ICON ) );
- nid.uCallbackMessage = WM_TRAYMSG;
- strcpy( nid.szTip, "TeX Live Menu" );
-#if (_WIN32_IE >= 0X0500)
- nid.uFlags |= NIF_INFO;
- nid.dwInfoFlags = NIIF_INFO;
- strcpy( nid.szInfo, "Click on the tray icon\nto activate the menu." );
- strcpy( nid.szInfoTitle, nid.szTip );
-#endif
- Shell_NotifyIcon( NIM_ADD, &nid );
-
- // main message loop:
-
- while ( GetMessage( &msg, NULL, 0, 0 ) > 0 )
- {
- TranslateMessage( &msg );
- DispatchMessage( &msg );
- }
-
- return msg.wParam;
-}
-
+/*
+
+Simple tray menu
+
+Originally written in 2011 by Tomasz M. Trzeciak, Public Domain
+
+2019 updates, by Siep Kroonenberg:
+- added option to open data files with default application
+- updated menu content
+
+compiling with gcc (size optimized):
+echo 1 ICON "tl-tray-menu.ico">tl-tray-menu.rc
+windres tl-tray-menu.rc tl-tray-menu-rc.o
+gcc -Os -s -mwindows -o tl-tray-menu.exe tl-tray-menu-rc.o tl-tray-menu.c
+
+*/
+
+#define _WIN32_IE 0X0500 // minimum support for tray baloon (IE5)
+
+#include <windows.h>
+#include <shellapi.h>
+#include <process.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+#define MAX_STR 32768
+
+static char strBuf[MAX_STR];
+
+#define DIE(...) { \
+ _snprintf( strBuf, 4*MAX_PATH, __VA_ARGS__ ); \
+ MessageBox( NULL, strBuf, "ERROR!", MB_ICONERROR | MB_SETFOREGROUND );\
+ return 1; \
+}
+
+#define IDI_ICON 1 // resource number of icon
+#define IDI_TRAY 100
+#define WM_TRAYMSG 101
+
+#define MAX_MENU_ENTRIES 31
+#define MENU_CONFIG ( MAX_MENU_ENTRIES + 1 )
+#define MENU_EXIT ( MAX_MENU_ENTRIES + 2 )
+
+// buffer holding menu labels and commands
+// (used only with config file)
+static char menuStrings[MAX_STR];
+
+// default menu labels
+char *menuLabels[MAX_MENU_ENTRIES] = {
+"&Package Manager",
+"&Documentation",
+"&Editor",
+"&Command Prompt",
+NULL };
+
+// default menu commands
+char *menuCommands[MAX_MENU_ENTRIES] = {
+"bin\\win32\\tlshell.exe",
+"doc.html",
+"bin\\win32\\texworks.exe",
+"tlpkg\\installer\\tl-cmd.bat",
+NULL };
+
+char configInfo[4*MAX_PATH] = "\
+The menu can be customized with a configuration file.\n\
+For an example and instructions see:\n";
+
+HMENU hPopMenu;
+NOTIFYICONDATA nid;
+
+// has s executable extension according to PATHEXT?
+int is_exe ( char * s ) {
+ int i, j, extl;
+ char * pathext, * ext, * t, * t1;
+ if ( !s || !(*s)) DIE( "is_exe invoked with NULL or empty string" );
+ pathext = getenv( "PATHEXT" );
+ if (!pathext) return 1;
+ ext = strrchr( s, '.' );
+ if (!ext) return 1;
+ extl = strlen( ext );
+ t = s;
+ while ( 1 ) {
+ t1 = strchr( t, ';' );
+ if ( !t1 ) t1 = s + strlen( s );
+ if ( t1 - t == extl && !_strnicmp( ext, t, extl )) {
+ return 1;
+ } else if ( *t1 ) {
+ t = ++t1;
+ } else {
+ return 0;
+ }
+ }
+ return 0;
+}
+
+LRESULT CALLBACK WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam )
+{
+ switch ( msg )
+ {
+ case WM_CREATE:
+ {
+ hPopMenu = CreatePopupMenu();
+ int i;
+ for ( i = 0; menuLabels[i]; i++ )
+ {
+ if ( menuCommands[i] )
+ AppendMenu( hPopMenu, MF_STRING, i, menuLabels[i] );
+ }
+ AppendMenu( hPopMenu, MF_SEPARATOR, 0, NULL );
+ AppendMenu( hPopMenu, MF_STRING, MENU_CONFIG, "More..." );
+ AppendMenu( hPopMenu, MF_STRING, MENU_EXIT, "E&xit" );
+ }
+ break;
+
+ case WM_TRAYMSG:
+ {
+ switch ( lParam )
+ {
+ case WM_LBUTTONUP:
+ case WM_RBUTTONUP:
+ {
+ POINT pnt;
+ GetCursorPos( &pnt );
+ SetForegroundWindow( hWnd ); // needed to get keyboard focus
+ TrackPopupMenu( hPopMenu, TPM_LEFTALIGN, pnt.x, pnt.y, 0, hWnd, NULL );
+ }
+ break;
+ }
+ }
+ break;
+
+ case WM_COMMAND:
+ {
+ switch ( LOWORD( wParam ) )
+ {
+ case MENU_CONFIG:
+ MessageBox( NULL, configInfo, nid.szTip, MB_SETFOREGROUND );
+ break;
+
+ case MENU_EXIT:
+ Shell_NotifyIcon( NIM_DELETE, &nid );
+ ExitProcess(0);
+ break;
+
+ default:
+ {
+ if (is_exe( menuCommands[LOWORD(wParam )])) {
+ STARTUPINFO si;
+ PROCESS_INFORMATION pi;
+ ZeroMemory( &si, sizeof(si) );
+ si.cb = sizeof(si);
+ //si.dwFlags = STARTF_USESHOWWINDOW;
+ //si.wShowWindow = SW_HIDE ;
+ ZeroMemory( &pi, sizeof(pi) );
+ if( !CreateProcess(
+ NULL, // module name (uses command line if NULL)
+ menuCommands[LOWORD(wParam)], // command line
+ NULL, // process security atrributes
+ NULL, // thread security atrributes
+ TRUE, // handle inheritance
+ 0, // creation flags, e.g. CREATE_NO_WINDOW,
+ // DETACHED_PROCESS
+ NULL, // pointer to environment block (uses parent if NULL)
+ NULL, // starting directory (uses parent if NULL)
+ &si, // STARTUPINFO structure
+ &pi ) // PROCESS_INFORMATION structure
+ ) DIE( "Failed to spawn command (error code %d):\n%s",
+ GetLastError(), menuCommands[LOWORD(wParam)] );
+ } else {
+ // data file; try to open with default application
+ ShellExecute( NULL, NULL, menuCommands[LOWORD(wParam)],
+ NULL, NULL, SW_SHOWNORMAL );
+ }
+ }
+ }
+ }
+ break;
+
+ default:
+ return DefWindowProc( hWnd, msg, wParam, lParam );
+
+ }
+
+ return 0;
+}
+
+int APIENTRY WinMain(
+ HINSTANCE hInstance,
+ HINSTANCE hPrevInstance,
+ LPSTR lpCmdLine,
+ int nCmdShow )
+{
+
+ // scratch variables
+
+ char *s;
+
+ // get file name of this executable
+
+ static char dirSelf[MAX_PATH];
+ DWORD nchars = GetModuleFileName(NULL, dirSelf, MAX_PATH);
+ if ( !nchars || ( nchars == MAX_PATH ) ) DIE( "Cannot get own path." );
+ if ( s = strrchr( dirSelf, '\\' ) ) *s = '\0'; // remove file name part
+
+ // set current directory
+
+ if ( !SetCurrentDirectory( dirSelf ) )
+ DIE( "Failed to change current directory to:\n%s", dirSelf );
+
+ // prepend bin/win32 to PATH
+
+ strcpy( strBuf, dirSelf );
+ if ( strlen( dirSelf ) + strlen( "\\bin\\win32;" )
+ + strlen( getenv( "PATH" )) >= MAX_STR )
+ DIE( "Path getting too long" );
+ strcat( strBuf, "\\bin\\win32;" );
+ strcat( strBuf, getenv( "PATH" ) );
+ SetEnvironmentVariable( "PATH", strBuf );
+
+ // configuration
+
+ static char fileConfig[MAX_PATH];
+ s = dirSelf + strlen(dirSelf) + 1;
+ strcpy( fileConfig, s );
+ if ( s = strrchr( fileConfig, '.' ) ) *s = '\0'; // remove file extension part
+ strcat( fileConfig, ".ini" );
+
+ strcat( configInfo, dirSelf );
+ strcat( configInfo, "\\tlpkg\\installer\\" );
+ strcat( configInfo, fileConfig );
+
+ if ( GetFileAttributes( fileConfig ) == INVALID_FILE_ATTRIBUTES ) {
+
+ // validate default configuration (menuCommands should be existing files)
+
+ int i;
+ for ( i = 0; menuLabels[i]; i++ )
+ if ( GetFileAttributes( menuCommands[i] ) == INVALID_FILE_ATTRIBUTES )
+ menuCommands[i] = NULL;
+
+ } else {
+
+ // read menu configuration from ini file
+
+ FILE *CONFIG = fopen( fileConfig, "rt" );
+ if ( CONFIG == NULL )
+ DIE( "Failed to open configuration file:\n%s\\%s", dirSelf, fileConfig );
+
+ char strSect[] = "[menu]";
+ int menuItem = -1;
+ int i = 0;
+ int lineNo;
+ for ( lineNo = 1 ; fgets( strBuf, MAX_STR, CONFIG )
+ && menuItem < MAX_MENU_ENTRIES ; lineNo++ )
+ {
+ if ( menuItem < 0 )
+ {
+ if ( *strBuf == '[' &&
+ strncmp( strBuf, strSect, strlen( strSect ) ) == 0 ) menuItem++;
+ continue;
+ }
+ if ( *strBuf == ';' ) continue; // skip comments
+ if ( *strBuf == '[' ) break; // next section
+ s = &menuStrings[i];
+ i += ExpandEnvironmentStrings( strBuf, s, MAX_STR - i );
+ if ( i >= MAX_STR )
+ DIE( "Exceeded 32KB limit for configuration." );
+ if ( i-2 && menuStrings[i-2] == '\n' ) { menuStrings[i-2] = '\0'; i--; }
+ menuLabels[menuItem] = s;
+ while ( *s && *s != '=' ) s++;
+ if ( *s == '\0' )
+ DIE( "Missing '=' on line %d in configuration file:\n%s\\%s",
+ lineNo, dirSelf, fileConfig );
+ *s++ = '\0'; // assign first, then increment
+ menuCommands[menuItem] = s;
+ menuItem++;
+ }
+ if ( menuItem < 0 )
+ DIE( "Missing [menu] section in configuration file:\n%s\\%s",
+ dirSelf, fileConfig );
+ menuLabels[menuItem] = NULL;
+ menuCommands[menuItem] = NULL;
+
+ fclose( CONFIG );
+
+ }
+
+ // create a hidden window for messaging
+
+ MSG msg;
+ WNDCLASS wc;
+ HWND hWnd;
+ char szAppName[] = "TrayMenu";
+
+ ZeroMemory( &wc, sizeof wc );
+ wc.hInstance = hInstance;
+ wc.lpszClassName = szAppName;
+ wc.lpfnWndProc = (WNDPROC)WndProc;
+ wc.style = 0;
+ wc.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
+ wc.hIcon = LoadIcon( NULL, IDI_APPLICATION );
+ wc.hCursor = LoadCursor( NULL, IDC_ARROW );
+
+ if ( FALSE == RegisterClass( &wc ) ) DIE( "Failed to register window class" );
+
+ hWnd = CreateWindow(
+ szAppName,
+ "",
+ 0,
+ CW_USEDEFAULT,
+ CW_USEDEFAULT,
+ CW_USEDEFAULT,
+ CW_USEDEFAULT,
+ 0,
+ 0,
+ hInstance,
+ 0);
+
+ if ( hWnd == NULL ) DIE( "Failed to create window" );
+
+ // tray icon stuff
+
+ nid.cbSize = sizeof nid;
+ nid.hWnd = hWnd;
+ nid.uID = IDI_TRAY;
+ nid.uFlags = NIF_ICON|NIF_MESSAGE|NIF_TIP;
+ nid.hIcon = LoadIcon( hInstance, MAKEINTRESOURCE( IDI_ICON ) );
+ nid.uCallbackMessage = WM_TRAYMSG;
+ strcpy( nid.szTip, "TeX Live Menu" );
+#if (_WIN32_IE >= 0X0500)
+ nid.uFlags |= NIF_INFO;
+ nid.dwInfoFlags = NIIF_INFO;
+ strcpy( nid.szInfo, "Click on the tray icon\nto activate the menu." );
+ strcpy( nid.szInfoTitle, nid.szTip );
+#endif
+ Shell_NotifyIcon( NIM_ADD, &nid );
+
+ // main message loop:
+
+ while ( GetMessage( &msg, NULL, 0, 0 ) > 0 )
+ {
+ TranslateMessage( &msg );
+ DispatchMessage( &msg );
+ }
+
+ return msg.wParam;
+}
+
diff --git a/Build/source/texk/texlive/w64_mingw_wrapper/tlmgr-gui.txt b/Build/source/texk/texlive/windows_wrapper/tlmgr-gui.txt
index 559d97ed3f2..d744f45a239 100644
--- a/Build/source/texk/texlive/w64_mingw_wrapper/tlmgr-gui.txt
+++ b/Build/source/texk/texlive/windows_wrapper/tlmgr-gui.txt
@@ -1,77 +1,77 @@
-/*
-
-Launcher stub for tlmgr gui (with hidden console window)
-
-//////////////////////////////////////////////////
-
-This version has been replaced with a version which triggers a UAC
-prompt when appropriate. See Master/source/tlmgr-gui_UAC.zip.
-
-//////////////////////////////////////////////////
-
-Originally written in 2011 by Tomasz M. Trzeciak, Public Domain
-
-compiling with gcc (size optimized):
-echo 1 ICON "tlmgr-gui.ico">tlmgr-gui.rc
-windres tlmgr-gui.rc tlmgr-gui-rc.o
-gcc -Os -s -mwindows -o tlmgr-gui.exe tlmgr-gui-rc.o tlmgr-gui.c
-
-compiling with tcc (ver. 0.9.25), extra small size
-windres tlmgr-gui.rc tlmgr-gui-rc.o
-tcc -o tlmgr-gui.exe tlmgr-gui-rc.o tlmgr-gui.c
-
-*/
-
-#include <windows.h>
-
-static char msgbuf[4*MAX_PATH];
-#define DIE(...) { \
- _snprintf( msgbuf, 4*MAX_PATH, __VA_ARGS__ ); \
- MessageBox( NULL, msgbuf, "ERROR!", MB_ICONERROR | MB_SETFOREGROUND );\
- return 1; \
-}
-
-static char cmdln[2*MAX_PATH];
-
-int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShowint ) {
-
- // get file name of this executable
-
- static char selfdir[MAX_PATH];
- char *name, *ext, *s;
- DWORD nchars = GetModuleFileName(NULL, selfdir, MAX_PATH);
- if ( !nchars || (nchars == MAX_PATH) ) DIE( "cannot get own path" );
-
- // make command to execute
-
- if ( s = strrchr(selfdir, '\\') ) *s = '\0'; // remove file name part
- strcat( cmdln, "\"" );
- strcat( cmdln, selfdir );
- strcat( cmdln, "\\tlmgr.bat\" -gui" );
-
- // create child process
-
- STARTUPINFO si;
- PROCESS_INFORMATION pi;
- ZeroMemory( &si, sizeof(si) );
- si.cb = sizeof(si);
- si.dwFlags = STARTF_USESHOWWINDOW;
- si.wShowWindow = SW_HIDE ;
- ZeroMemory( &pi, sizeof(pi) );
-
- if( !CreateProcess(
- NULL, // module name (uses command line if NULL)
- cmdln, // command line
- NULL, // process security atrributes
- NULL, // thread security atrributes
- TRUE, // handle inheritance
- 0, // creation flags, e.g. CREATE_NEW_CONSOLE, CREATE_NO_WINDOW, DETACHED_PROCESS
- NULL, // pointer to environment block (uses parent if NULL)
- NULL, // starting directory (uses parent if NULL)
- &si, // STARTUPINFO structure
- &pi ) // PROCESS_INFORMATION structure
- ) DIE( "command execution failed: %s", cmdln );
-
- return 0;
-
-}
+/*
+
+Launcher stub for tlmgr gui (with hidden console window)
+
+//////////////////////////////////////////////////
+
+This version has been replaced with a version which triggers a UAC
+prompt when appropriate. See Master/source/tlmgr-gui_UAC.zip.
+
+//////////////////////////////////////////////////
+
+Originally written in 2011 by Tomasz M. Trzeciak, Public Domain
+
+compiling with gcc (size optimized):
+echo 1 ICON "tlmgr-gui.ico">tlmgr-gui.rc
+windres tlmgr-gui.rc tlmgr-gui-rc.o
+gcc -Os -s -mwindows -o tlmgr-gui.exe tlmgr-gui-rc.o tlmgr-gui.c
+
+compiling with tcc (ver. 0.9.25), extra small size
+windres tlmgr-gui.rc tlmgr-gui-rc.o
+tcc -o tlmgr-gui.exe tlmgr-gui-rc.o tlmgr-gui.c
+
+*/
+
+#include <windows.h>
+
+static char msgbuf[4*MAX_PATH];
+#define DIE(...) { \
+ _snprintf( msgbuf, 4*MAX_PATH, __VA_ARGS__ ); \
+ MessageBox( NULL, msgbuf, "ERROR!", MB_ICONERROR | MB_SETFOREGROUND );\
+ return 1; \
+}
+
+static char cmdln[2*MAX_PATH];
+
+int APIENTRY WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShowint ) {
+
+ // get file name of this executable
+
+ static char selfdir[MAX_PATH];
+ char *name, *ext, *s;
+ DWORD nchars = GetModuleFileName(NULL, selfdir, MAX_PATH);
+ if ( !nchars || (nchars == MAX_PATH) ) DIE( "cannot get own path" );
+
+ // make command to execute
+
+ if ( s = strrchr(selfdir, '\\') ) *s = '\0'; // remove file name part
+ strcat( cmdln, "\"" );
+ strcat( cmdln, selfdir );
+ strcat( cmdln, "\\tlmgr.bat\" -gui" );
+
+ // create child process
+
+ STARTUPINFO si;
+ PROCESS_INFORMATION pi;
+ ZeroMemory( &si, sizeof(si) );
+ si.cb = sizeof(si);
+ si.dwFlags = STARTF_USESHOWWINDOW;
+ si.wShowWindow = SW_HIDE ;
+ ZeroMemory( &pi, sizeof(pi) );
+
+ if( !CreateProcess(
+ NULL, // module name (uses command line if NULL)
+ cmdln, // command line
+ NULL, // process security atrributes
+ NULL, // thread security atrributes
+ TRUE, // handle inheritance
+ 0, // creation flags, e.g. CREATE_NEW_CONSOLE, CREATE_NO_WINDOW, DETACHED_PROCESS
+ NULL, // pointer to environment block (uses parent if NULL)
+ NULL, // starting directory (uses parent if NULL)
+ &si, // STARTUPINFO structure
+ &pi ) // PROCESS_INFORMATION structure
+ ) DIE( "command execution failed: %s", cmdln );
+
+ return 0;
+
+}
diff --git a/Build/source/texk/texlive/w64_mingw_wrapper/tlmgr.ico b/Build/source/texk/texlive/windows_wrapper/tlmgr.ico
index 6f0c37f54e0..6f0c37f54e0 100644
--- a/Build/source/texk/texlive/w64_mingw_wrapper/tlmgr.ico
+++ b/Build/source/texk/texlive/windows_wrapper/tlmgr.ico
Binary files differ
diff --git a/Build/source/texk/texlive/w64_mingw_wrapper/tlmgr.svg b/Build/source/texk/texlive/windows_wrapper/tlmgr.svg
index 6e60a8f273c..6e60a8f273c 100644
--- a/Build/source/texk/texlive/w64_mingw_wrapper/tlmgr.svg
+++ b/Build/source/texk/texlive/windows_wrapper/tlmgr.svg
diff --git a/Build/source/texk/texlive/w64_mingw_wrapper/wrunscript_exe.c b/Build/source/texk/texlive/windows_wrapper/wrunscript_exe.c
index 573501ae757..0bc4beb5e27 100644
--- a/Build/source/texk/texlive/w64_mingw_wrapper/wrunscript_exe.c
+++ b/Build/source/texk/texlive/windows_wrapper/wrunscript_exe.c
@@ -1,27 +1,27 @@
-/************************************************************************
-
- This file is a part of the wrapper program for launching scripts
- and programs in TeX Live on Windows. See readme.txt for more details.
-
- This file was originally written in 2009 by Tomasz M. Trzeciak and
- was placed in the Public Domain.
-
-************************************************************************/
-
-#include <windows.h>
-
-__declspec(dllimport) int dllwrunscript(
- HINSTANCE hInstance,
- HINSTANCE hPrevInstance,
- char *argline,
- int winshow
- );
-
-int APIENTRY WinMain(
- HINSTANCE hInstance,
- HINSTANCE hPrevInstance,
- char *argline,
- int winshow
-){
- return dllwrunscript( hInstance, hPrevInstance, argline, winshow );
-}
+/************************************************************************
+
+ This file is a part of the wrapper program for launching scripts
+ and programs in TeX Live on Windows. See readme.txt for more details.
+
+ This file was originally written in 2009 by Tomasz M. Trzeciak and
+ was placed in the Public Domain.
+
+************************************************************************/
+
+#include <windows.h>
+
+__declspec(dllimport) int dllwrunscript(
+ HINSTANCE hInstance,
+ HINSTANCE hPrevInstance,
+ char *argline,
+ int winshow
+ );
+
+int APIENTRY WinMain(
+ HINSTANCE hInstance,
+ HINSTANCE hPrevInstance,
+ char *argline,
+ int winshow
+){
+ return dllwrunscript( hInstance, hPrevInstance, argline, winshow );
+}