summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xMaster/install-tl57
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");