diff options
-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 |