summaryrefslogtreecommitdiff
path: root/Master/tlpkg/TeXLive/TLWinGoo.pm
diff options
context:
space:
mode:
authorNorbert Preining <preining@logic.at>2009-12-06 14:58:12 +0000
committerNorbert Preining <preining@logic.at>2009-12-06 14:58:12 +0000
commit8bac4a38133ca70565054a29940fbec0ec03fe29 (patch)
tree9fdd54cca3c5df92261a49e2ddc2b8bc4381f5a6 /Master/tlpkg/TeXLive/TLWinGoo.pm
parent612a81760b3dba29edcd39f97b13563eb3d235da (diff)
check for file type association in admin tree if installing as user
and in the user tree is no association git-svn-id: svn://tug.org/texlive/trunk@16316 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/tlpkg/TeXLive/TLWinGoo.pm')
-rw-r--r--Master/tlpkg/TeXLive/TLWinGoo.pm22
1 files changed, 20 insertions, 2 deletions
diff --git a/Master/tlpkg/TeXLive/TLWinGoo.pm b/Master/tlpkg/TeXLive/TLWinGoo.pm
index 52a0233a39a..35e933780e4 100644
--- a/Master/tlpkg/TeXLive/TLWinGoo.pm
+++ b/Master/tlpkg/TeXLive/TLWinGoo.pm
@@ -593,17 +593,24 @@ sub register_extension {
my $file_type = shift;
debug("Linking $extension to $file_type\n");
my ($classes_key_path, $classes_key, $k);
+ my ($admin_classes_key_path, $admin_classes_key);
$extension = lc($extension);
if ($is_admin) {
$classes_key_path = "LMachine/Software/Classes/";
} else {
$classes_key_path = "CUser/Software/Classes/";
+ $admin_classes_key_path = "LMachine/Software/Classes/";
}
$classes_key = $Registry -> Open($classes_key_path,
{Access => KEY_ALL_ACCESS()});
+ if (!$is_admin) {
+ $admin_classes_key = $Registry -> Open($admin_classes_key_path,
+ {Access => KEY_READ()});
+ }
+
if (!defined($classes_key)) {
tlwarn("Cannot get key to $classes_key\n" .
"Cannot continue setting up associations.\n");
@@ -627,8 +634,19 @@ sub register_extension {
}
}
} else {
- debug("register_extension: old key $extension not found, recreating it\n");
- $do_create_key = 1;
+ if (!$is_admin) {
+ # if we are not admin, we check whether the key is associated
+ # in the admin keys, and if yes, do NOT associate it again
+ if (defined($admin_classes_key->{$extension})) {
+ debug("register_extension: old key $extension found in admins keys, not changing it\n");
+ } else {
+ $do_create_key = 1;
+ }
+ } else {
+ $do_create_key = 1;
+ }
+ debug("register_extension: old key $extension not found, recreating it\n")
+ if $do_create_key;
}
} elsif ($mode == 2) {
$do_create_key = 1;