summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive/TLWinGoo.pm
diff options
context:
space:
mode:
authorSiep Kroonenberg <siepo@cybercomm.nl>2008-08-08 11:08:04 +0000
committerSiep Kroonenberg <siepo@cybercomm.nl>2008-08-08 11:08:04 +0000
commit01c17ff1b2c0d091315fcf4277698d808168b4bc (patch)
tree09bae02e6818895f38f21a4bec501df2ff2ec70d /Master/tlpkg/TeXLive/TLWinGoo.pm
parent7cd0b34db831e6cc32466943e9d302923e1b2bf7 (diff)
More error checking in reg_country; stricter is_a_texdir test
git-svn-id: svn://tug.org/texlive/trunk@10171 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive/TLWinGoo.pm')
-rw-r--r--Master/tlpkg/TeXLive/TLWinGoo.pm36
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;