diff options
author | Siep Kroonenberg <siepo@cybercomm.nl> | 2020-03-26 11:58:31 +0000 |
---|---|---|
committer | Siep Kroonenberg <siepo@cybercomm.nl> | 2020-03-26 11:58:31 +0000 |
commit | bee48aaba44f2ad289dbd3851e7bbc8f8d97731a (patch) | |
tree | 5f502a2ce7df0a03fd06abd3765940e731fb2168 /Master/texmf-dist/scripts | |
parent | 37d5b5060e53c43016b3be2e9cacad7033d7f76f (diff) |
Windows error handling in case of missing Tk module
git-svn-id: svn://tug.org/texlive/trunk@54557 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/scripts')
-rwxr-xr-x | Master/texmf-dist/scripts/texdoctk/texdoctk.pl | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/Master/texmf-dist/scripts/texdoctk/texdoctk.pl b/Master/texmf-dist/scripts/texdoctk/texdoctk.pl index 45a0cf7e640..9ef067a0192 100755 --- a/Master/texmf-dist/scripts/texdoctk/texdoctk.pl +++ b/Master/texmf-dist/scripts/texdoctk/texdoctk.pl @@ -33,10 +33,21 @@ if ($IsWin32) { eval { require Tk; }; if ($@) { - if (-x "/usr/bin/xmessage") { - `xmessage -center -buttons Quit "The program texdoctk needs the package perl-tk, please install it!"`; + if ($IsWin32) { + $ENV{'RUNSCRIPT_ERROR_MESSAGE'} = "This Perl has no Perl/Tk module; aborting..."; + my $vbsc = ""; + $vbsc = `kpsewhich -format texmfscripts tl-errmess.vbs`; + if ($vbsc ne '') { + $vbsc =~ s!/!\\!g; + system("wscript $vbsc"); + exit(0); # 0: prevent another error message from runscript + } } else { - printf STDERR "The program texdoctk needs the package perl-tk, please install it!\n"; + if (-x "/usr/bin/xmessage") { + `xmessage -center -buttons Quit "The program texdoctk needs the package perl-tk, please install it!"`; + } else { + printf STDERR "The program texdoctk needs the package perl-tk, please install it!\n"; + } } exit(1); # that didn't work out, so warn the user and continue with text mode |