From 8bac4a38133ca70565054a29940fbec0ec03fe29 Mon Sep 17 00:00:00 2001 From: Norbert Preining Date: Sun, 6 Dec 2009 14:58:12 +0000 Subject: 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 --- Master/tlpkg/TeXLive/TLWinGoo.pm | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'Master/tlpkg/TeXLive') 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; -- cgit v1.2.3