diff options
author | Norbert Preining <preining@logic.at> | 2008-10-29 21:27:29 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2008-10-29 21:27:29 +0000 |
commit | 9d7435122110c28a4c1cb8c434c2c862ee731891 (patch) | |
tree | 81ffa38afb5d2b9949f23962cd7404126b743f8e /Master | |
parent | c344c4284faf84c6ce57306e142ed3b654b0a7ca (diff) |
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
Diffstat (limited to 'Master')
-rwxr-xr-x | Master/install-tl | 57 |
1 files changed, 33 insertions, 24 deletions
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_")) { @@ -431,30 +464,6 @@ if ($opt_profile eq "") { 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 { require("installer/install-menu-text.pl"); |