diff options
-rw-r--r-- | Master/tlpkg/TeXLive/TLWinGoo.pm | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/Master/tlpkg/TeXLive/TLWinGoo.pm b/Master/tlpkg/TeXLive/TLWinGoo.pm index a5d4e5d9e6a..2f319de1645 100644 --- a/Master/tlpkg/TeXLive/TLWinGoo.pm +++ b/Master/tlpkg/TeXLive/TLWinGoo.pm @@ -36,6 +36,7 @@ C<TeXLive::TLWinGoo> -- Additional utilities for Windows TeXLive::TLWinGoo::global_tmpdir; TeXLive::TLWinGoo::get_system_path; TeXLive::TLWinGoo::get_user_path; + TeXLive::TLWinGoo::win_which_dir($prog); TeXLive::TLWinGoo::setenv_reg($env_var, $env_data); TeXLive::TLWinGoo::unsetenv_reg($env_var); TeXLive::TLWinGoo::add_texbindir_to_path($texpath); @@ -230,9 +231,14 @@ Two-letter country code representing the locale of the current user sub reg_country { my $value = $Registry -> {"CUser/Control Panel/International//Locale"}; + return 0 unless $value; $value = substr $value, -4; - my $lm = $Registry -> Open("HKEY_CLASSES_ROOT/MIME/Database/Rfc1766/", - {Access => KEY_READ()})->{"/$value"}; + return 0 unless $value; + my $lmkey = $Registry -> Open("HKEY_CLASSES_ROOT/MIME/Database/Rfc1766/", + {Access => KEY_READ()}); + return 0 unless $lmkey; + $lm = $lmkey->{"/$value"}; + return 0 unless $lm; debug("found lang codes value = $value, lm = $lm...\n"); if ($lm) { return(substr $lm, 0, 2); @@ -309,9 +315,9 @@ sub is_a_texdir { $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)); + return (((-e $d.'mktexlsr.exe') or (-e $d.'dvips.exe')) and + ((-e $d.'tex.exe') or (-e $d.'pdftex.exe') or (-e $d.'xetex.exe') + or (-e $d.'luatex.exe'))); } =pod @@ -350,16 +356,16 @@ sub get_user_path { return $value; } -#=pod -# -#=item C<win_which_dir> -# -#More or less the same as which, except that 1. it returns a -#directory, 2. it consults the path stored in the registry rather -#than the path of the current process, and 3. it assumes that the -#filename includes an extension. Currently only used for testing. -# -#=cut +=pod + +=item C<win_which_dir> + +More or less the same as which, except that 1. it returns a +directory, 2. it consults the path stored in the registry rather +than the path of the current process, and 3. it assumes that the +filename includes an extension. Currently only used for testing. + +=cut sub win_which_dir { my $prog = shift; |