diff options
author | Siep Kroonenberg <siepo@cybercomm.nl> | 2008-06-19 19:52:40 +0000 |
---|---|---|
committer | Siep Kroonenberg <siepo@cybercomm.nl> | 2008-06-19 19:52:40 +0000 |
commit | a29d1c3b81e693ba943ca1ccedfca84d69edd770 (patch) | |
tree | ff72717ebf42eb1865e8de55e0494c9f6e3ab591 | |
parent | d6d706cf043a51dee01517b4c5275a7f227fd0ba (diff) |
TLWingoo: removed wg_error; never remove system directories from
path whatever TeX programs they may contain
git-svn-id: svn://tug.org/texlive/trunk@8879 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-x | Master/install-tl | 3 | ||||
-rw-r--r-- | Master/tlpkg/TeXLive/TLPostActions.pm | 6 | ||||
-rw-r--r-- | Master/tlpkg/TeXLive/TLWinGoo.pm | 56 |
3 files changed, 18 insertions, 47 deletions
diff --git a/Master/install-tl b/Master/install-tl index e9e0c0de346..4b73954df5e 100755 --- a/Master/install-tl +++ b/Master/install-tl @@ -58,7 +58,6 @@ use Cwd 'abs_path'; if (win32) { require TeXLive::TLWinGoo; TeXLive::TLWinGoo->import( qw( - &wg_error &win_version &is_vista &admin @@ -1265,7 +1264,7 @@ to install TeX Live from various media including the network. The TeX Live root directory contains a shell script C<tl-portable.sh> and a DOS batch file C<tl-portable.bat> which start up a new shell and command prompt in which TeX Live can be run with minimal impact on the -host system. These files start up C<install-tl.pl> with the +host system. These files start up C<install-tl> with the C<-portable> option for some minimal preparation. Don't use this option directly; it makes very specific assumptions about its environment. diff --git a/Master/tlpkg/TeXLive/TLPostActions.pm b/Master/tlpkg/TeXLive/TLPostActions.pm index 7a44830464b..3b3d1e9b0ea 100644 --- a/Master/tlpkg/TeXLive/TLPostActions.pm +++ b/Master/tlpkg/TeXLive/TLPostActions.pm @@ -183,7 +183,11 @@ sub do_install_bin_texlive { 'batgui', ); if (uc(TeXLive::TLWinGoo::win_which_dir('tex.exe')) ne - uc($texdir.'/bin/win32')) { + uc($texdir.'/bin/win32') or + uc(TeXLive::TLWinGoo::win_which_dir('pdftex.exe')) ne + uc($texdir.'/bin/win32') or + uc(TeXLive::TLWinGoo::win_which_dir('luatex.exe')) ne + uc($texdir.'/bin/win32')) { my $texbindir = $texdir."\\bin\\win32"; $texbindir =~ s!/!\\!g; add_menu_shortcut( diff --git a/Master/tlpkg/TeXLive/TLWinGoo.pm b/Master/tlpkg/TeXLive/TLWinGoo.pm index 24e5ead4b96..593241f0d35 100644 --- a/Master/tlpkg/TeXLive/TLWinGoo.pm +++ b/Master/tlpkg/TeXLive/TLWinGoo.pm @@ -22,10 +22,6 @@ C<TeXLive::TLWinGoo> -- Additional utilities for Windows use TeXLive::TLWinGoo; -=head2 ERROR HANDLING - - TeXLive::TLWinGoo::wg_error; - =head2 DIAGNOSTICS TeXLive::TLWinGoo::win_version; @@ -82,7 +78,6 @@ BEGIN { use vars qw( @ISA @EXPORT $Registry); @ISA = qw( Exporter ); @EXPORT = qw( - &wg_error &win_version &is_vista &admin @@ -141,31 +136,6 @@ my $is_win = $^O=~/^MSWin(32|64)$/i; =back -=head2 ERROR HANDLING - -=over 6 - -=item C<wg_error> - -Returns WinGoo error status, in the shape of an array (number, -message) and clears the error status. No error <=> error number 0 - -=cut - -my $wg_error = 0; -my $wg_error_message = ""; - -sub wg_error { - my @retval = ($wg_error, $wg_error_message); - $wg_error = 0; - $wg_error_message = ""; - return @retval; -} - -=pod - -=back - =head2 DIAGNOSTICS =over 6 @@ -332,11 +302,15 @@ sub global_tmpdir { return $global_tmp; } sub is_a_texdir { my $d = shift; - #my $xd = expand_string($d); $d =~ s/\\/\//g; - $d =~ s/\/$//; - my $d1 = $d . '/pdftex.exe'; - my $d2 = $d . '/tex.exe'; + $d = $d . '/' unless $d =~ m!/$!; + # don't consider anything under %systemroot% a texdir + my $sr = uc(expand_string($ENV{'SystemRoot'})); + $sr =~ s/\\/\//g; + $sr = $sr . '/' unless $sr =~ m!/$!; + return 0 if index($d, $sr)==0; + my $d1 = $d . 'pdftex.exe'; + my $d2 = $d . 'tex.exe'; return ((-e $d1) or (-e $d2)); } @@ -462,14 +436,13 @@ sub unsetenv_reg { Remove wrong TeX directories from system path (if possible) and user path. A directory is a TeX directory if it contains tex.exe or -pdftex.exe. Then if necessary add desired TeX directory; to system path if -admin, otherwise to user path. wg_error gets set if there is a -connflicting tex directory which cannot be removed from the path. +pdftex.exe and if it is not under %systemroot%. Then if necessary +add desired TeX directory; to system path if admin, otherwise to +user path. =cut sub add_texbindir_to_path { - $wg_error = 0; # clear error status my $texbindir = shift; my $system_env = get_system_env(); @@ -510,10 +483,7 @@ sub add_texbindir_to_path { if (uc($d_exp) eq uc($texbindir)) { $found = 1; } elsif (is_a_texdir($d_exp)) { - $wg_error = 1; - $wg_error_message = - "Warning: possibly conflicting [pdf]TeX program found at $d_exp\n"; - debug($wg_error_message); + debug("Warning: possibly conflicting [pdf]TeX program found at $d_exp\n"); } } } @@ -555,7 +525,6 @@ system path. =cut sub remove_texbindirs_from_path { - $wg_error = 0; # clear error status my $system_env = get_system_env(); my $user_env = get_user_env(); @@ -773,7 +742,6 @@ sub broadcast_env() { use constant WM_SETTINGCHANGE => 0x001A; my $result = ""; my $SendMessage; - $wg_error = 0; debug("Broadcasting \"Enviroment settings changed\" message...\n"); $SendMessage = new Win32::API('user32', 'SendMessage', 'LLPP', 'L'); $result = $SendMessage->Call(HWND_BROADCAST, WM_SETTINGCHANGE, |