From 9d7435122110c28a4c1cb8c434c2c862ee731891 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Wed, 29 Oct 2008 21:27:29 +0000 Subject: move the Perl-Tk check before loading the database, and wait 3sec before continuing in Text mode if there are problems. git-svn-id: svn://tug.org/texlive/trunk@11112 c570f23f-e606-0410-a88d-b1316a301751 --- Master/install-tl | 57 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 33 insertions(+), 24 deletions(-) (limited to 'Master/install-tl') diff --git a/Master/install-tl b/Master/install-tl index 14b6e71ceac..c43d198f51a 100755 --- a/Master/install-tl +++ b/Master/install-tl @@ -324,6 +324,39 @@ if ($opt_print_arch) { # continuing with normal install +# check as soon as possible for GUI functionality to give people a chance +# tp interrupt. +if ($opt_gui && !$opt_no_gui && ($opt_profile eq "")) { + # try to load Tk.pm, but don't die if it doesn't work + eval { require Tk; }; + if ($@) { + # that didn't work out, so warn the user and continue with text mode + tlwarn("Cannot load Tk, maybe something is missing and\n"); + tlwarn("maybe http://tug.org/texlive/distro.html#perltk can help.\n"); + tlwarn("Error message from loading Tk:\n"); + tlwarn(" $@\n"); + tlwarn("Continuing in text mode...\n"); + $opt_gui = 0; + } + eval { my $foo = Tk::MainWindow->new; $foo->destroy; }; + if ($@) { + tlwarn("perl/Tk unusable, cannot create main windows.\n"); + if (platform() eq "universal-darwin") { + tlwarn("That could be a consequence of not having X Windows installed or started!\n"); + } + tlwarn("Error message from creating MainWindow:\n"); + tlwarn(" $@\n"); + tlwarn("Continuing in text mode...\n"); + $opt_gui = 0; + } + if (!$opt_gui) { + # we switched from GUI to non-GUI mode, tell the user and wait a bit + tlwarn("\nSwitching to text mode installer, if you want to cancel, do it now!\n"); + tlwarn("Waiting for 3 second\n"); + sleep(3); + } +} + # initialize the correct platform platform(); if (!setup_programs ("$::installerdir/tlpkg/installer", "$::_platform_")) { @@ -430,30 +463,6 @@ if ($opt_profile eq "") { our $MENU_ABORT = 1; our $MENU_QUIT = 2; our $MENU_ALREADYDONE = 3; - if ($opt_gui && !$opt_no_gui) { - # try to load Tk.pm, but don't die if it doesn't work - eval { require Tk; }; - if ($@) { - # that didn't work out, so warn the user and continue with text mode - tlwarn("Cannot load Tk, maybe something is missing and\n"); - tlwarn("maybe http://tug.org/texlive/distro.html#perltk can help.\n"); - tlwarn("Error message from loading Tk:\n"); - tlwarn(" $@\n"); - tlwarn("Continuing in text mode...\n"); - $opt_gui = 0; - } - eval { my $foo = Tk::MainWindow->new; $foo->destroy; }; - if ($@) { - tlwarn("perl/Tk unusable, cannot create main windows.\n"); - if (platform() eq "universal-darwin") { - tlwarn("That could be a consequence of not having X Windows installed or started!\n"); - } - tlwarn("Error message from creating MainWindow:\n"); - tlwarn(" $@\n"); - tlwarn("Continuing in text mode...\n"); - $opt_gui = 0; - } - } if ($opt_gui && !$opt_no_gui) { require("installer/install-menu-perltk.pl"); } else { -- cgit v1.2.3