From bee48aaba44f2ad289dbd3851e7bbc8f8d97731a Mon Sep 17 00:00:00 2001 From: Siep Kroonenberg Date: Thu, 26 Mar 2020 11:58:31 +0000 Subject: Windows error handling in case of missing Tk module git-svn-id: svn://tug.org/texlive/trunk@54557 c570f23f-e606-0410-a88d-b1316a301751 --- Master/texmf-dist/scripts/texdoctk/texdoctk.pl | 17 ++++++++++++++--- 1 file 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 -- cgit v1.2.3