diff options
Diffstat (limited to 'Master')
-rw-r--r-- | Master/bin/win32/conf/fonts.conf | 3 | ||||
-rwxr-xr-x | Master/install-tl | 231 | ||||
-rw-r--r-- | Master/tlpkg/TeXLive/TLPostActions.pm | 25 | ||||
-rw-r--r-- | Master/tlpkg/TeXLive/TLWinGoo.pm | 74 | ||||
-rw-r--r-- | Master/tlpkg/installer/install-menu-perltk.pl | 5 | ||||
-rwxr-xr-x | Master/tlpkg/installer/install-menu-text.pl | 167 |
6 files changed, 302 insertions, 203 deletions
diff --git a/Master/bin/win32/conf/fonts.conf b/Master/bin/win32/conf/fonts.conf index bc375e03637..da22ed635d0 100644 --- a/Master/bin/win32/conf/fonts.conf +++ b/Master/bin/win32/conf/fonts.conf @@ -2,7 +2,7 @@ <!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<!-- /etc/fonts/fonts.conf file to configure system font access -->
<fontconfig>
-<!--
+<!--
Find fonts in these directories
You can add other directories if you have additional fonts.
@@ -23,6 +23,7 @@ <cachedir>c:/etc/fccache</cachedir>
You don't need to set this section.
-->
+<cachedir>c:/etc/fccache</cachedir>
<!--
diff --git a/Master/install-tl b/Master/install-tl index 89fd8772c6e..86332fdb85f 100755 --- a/Master/install-tl +++ b/Master/install-tl @@ -109,8 +109,6 @@ my $default_scheme='scheme-full'; our @collections_std; our @collections_lang; our @collections_lang_doc; -# for win dealing -#our $Registry; # The global variable %vars is an associative list which contains all # variables and their values which can be changed by the user. # needs to be our since TeXLive::TLUtils uses it @@ -137,6 +135,7 @@ our %vars=( # 'n_' means 'number of'. 'src_splitting_supported' => 1, 'doc_splitting_supported' => 1, 'selected_scheme' => $default_scheme, + 'from_dvd' => 0, ); # @@ -145,6 +144,7 @@ process_logging_options(); # option handling my $opt_media = ""; +my $opt_from_dvd = ""; my $opt_url = ""; my $opt_profile = ""; my $opt_no_cls=0; @@ -161,6 +161,7 @@ $opt_gui = 1 if (win32); $::lang = "en"; GetOptions("media=s" => \$opt_media, + "from_dvd" => \$opt_from_dvd, "profile=s"=> \$opt_profile, "no-cls", "gui", \$opt_gui, @@ -230,6 +231,8 @@ my $finished = 0; my $system_tmpdir=get_system_tmpdir(); +# a couple of special uses of install-tl: + if ($opt_arch) { print platform; exit 0; @@ -279,6 +282,8 @@ if ($opt_arch) { exit 0; } +# continuing with normal install + info("Platform: ", platform, " => \'", platform_desc(platform), "\'\n"); if (media() eq "DVD") { info("Distribution: live (uncompressed)\n"); @@ -293,6 +298,13 @@ info("Directory for Temporary Files: '", $system_tmpdir, "\'\n"); info("Installer Directory: '$::installerdir'\n"); initialize_installer(); + +if ($opt_from_dvd and ($::_media_ ne "DVD")) { + print "Not running from DVD; 'from_dvd' option not applicable\n"; + $opt_from_dvd = 0; +} +$vars{'from_dvd'} = $opt_from_dvd; + setup_programs("$::installerdir/tlpkg/installer", "$::_platform_"); load_tlpdb(); @@ -374,13 +386,13 @@ if (!$finished) { # now open the log file and write out the log lines # try to open a log file -if (open(LOGF,">$vars{'TEXDIR'}/install-tl.log")) { +if (open(LOGF,">$vars{'TEXDIRW'}/install-tl.log")) { $::LOGFILE = \*LOGF; foreach my $line(@::LOGLINES) { print $::LOGFILE "$line"; } } else { - warn("Cannot create log file $vars{'TEXDIR'}/install-tl.log: $!\nNot writing out log lines!\n"); + warn("Cannot create log file $vars{'TEXDIRW'}/install-tl.log: $!\nNot writing out log lines!\n"); } # dump various things to the log file @@ -395,12 +407,18 @@ if (defined($::LOGFILE)) { dump_vars("$system_tmpdir/texlive.vars"); # write the profile out -create_profile("$vars{'TEXDIR'}/$InfraLocation/texlive.profile"); -debug("Profile written to $vars{'TEXDIR'}/$InfraLocation/texlive.profile\n"); - +if ($vars{'from_dvd'}) { + create_profile("$vars{'TEXDIRW'}/texlive.profile"); + debug("Profile written to $vars{'TEXDIRW'}/texlive.profile\n"); +} else { + create_profile("$vars{'TEXDIR'}/$InfraLocation/texlive.profile"); + debug("Profile written to $vars{'TEXDIR'}/$InfraLocation/texlive.profile\n"); +} # Close log file if present close($::LOGFILE) if defined($::LOGFILE); +print "Don't forget to set TEXMFSYSVAR to ".$vars{'TEXMFSYSVAR'}."!!!\n" + if ($vars{'from_dvd'} and !win32()); exit(0); @@ -413,24 +431,29 @@ exit(0); sub do_installation { # do the actual installation - foreach my $h (@::start_install_hook) { + my $h; + foreach $h (@::start_install_hook) { &$h(); } - calc_depends(); prepare_installation(); - save_options_into_tlpdb(); - do_install_packages(); + if (!$vars{'from_dvd'}) { + calc_depends(); + save_options_into_tlpdb(); + do_install_packages(); + } if (win32()) { add_texbindir_to_path($vars{'TEXDIR'}.'/bin/win32'); + setenv_reg('TEXMFSYSVAR', $vars{'TEXMFSYSVAR'}) if $vars{'from_dvd'}; broadcast_env(); - create_uninstaller($vars{'TEXDIR'}); + create_uninstaller($vars{'TEXDIR'}, $vars{'TEXDIRW'}, + $vars{'TEXMFSYSVAR'}, $vars{'TEXMFSYSCONFIG'}); } - foreach my $h (@::start_postinst_hook) { + foreach $h (@::start_postinst_hook) { &$h(); } do_postinst_stuff(); - $localtlpdb->save; - foreach my $h (@::end_install_hook) { + $localtlpdb->save unless $vars{'from_dvd'}; + foreach $h (@::end_install_hook) { &$h(); } } @@ -489,19 +512,22 @@ sub set_texlive_default_dirs { } else { $tex_prefix||='/usr/local/texlive'; } - $vars{'TEXDIR'}="$tex_prefix/$texlive_release"; + $vars{'TEXDIRW'}="$tex_prefix/$texlive_release"; $texmfsysvar=getenv('TEXLIVE_INSTALL_TEXMFSYSVAR'); - $texmfsysvar||=$vars{'TEXDIR'} . '/texmf-var'; - $vars{'TEXMFSYSVAR'}="$texmfsysvar"; + $texmfsysvar||=$vars{'TEXDIRW'} . '/texmf-var'; + $vars{'TEXMFSYSVAR'}=$texmfsysvar; $texmfsysconfig=getenv('TEXLIVE_INSTALL_TEXMFSYSCONFIG'); - $texmfsysconfig||=$vars{'TEXDIR'} . '/texmf-config'; - $vars{'TEXMFSYSCONFIG'}="$texmfsysconfig"; + $texmfsysconfig||=$vars{'TEXDIRW'} . '/texmf-config'; + $vars{'TEXMFSYSCONFIG'}=$texmfsysconfig; $texmflocal=getenv('TEXLIVE_INSTALL_TEXMFLOCAL'); $texmflocal||="$tex_prefix/texmf-local"; - $vars{'TEXMFLOCAL'}="$texmflocal"; + $vars{'TEXMFLOCAL'}=$texmflocal; + + $vars{'TEXDIR'} = $vars{'from_dvd'} ? abs_path($::installerdir) : + $vars{'TEXDIRW'}; $texmfhome=getenv('TEXLIVE_INSTALL_TEXMFHOME'); $texmfhome ||= "~"; @@ -513,6 +539,8 @@ sub calc_depends { # always be installed since the default is scheme-full which selects # all packages and never deselects it %install=(); + my $p; + my $a; # initialize the %install hash with what should be installed @@ -565,12 +593,12 @@ sub calc_depends { ddebug("initial number of installations: $#pre_selected\n"); # loop over all the pre_selected and add them - foreach my $p (@pre_selected) { + foreach $p (@pre_selected) { ddebug("pre_selected $p\n"); foreach my $p_dep ($tlpdb->get_package($p)->depends) { if ($p_dep =~ m/^(.*)\.ARCH$/) { my $foo = "$1"; - foreach my $a (@archs) { + foreach $a (@archs) { $install{"$foo.$a"} = 1; } } elsif ($p_dep =~ m/^(.*)\.win32$/) { @@ -597,7 +625,7 @@ sub calc_depends { # now do the size computation my $size = 0; - foreach my $p (keys %install) { + foreach $p (keys %install) { my $tlpobj = $tlpdb->get_package($p); if (not(defined($tlpobj))) { die "Cannot find $p in texlive.tlpdb, strange!\n"; @@ -605,7 +633,7 @@ sub calc_depends { $size+=$tlpobj->docsize if $vars{'option_doc'}; $size+=$tlpobj->srcsize if $vars{'option_src'}; $size+=$tlpobj->runsize; - foreach my $a (@archs) { + foreach $a (@archs) { $size += $tlpobj->binsize->{$a} if defined($tlpobj->binsize->{$a}); } } @@ -728,6 +756,7 @@ sub create_profile { print $fh "$key $vars{$key}\n" if $key=~/^option_fmt/; print $fh "$key $vars{$key}\n" if $key=~/^option_src/; print $fh "$key $vars{$key}\n" if $key=~/^option_symlinks/; + print $fh "$key $vars{$key}\n" if $key=~/^TEXDIRW/; print $fh "$key $vars{$key}\n" if $key=~/^TEXDIR/; print $fh "$key $vars{$key}\n" if $key=~/^TEXMFSYSVAR/; print $fh "$key $vars{$key}\n" if $key=~/^TEXMFSYSCONFIG/; @@ -760,10 +789,14 @@ sub read_profile { sub prepare_installation { make_var_skeleton "$vars{'TEXMFSYSVAR'}"; make_local_skeleton "$vars{'TEXMFLOCAL'}"; - mkdirhier "$vars{'TEXDIR'}/texmf-config"; + mkdirhier "$vars{'TEXMFSYSCONFIG'}"; - $localtlpdb=new TeXLive::TLPDB; - $localtlpdb->root("$vars{'TEXDIR'}"); + if ($vars{'from_dvd'}) { + $localtlpdb = $tlpdb; + } else { + $localtlpdb=new TeXLive::TLPDB; + $localtlpdb->root("$vars{'TEXDIR'}"); + } } @@ -797,7 +830,7 @@ sub save_options_into_tlpdb { } } $localtlpdb->option_available_archs(@archs); - $localtlpdb->save(); + $localtlpdb->save() unless $vars{'from_dvd'}; } # do_postinst_stuff has to fix up the texmf tree and install some missing @@ -805,11 +838,13 @@ sub save_options_into_tlpdb { # of former times, and should be critically checked. sub do_postinst_stuff { my $TEXDIR="$vars{'TEXDIR'}"; + my $TEXDIRW="$vars{'TEXDIRW'}"; my $TEXMFSYSVAR="$vars{'TEXMFSYSVAR'}"; my $TEXMFSYSCONFIG="$vars{'TEXMFSYSCONFIG'}"; my $TEXMFLOCAL="$vars{'TEXMFLOCAL'}"; + my $tmv; - do_texmf_cnf() unless $opt_portable; + do_texmf_cnf() unless ($opt_portable); # final program execution @@ -820,10 +855,6 @@ sub do_postinst_stuff { # - run the programs # Step 1: Clean the environment - #my @TMFVARS=qw(VARTEXFONTS TEXMFMAIN TEXMFDIST TEXMFLOCAL TEXMFSYSVAR - # TEXMFSYSCONFIG TEXMFHOME TEXMFVAR TEXMFCONFIG TEXMF SYSTEXMF VARTEXFONTS - # TEXMFDBS WEB2C TEXINPUTS TEXFORMATS MFBASES MPMEMS TEXPOOL MFPOOL MPPOOL - # PSHEADERS TEXFONTMAPS TEXPSHEADERS TEXCONFIG TEXMFCNF); my @TMFVARS0=qw(VARTEXFONTS TEXMF SYSTEXMF VARTEXFONTS TEXMFDBS WEB2C TEXINPUTS TEXFORMATS MFBASES MPMEMS TEXPOOL MFPOOL MPPOOL @@ -837,16 +868,17 @@ You should know what you are doing. We will remove that for the post install actions, but all further operations might be disturbed.\n\n"; } - foreach my $tmv (@TMFVARS0) { + foreach $tmv (@TMFVARS0) { delete $ENV{$tmv} if (defined($ENV{$tmv})); } if (!$opt_portable) { - foreach my $tmv (@TMFVARS1) { + foreach $tmv (@TMFVARS1) { delete $ENV{$tmv} if (defined($ENV{$tmv})); } } + $ENV{'TEXMFSYSVAR'} = $vars{'TEXMFSYSVAR'} if $vars{'from_dvd'}; - # Step 2: Setup the PATH, PATHEXT, switch to the new Perl + # Step 2: Setup the PATH, switch to the new Perl my $pathsep=(win32)? ';' : ':'; my $plat_bindir="$TEXDIR/bin/$vars{'this_platform'}"; @@ -870,8 +902,8 @@ operations might be disturbed.\n\n"; if (win32) { #$ENV{'PATHEXT'}=".texlua;" . "$ENV{'PATHEXT'}"; - $ENV{'TEXBINDIR'}=$TEXDIR . "\\bin\\win32"; - $ENV{'TEXBINDIR'} =~ s!/!\\!g; + #$ENV{'TEXBINDIR'}=$TEXDIR . "\\bin\\win32"; + #$ENV{'TEXBINDIR'} =~ s!/!\\!g; $ENV{'PERL5LIB'}="$perl_libdir"; } @@ -880,19 +912,22 @@ operations might be disturbed.\n\n"; # # (re-)initialize batchfile for uninstalling shortcuts - init_unshortbat($vars{'TEXDIR'}) if win32; + if (win32()) { + mkdirhier("$TEXDIRW/tlpkg/installer") if $vars{'from_dvd'}; + init_unshortbat($TEXDIRW); + } foreach my $package (sort keys %install) { if ($install{$package} && defined($PostInstall{$package})) { info("running post install action for $package\n"); - &{$PostInstall{$package}}($TEXDIR, $TEXMFSYSVAR, $TEXMFLOCAL); + &{$PostInstall{$package}}($TEXDIR, $TEXDIRW, $TEXMFSYSVAR, $TEXMFLOCAL); } } update_assocs() if win32(); # Step 4: run the programs - if (!$opt_portable) { + if (!$opt_portable and !$vars{'from_dvd'}) { info("running mktexlsr $TEXDIR/texmf-dist $TEXDIR/texmf\n"); system('mktexlsr', "$TEXDIR/texmf-dist", "$TEXDIR/texmf"); } @@ -902,17 +937,18 @@ operations might be disturbed.\n\n"; # $localtlpdb and this is simple code, so do it directly, i.e., duplicate # the code from the various generate-*.pl scripts info("writing fmtutil.cnf data to $TEXMFSYSVAR/web2c/fmtutil.cnf\n"); - TeXLive::TLUtils::create_fmtutil($localtlpdb, + my $tlp = $vars{'from_dvd'} ? $tlpdb : $localtlpdb; + TeXLive::TLUtils::create_fmtutil($tlp, #$localtlpdb, "$TEXMFSYSVAR/web2c/fmtutil.cnf", "$TEXMFLOCAL/web2c/fmtutil-local.cnf"); info("writing updmap.cfg to $TEXMFSYSVAR/web2c/updmap.cfg\n"); - TeXLive::TLUtils::create_updmap ($localtlpdb, + TeXLive::TLUtils::create_updmap ($tlp, #$localtlpdb, "$TEXMFSYSVAR/web2c/updmap.cfg", "$TEXMFLOCAL/web2c/updmap-local.cfg"); info("writing language.dat data to $TEXMFSYSVAR/tex/generic/config/language.dat\n"); - TeXLive::TLUtils::create_language($localtlpdb, + TeXLive::TLUtils::create_language($tlp, #$localtlpdb, "$TEXMFSYSVAR/tex/generic/config/language.dat", "$TEXMFLOCAL/tex/generic/config/language-local.dat"); @@ -992,57 +1028,68 @@ operations might be disturbed.\n\n"; # we have to adjust the texmf.cnf file to the paths set in the configuration! sub do_texmf_cnf { - open(TMF,"<$vars{'TEXDIR'}/texmf/web2c/texmf.cnf") - or die("$vars{'TEXDIR'}/texmf/web2c/texmf.cnf not found: $!\n"); - my @texmfcnflines = <TMF>; - close(TMF); - my @newtmf; - # we have to find TEXMFLOCAL TEXMFSYSVAR and TEXMFHOME - foreach my $line (@texmfcnflines) { - if ($line =~ m/^TEXMFLOCAL/) { - # by default TEXMFLOCAL = TEXDIR/../texmf-local, if this is the case - # we don't have to change anything from the default - my $deftmlocal = dirname($vars{'TEXDIR'}); - $deftmlocal .= "/texmf-local"; - if ("$vars{'TEXMFLOCAL'}" eq "$deftmlocal") { - push @newtmf, $line; - } else { - push @newtmf, "TEXMFLOCAL = $vars{'TEXMFLOCAL'}\n"; - } - } elsif ($line =~ m/^TEXMFSYSVAR/) { - # by default TEXMFSYSVAR = TEXDIR/texmf-var, if this is the case - # we don't have to change anything from the default - if ("$vars{'TEXMFSYSVAR'}" eq "$vars{'TEXDIR'}/texmf-var") { - push @newtmf, $line; - } else { - push @newtmf, "TEXMFSYSVAR = $vars{'TEXMFSYSVAR'}\n"; - } - } elsif ($line =~ m/^TEXMFSYSCONFIG/) { - # by default TEXMFSYSCONFIG = TEXDIR/texmf-config, if this is the case - # we don't have to change anything from the default - if ("$vars{'TEXMFSYSCONFIG'}" eq "$vars{'TEXDIR'}/texmf-config") { - push @newtmf, $line; - } else { - push @newtmf, "TEXMFSYSCONFIG = $vars{'TEXMFSYSCONFIG'}\n"; - } - } elsif ($line =~ m/^TEXMFHOME/) { - # kpse now expands ~ to USERPROFILE, so we don't treat win32 and - # unix differently - push @newtmf, "TEXMFHOME = $vars{'TEXMFHOME'}\n"; - } elsif ($line =~ m/^OSFONTDIR/) { - if (win32()) { - push @newtmf, "OSFONTDIR = \$SystemRoot/fonts//\n"; + if (!$vars{'from_dvd'}) { + open(TMF,"<$vars{'TEXDIR'}/texmf/web2c/texmf.cnf") + or die("$vars{'TEXDIR'}/texmf/web2c/texmf.cnf not found: $!\n"); + my @texmfcnflines = <TMF>; + close(TMF); + my @newtmf; + # we have to find TEXMFLOCAL TEXMFSYSVAR and TEXMFHOME + foreach my $line (@texmfcnflines) { + if ($line =~ m/^TEXMFLOCAL/) { + # by default TEXMFLOCAL = TEXDIR/../texmf-local, if this is the case + # we don't have to change anything from the default + my $deftmlocal = dirname($vars{'TEXDIR'}); + $deftmlocal .= "/texmf-local"; + if ("$vars{'TEXMFLOCAL'}" eq "$deftmlocal") { + push @newtmf, $line; + } else { + push @newtmf, "TEXMFLOCAL = $vars{'TEXMFLOCAL'}\n"; + } + } elsif ($line =~ m/^TEXMFSYSVAR/) { + # by default TEXMFSYSVAR = TEXDIR/texmf-var, if this is the case + # we don't have to change anything from the default + if ("$vars{'TEXMFSYSVAR'}" eq "$vars{'TEXDIR'}/texmf-var") { + push @newtmf, $line; + } else { + push @newtmf, "TEXMFSYSVAR = $vars{'TEXMFSYSVAR'}\n"; + } + } elsif ($line =~ m/^TEXMFSYSCONFIG/) { + # by default TEXMFSYSCONFIG = TEXDIR/texmf-config, if this is the case + # we don't have to change anything from the default + if ("$vars{'TEXMFSYSCONFIG'}" eq "$vars{'TEXDIR'}/texmf-config") { + push @newtmf, $line; + } else { + push @newtmf, "TEXMFSYSCONFIG = $vars{'TEXMFSYSCONFIG'}\n"; + } + } elsif ($line =~ m/^TEXMFHOME/) { + # kpse now expands ~ to USERPROFILE, so we don't treat win32 and + # unix differently + push @newtmf, "TEXMFHOME = $vars{'TEXMFHOME'}\n"; + } elsif ($line =~ m/^OSFONTDIR/) { + if (win32()) { + push @newtmf, "OSFONTDIR = \$SystemRoot/fonts//\n"; + } else { + push @newtmf, $line; + } } else { push @newtmf, $line; } - } else { - push @newtmf, $line; } + open(TMF,">$vars{'TEXDIR'}/texmf/web2c/texmf.cnf") + or die("Can't open $vars{'TEXDIR'}/texmf/web2c/texmf.cnf for writing: $!\n"); + foreach (@newtmf) { print TMF; } + close(TMF); + } else { # $vars{'from_dvd'} + open(TMF,">$vars{'TEXMFSYSVAR'}/web2c/texmf.cnf") + or die( + "Cannot open $vars{'TEXMFSYSVAR'}/web2c/texmf.cnf for writing: $!\n"); + print TMF "TEXMFLOCAL = $vars{'TEXMFLOCAL'}\n"; + # skip TEXMFSYSVAR since it has to be defined by an env var anyway + print TMF "TEXMFSYSCONFIG = $vars{'TEXMFSYSCONFIG'}\n"; + print TMF "TEXMFHOME = $vars{'TEXMFHOME'}\n"; + print TMF "OSFONTDIR = \$SystemRoot/fonts//\n" if win32(); } - open(TMF,">$vars{'TEXDIR'}/texmf/web2c/texmf.cnf") - or die("Can't open $vars{'TEXDIR'}/texmf/web2c/texmf.cnf for writing: $!\n"); - foreach (@newtmf) { print TMF; } - close(TMF); } # @@ -1069,7 +1116,7 @@ sub select_scheme { } } } - # we have first set all collection-* keys to zero and than + # we have first set all collection-* keys to zero and than # set to 1 only those which are required by the scheme # since now scheme asks for collection-wintools we set its vars value # to 1 in case we are installing win32 binaries diff --git a/Master/tlpkg/TeXLive/TLPostActions.pm b/Master/tlpkg/TeXLive/TLPostActions.pm index 9aac45b6031..dd6d1b10eef 100644 --- a/Master/tlpkg/TeXLive/TLPostActions.pm +++ b/Master/tlpkg/TeXLive/TLPostActions.pm @@ -30,7 +30,7 @@ our %PostRemove; # bin-xetex # sub do_install_bin_xetex { - my ($texdir, $texmfsysvar) = @_; + my ($texdir, $texdirw, $texmfsysvar) = @_; # # bin-xetex installs font-config related stuff # @@ -44,14 +44,14 @@ sub do_install_bin_xetex { } else { push @cpycmd, "cp", "-a"; } - system(@cpycmd, + system(@cpycmd, (win32() ? conv_to_win_path("$texdir/bin/win32/conf") : - "$texdir/bin/win32/conf"), + "$texdir/bin/win32/conf"), (win32() ? conv_to_win_path("$texmfsysvar/fonts/conf") : "$texmfsysvar/fonts/conf")); - system(@cpycmd, + system(@cpycmd, (win32() ? conv_to_win_path("$texdir/bin/win32/cache") : - "$texdir/bin/win32/cache"), + "$texdir/bin/win32/cache"), (win32() ? conv_to_win_path("$texmfsysvar/fonts/cache") : "$texmfsysvar/fonts/cache")); open(FONTSCONF, "<$texdir/bin/win32/conf/fonts.conf") @@ -60,8 +60,15 @@ sub do_install_bin_xetex { close(FONTSCONF); open(FONTSCONF, ">$texmfsysvar/fonts/conf/fonts.conf") or die("Cannot open $texmfsysvar/fonts/conf/fonts.conf for writing"); + if (win32()) { + my $winfontdir = $ENV{'SystemRoot'}.'/fonts'; + $winfontdir =~ s!\\!/!g; + mkdirhier("$texmfsysvar/fonts/cache"); + } foreach (@lines) { $_ =~ s!c:/Program Files/texlive/2008!$texdir!; + $_ =~ s!c:/windows/fonts!$winfontdir! if win32(); + $_ =~ s!c:/etc/fccache!$texmfsysvar/fonts/cache!; print FONTSCONF; } close(FONTSCONF); @@ -77,10 +84,10 @@ $PostInstall{"bin-xetex"} = \&do_install_bin_xetex; # bin-texdoc # sub do_install_bin_texdoc { - my ($texdir) = @_; + my ($texdir, $texdirw) = @_; if (win32()) { add_desktop_shortcut( - $texdir, + $texdirw, 'TeXdoc GUI', '', # $vars{'TEXDIR'}.'/tlpkg/doc/notes.ico', # the icon $texdir.'/bin/win32/texdoctk.bat', @@ -111,10 +118,10 @@ $PostRemove{'bin-texdoc'} = \&do_remove_bin_texdoc; # bin-tlpsv.win32 # sub do_install_bin_tlpsv_win32 { - my ($texdir) = @_; + my ($texdir, $texdirw) = @_; if (win32()) { add_desktop_shortcut( - $texdir, + $texdirw, 'PS_View', $texdir.'/tlpkg/tlpsv/psv.exe', # icon, not prog! $texdir.'/bin/win32/psv.bat', diff --git a/Master/tlpkg/TeXLive/TLWinGoo.pm b/Master/tlpkg/TeXLive/TLWinGoo.pm index 4d2c48657c2..5107fe8c6c5 100644 --- a/Master/tlpkg/TeXLive/TLWinGoo.pm +++ b/Master/tlpkg/TeXLive/TLWinGoo.pm @@ -33,7 +33,6 @@ C<TeXLive::TLWinGoo> -- Additional utilities for Windows TeXLive::TLWinGoo::admin; TeXLive::TLWinGoo::non_admin; TeXLive::TLWinGoo::reg_country; - TeXLive::TLWinGoo::dir_writable($d); =head2 ENVIRONMENT AND REGISTRY @@ -89,7 +88,6 @@ BEGIN { &admin &non_admin ®_country - &dir_writable &expand_string &global_tmpdir &get_system_path @@ -273,32 +271,6 @@ sub reg_country { =pod -=item C<dir_writable($d)> - -Tests whether its argument is writable by trying to write to -it. This function is necessary because the built-in C<-w> test -apparently doesn't work under Windows. - -=cut - -sub dir_writable { - $d=shift; - return 0 unless -d $d; - $d =~ s!\\!/!g; - $d =~ s!/$!!g; - my $i = 0; - while (-e $d . "/" . $i) { $i++; } - my $f = $d."/".$i; - my $fb = $f; - $fb =~ s!/!\\!g; - return 0 if - system('copy /b ' . $ENV{'COMSPEC'} . ' "' . $fb . '" >nul 2>&1'); - unlink $f if -e $f; - return 1; -} - -=pod - =back =head2 ENVIRONMENT AND REGISTRY @@ -1010,49 +982,69 @@ the job. =cut sub create_uninstaller { - my $tdfw = shift; # TEXDIR + my ($tdfw, $tdwfw, $tdsvfw, $tdscfw) = @_; + # TEXDIR, TEXDIRW, TEXMFSYSVAR, TEXMFSYSCONFIG $tdfw =~ s![\\/]$!!; my $td = $tdfw; $td =~ s!/!\\!g; + $tdwfw =~ s![\\/]$!!; + my $tdw = $tdwfw; + $tdw =~ s!/!\\!g; + + $tdsvfw =~ s![\\/]$!!; + my $tdsv = $tdsvfw; + $tdsv =~ s!/!\\!g; + + $tdscfw =~ s![\\/]$!!; + my $tdsc = $tdscfw; + $tdsc =~ s!/!\\!g; + my $uninst_key = $Registry -> Open((admin() ? "LMachine" : "CUser") . "/software/microsoft/windows/currentversion/", {Access => KEY_ALL_ACCESS()}); my $k = $uninst_key->CreateKey("uninstall/TeXLive/"); $k->{"/DisplayName"} = "TeXLive ".$::texlive_release; - $k->{"/UninstallString"} = "\"$td\\tlpkg\\installer\\uninst.bat\""; + $k->{"/UninstallString"} = "\"$tdw\\tlpkg\\installer\\uninst.bat\""; $k->{'/DisplayVersion'} = $::texlive_release; $k->{'/URLInfoAbout'} = "http://www.tug.org/texlive"; - open UNINST, ">$tdfw/tlpkg/installer/uninst.bat"; + mkdirhier("$tdwfw/tlpkg/installer"); # wasn't this done yet? + open UNINST, ">$tdwfw/tlpkg/installer/uninst.bat"; print UNINST <<UNEND; \@echo off set PERL5LIB= \"$td\\tlpkg\\tlperl\\bin\\perl.exe\" \"$td\\texmf\\scripts\\texlive\\uninstall-win32.pl\" -call \"$td\\tlpkg\\installer\\unshort.bat\" -copy \"$td\\tlpkg\\installer\\uninst2.bat\" \"\%TEMP\%\" +call \"$tdw\\tlpkg\\installer\\unshort.bat\" +copy \"$tdw\\tlpkg\\installer\\uninst2.bat\" \"\%TEMP\%\" \"\%TEMP\%\\uninst2.bat\" UNEND +; close UNINST; - open UNINST2, ">$tdfw/tlpkg/installer/uninst2.bat"; - print UNINST2 <<UNEND2; + open UNINST2, ">$tdwfw/tlpkg/installer/uninst2.bat"; + print UNINST2 <<UNEND2 if $td eq $tdw; rmdir /s /q \"$td\\texmf-dist\" rmdir /s /q \"$td\\texmf-doc\" -rmdir /s /q \"$td\\texmf-var\" -rmdir /s /q \"$td\\texmf-config\" rmdir /s /q \"$td\\texmf\" -rmdir /s /q \"$td\\temp\" rmdir /s /q \"$td\\bin\" rmdir /s /q \"$td\\tlpkg\" -del \"$td\\install-tl.log\" +UNEND2 +; + print UNINST2 <<UNEND2; +rmdir /s /q \"$tdsv\" +rmdir /s /q \"$tdsc\" +rmdir /s /q \"$tdw\\temp\" +rmdir /s /q \"$tdw\\tlpkg\" +del \"$tdw\\install-tl.log\" set test= -for \%\%f in (\"$td\\*.*\") do \@set test=nonempty -if x\%test\%==x rd \"$td\" +for \%\%f in (\"$tdw\\*.*\") do \@set test=nonempty +if x\%test\%==x rd \"$tdw\" \@echo Done uninstalling TeXLive. rem \@pause del %0 UNEND2 +; close UNINST2; } diff --git a/Master/tlpkg/installer/install-menu-perltk.pl b/Master/tlpkg/installer/install-menu-perltk.pl index d43e4d5a0da..0cfe9c592cb 100644 --- a/Master/tlpkg/installer/install-menu-perltk.pl +++ b/Master/tlpkg/installer/install-menu-perltk.pl @@ -622,7 +622,7 @@ sub menu_set_pathes_text { } menu_set_text($texmflocaltext, "$vars{'TEXMFLOCAL'}"); if ((-w $vars{'TEXMFSYSVAR'}) || (-w dirname($vars{'TEXMFSYSVAR'}))) { - menu_set_text($texmfsysvartext, "$vars{'TEXMFSYSVAR'}"); + menu_set_text($texmfsysvartext, "$vars{'TEXMFSYSVAR'}", -foreground => "black"); } elsif ("$vars{'TEXMFSYSVAR'}" =~ m;^$vars{'TEXDIR'};) { if (TeXLive::TLUtils::texdir_check($vars{'TEXDIR'})) { menu_set_text($texmfsysvartext, "$vars{'TEXMFSYSVAR'}", -foreground => "black"); @@ -633,7 +633,7 @@ sub menu_set_pathes_text { menu_set_text($texmfsysvartext, $text{'notwritable'}); } if ((-w $vars{'TEXMFSYSCONFIG'}) || (-w dirname($vars{'TEXMFSYSCONFIG'}))) { - menu_set_text($texmfsysconfigtext, "$vars{'TEXMFSYSCONFIG'}"); + menu_set_text($texmfsysconfigtext, "$vars{'TEXMFSYSCONFIG'}", -foreground => "black"); } elsif ("$vars{'TEXMFSYSCONFIG'}" =~ m;^$vars{'TEXDIR'};) { if (TeXLive::TLUtils::texdir_check($vars{'TEXDIR'})) { menu_set_text($texmfsysconfigtext, "$vars{'TEXMFSYSCONFIG'}", -foreground => "black"); @@ -703,6 +703,7 @@ sub callback_edit_directories { $vars{'TEXMFSYSVAR'}="$1/texmf-var"; $vars{'TEXMFSYSCONFIG'}="$1/texmf-config"; } + $vars{'TEXDIRW'}=$vars{'TEXDIR'} } menu_update_texts(); } diff --git a/Master/tlpkg/installer/install-menu-text.pl b/Master/tlpkg/installer/install-menu-text.pl index a92eb87b21b..563eeed6f06 100755 --- a/Master/tlpkg/installer/install-menu-text.pl +++ b/Master/tlpkg/installer/install-menu-text.pl @@ -108,7 +108,7 @@ sub binary_menu { my @binaries; my @keys=string_to_list "abcdefghijklmopstuvwxyz"; my $index=0; - my %keyval; + my %keyval; my $selected_platform; menu_head "Available sets of binaries:"; @@ -121,7 +121,7 @@ sub binary_menu { @binaries=sort(@binaries); foreach my $binary (@binaries) { - printf " %s %s %-16s %s\n", $keys[$index], + printf " %s %s %-16s %s\n", $keys[$index], button($vars{"binary_$binary"}), "$binary" . ":", platform_desc "$binary"; @@ -131,9 +131,9 @@ sub binary_menu { other_options qw(- + R Q); my $answer=prompt 'Press key to select/deselect binary systems'; - + my @keystrokes=string_to_list $answer; - + foreach my $keystroke (@keystrokes) { if ($keystroke eq '-') { for my $binary (@binaries) { @@ -212,7 +212,7 @@ sub scheme_menu { } else { $vars{"collection-wintools"} = 0; } - + other_options qw(R Q); my $answer=prompt 'Press key to select a scheme'; @@ -271,7 +271,7 @@ sub collection_menu { my $collection=$coll_short_desc[$index+$lines]; my $tlpobj=$tlpdb->get_package("$collection"); $keyval{$keys[$index+$lines]}="$collection"; - printf " %s %s %-32s\n", $keys[$index+$lines], + printf " %s %s %-32s\n", $keys[$index+$lines], button($vars{"$collection"}), substr($tlpobj->shortdesc,0,32); } else { print "\n"; @@ -293,7 +293,7 @@ sub collection_menu { my $answer=prompt 'Press key to select collections'; my @keystrokes=string_to_list $answer; - + foreach my $keystroke (@keystrokes) { if ($keystroke eq '-') { for my $collection (@collections) { @@ -350,7 +350,7 @@ sub language_menu { my $language=$languages[$index+$lines]; my $tlpobj = $tlpdb->get_package("$language"); $keyval{$lang_keys[$index+$lines]}="$language"; - printf " %s %s %-32s\n", $lang_keys[$index+$lines], + printf " %s %s %-32s\n", $lang_keys[$index+$lines], button($vars{"$language"}), substr($tlpobj->shortdesc,0,32); } else { print "\n"; @@ -371,7 +371,7 @@ sub language_menu { my $lang_doc=$lang_docs[$index+$lines]; my $tlpobj = $tlpdb->get_package("$lang_doc"); $keyval{$lang_doc_keys[$index+$lines]}="$lang_doc"; - printf " %s %s %-32s\n", $lang_doc_keys[$index+$lines], + printf " %s %s %-32s\n", $lang_doc_keys[$index+$lines], button($vars{"$lang_doc"}), substr($tlpobj->shortdesc,0,32); } else { print "\n"; @@ -382,7 +382,7 @@ sub language_menu { my $answer=prompt 'Press key to select language'; my @keystrokes=string_to_list $answer; - + foreach my $keystroke (@keystrokes) { if ($keystroke eq '-') { for my $collection (@languages,@lang_docs) { @@ -418,16 +418,29 @@ sub directories_menu { 'Q' => \&quit ); + my $maindir = $vars{'from_dvd'} ? 'TEXDIRW' : 'TEXDIR'; + menu_head "Current directories setup:"; - if (!TeXLive::TLUtils::texdir_check($vars{'TEXDIR'})) { + if (!TeXLive::TLUtils::texdir_check($vars{$maindir})) { print "!! The default location as given below can't be written to. -!! Either change the destination directory using <1> or create it +!! Either change the destination directory using <1> or create it !! outside this script. "; } + if ($vars{'from_dvd'}) { + print <<"EOF"; + <1> TEXDIRW: $vars{'TEXDIRW'} + (root for configuration- and generated data) +EOF +; + } else { + print <<"EOF"; + <1> TEXDIR: $vars{'TEXDIR'} + support tree: $vars{'TEXDIR'}/texmf +EOF +; + } print <<"EOF"; - <1> TEXDIR: $vars{'TEXDIR'} - support tree: $vars{'TEXDIR'}/texmf <2> TEXMFLOCAL: $vars{'TEXMFLOCAL'} <3> TEXMFSYSVAR: $vars{'TEXMFSYSVAR'} @@ -437,6 +450,7 @@ sub directories_menu { EOF ; + if (win32) { print " Note: ~ will expand to %USERPROFILE%\n"; } else { @@ -450,20 +464,22 @@ EOF $home = getenv('USERPROFILE') if (win32); $home ||= '~'; if ("\u$answer" eq '1') { - print "New value TEXDIR [$vars{'TEXDIR'}]: "; + print "New value $maindir [$vars{$maindir}]: "; chomp($answer=<STDIN>); - $vars{'TEXDIR'}="$answer" if (length $answer); - $vars{'TEXDIR'}=~s@\\@/@g if (win32); - $vars{'TEXDIR'} =~ s/^~/$home/; - if ($vars{'TEXDIR'}=~/^(.*)\/$texlive_release$/) { + $vars{$maindir}="$answer" if (length $answer); + $vars{$maindir}=~s@\\@/@g if (win32); + $vars{$maindir} =~ s/^~/$home/; + if ($vars{$maindir}=~/^(.*)\/$texlive_release$/) { $vars{'TEXMFLOCAL'}="$1/texmf-local"; $vars{'TEXMFSYSVAR'}="$1/$texlive_release/texmf-var"; $vars{'TEXMFSYSCONFIG'}="$1/$texlive_release/texmf-config"; + $vars{'TEXDIRW'} = $vars{'TEXDIR'} unless $vars{'from_dvd'}; return $command{'self'}; - } elsif ($vars{'TEXDIR'}=~/^(.*)$/) { + } elsif ($vars{$maindir}=~/^(.*)$/) { $vars{'TEXMFLOCAL'}="$1/texmf-local"; $vars{'TEXMFSYSVAR'}="$1/texmf-var"; $vars{'TEXMFSYSCONFIG'}="$1/texmf-config"; + $vars{'TEXDIRW'} = $vars{'TEXDIR'} unless $vars{'from_dvd'}; return $command{'self'}; } } @@ -540,12 +556,12 @@ sub html2text { s/&emdash;/--/gi; # emdash s/</</gi; s/>/>/gi; # < and > if (/<h1>(.*?)<\/h1>/i) { - push @text, " " x $h1_indent. "$1\n"; + push @text, " " x $h1_indent. "$1\n"; push @text, " " x $h1_indent. "=" x (length $1). "\n"; push @text, "\n"; } elsif (/<h2>(.*?)<\/h2>/i) { push @text, "\n"; - push @text, " " x $h2_indent. "$1\n"; + push @text, " " x $h2_indent. "$1\n"; push @text, " " x $h2_indent. "~" x (length $1). "\n"; push @text, "\n"; } elsif (/<h3>(.*?)<\/h3>/i) { @@ -582,7 +598,7 @@ sub help_menu { 'Q' => \&quit ); my $installer_help="$installerdir/tlpkg/installer/install-tl.html"; - + clear_screen; my @text=html2text "$installer_help"; @@ -597,8 +613,8 @@ sub help_menu { print "$_" if ($line>=$firstline and $line<=$lastline); ++$line; } - print "\n", hbar, - " <T> top <N> next page <P> previous page <R> return" + print "\n", hbar, + " <T> top <N> next page <P> previous page <R> return" . " --", $vars{'page'}+1, "--\n"; my $answer=prompt 'Enter command'; @@ -652,13 +668,13 @@ sub options_menu { <F> create all format files: $b_fmt EOF ; - if ($vars{'doc_splitting_supported'}) { + if ($vars{'doc_splitting_supported'} and !$vars{'from_dvd'}) { print " <D> install font/macro doc tree: $b_doc\n"; } - if ($vars{'src_splitting_supported'}) { + if ($vars{'src_splitting_supported'} and !$vars{'from_dvd'}) { print " <S> install font/macro source tree: $b_src\n"; } - if (unix) { + if (unix and !$vars{'from_dvd'}) { print <<"EOF"; <L> create symlinks in standard directories: $b_symlinks binaries to: $t_sys_bin @@ -671,7 +687,7 @@ EOF my $answer=prompt 'Enter command'; if (unix) { - if ("\u$answer" eq 'L') { + if (("\u$answer" eq 'L') and !$vars{'from_dvd'}) { my $home = getenv('HOME'); $home = getenv('USERPROFILE') if (win32); $home ||= '~'; @@ -691,7 +707,7 @@ EOF $vars{'sys_man'}="$answer" if (length $answer); $vars{'sys_man'} =~ s@\\@/@g if (win32); $vars{'sys_man'} =~ s/^~/$home/; - + print "New value for info directory [$vars{'sys_info'}]: "; chomp($answer=<STDIN>); $vars{'sys_info'}="$answer" if (length $answer); @@ -709,15 +725,11 @@ EOF toggle 'option_fmt'; return $command{'self'}; } - if ("\u$answer" eq 'S') { + if ("\u$answer" eq 'S' and !$vars{'from_dvd'}) { toggle 'option_src'; return $command{'self'}; } - if ("\u$answer" eq 'S') { - toggle 'option_src'; - return $command{'self'}; - } - if ("\u$answer" eq 'D') { + if ("\u$answer" eq 'D' and !$vars{'from_dvd'}) { toggle 'option_doc'; return $command{'self'}; } @@ -738,19 +750,33 @@ sub do_install { $RETURN = $MENU_INSTALL; } +sub to_hd { + $vars{'from_dvd'} = 0; + $vars{'TEXDIR'} = $vars{'TEXDIRW'}; + main_menu; +} + +sub from_dvd { + $vars{'from_dvd'} = 1; + $vars{'TEXDIR'} = abs_path($::installerdir); + main_menu; +} + sub main_menu { my $this_platform=platform_desc($vars{'this_platform'}); - my $b_symlinks=button($vars{'option_symlinks'}); - my $b_doc=button($vars{'option_doc'}); - my $b_src=button($vars{'option_src'}); - my $b_fmt=button($vars{'option_fmt'}); - my $b_letter=button($vars{'option_letter'}); + my $b_symlinks=button($vars{'option_symlinks'}); + my $b_doc=button($vars{'option_doc'}); + my $b_src=button($vars{'option_src'}); + my $b_fmt=button($vars{'option_fmt'}); + my $b_letter=button($vars{'option_letter'}); my $warn_nobin; $warn_nobin=set_install_platform; + my $maindir = $vars{'from_dvd'} ? 'TEXDIRW' : 'TEXDIR'; + $vars{'n_systems_selected'}=0; $vars{'n_collections_selected'}=0; foreach my $key (keys %vars) { @@ -767,26 +793,39 @@ sub main_menu { 'self' => \&main_menu, 'O' => \&options_menu, 'I' => \&do_install, - 'C' => \&collection_menu, 'H' => \&help_menu, - 'L' => \&language_menu, 'D' => \&directories_menu, - 'S' => \&scheme_menu, + 'T' => \&to_hd, + 'V' => \&from_dvd, 'Q' => \&quit ); - - if (unix) { - $command{'B'}=\&binary_menu; + if (!$vars{'from_dvd'}) { + $command{'S'}=\&scheme_menu; + $command{'C'}=\&collection_menu; + $command{'L'}=\&language_menu; + $command{'B'}=\&binary_menu if unix; } + clear_screen; - + print <<"EOF"; ======================> TeX Live installation procedure <===================== =======> Note: Letters/digits in <angle brackets> indicate menu items <======= =======> for commands or configurable options <======= +EOF +; + + if ($vars{'from_dvd'}) { + print " <T> Install to HD (current setting: install for running from DVD)\n\n"; + } else { + print " <V> Install for running from DVD (current setting: install to HD)\n\n"; + } + if (!$vars{'from_dvd'}) { + print <<"EOF"; + Detected platform: $this_platform $warn_nobin <B> binary systems: $vars{'n_systems_selected'} out of $vars{'n_systems_available'} @@ -802,10 +841,18 @@ sub main_menu { TEXDIR (the main TeX directory): EOF ; - if (TeXLive::TLUtils::texdir_check($vars{'TEXDIR'})) { - print " $vars{'TEXDIR'}\n"; + } else { # $vars{'from_dvd'} + print <<"EOF"; + <D> directories: + TEXDIRW (Writable root): +EOF +; + } + + if (TeXLive::TLUtils::texdir_check($vars{$maindir})) { + print " $vars{$maindir}\n"; } else { - print " !! default location: $vars{'TEXDIR'}\n"; + print " !! default location: $vars{$maindir}\n"; print " !! is not writable, please select a different one!\n"; } print <<"EOF"; @@ -819,19 +866,23 @@ EOF <O> options: EOF ; + print <<"EOF"; $b_letter use letter size instead of A4 by default $b_fmt create all format files EOF ; - if ($vars{'doc_splitting_supported'}) { - print " $b_doc install macro/font doc tree\n"; - } - if ($vars{'src_splitting_supported'}) { - print " $b_src install macro/font source tree\n"; + + if (!$vars{'from_dvd'}) { + if ($vars{'doc_splitting_supported'}) { + print " $b_doc install macro/font doc tree\n"; + } + if ($vars{'src_splitting_supported'}) { + print " $b_src install macro/font source tree\n"; + } } - print <<"EOF" if (unix); - $b_symlinks create symlinks in standard directories + print <<"EOF" if (unix and !$vars{'from_dvd'}); + $b_symlinks create symlinks in standard directories EOF ; |