From 401fe9844b2aff01b81c4ec55ed15ebeda701f1b Mon Sep 17 00:00:00 2001 From: Siep Kroonenberg Date: Wed, 26 Apr 2017 14:08:46 +0000 Subject: Windows only new filetypes: take other read failures into account, Take 2 git-svn-id: svn://tug.org/texlive/trunk@44059 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/TeXLive/TLWinGoo.pm | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'Master/tlpkg') diff --git a/Master/tlpkg/TeXLive/TLWinGoo.pm b/Master/tlpkg/TeXLive/TLWinGoo.pm index 53946538912..e83f8ae2f85 100644 --- a/Master/tlpkg/TeXLive/TLWinGoo.pm +++ b/Master/tlpkg/TeXLive/TLWinGoo.pm @@ -913,7 +913,7 @@ sub register_extension { my $regkey; my $old_file_type = current_filetype($extension); - if ($old_file_type) { + if ($old_file_type and $old_file_type ne $reg_unknown) { if ($is_admin) { if (not lm_root()->{"Software/Classes/$old_file_type/"}) { $old_file_type = ""; @@ -927,16 +927,20 @@ sub register_extension { } # admin: whether to remove HKCU entry. admin never _writes_ to HKCU my $remove_cu = ($mode == 2) && admin(); + # can do the following safely: debug ("Adding $file_type to OpenWithProgIds of $extension\n"); add_to_progids ($extension, $file_type); + if ($old_file_type and $old_file_type ne $file_type) { if ($mode == 1) { debug ("Not overwriting $old_file_type with $file_type for $extension\n"); - } else { + } else { # $mode ==2, overwrite debug("Linking $extension to $file_type\n"); - debug ("Moving $old_file_type to OpenWithProgIds\n"); - add_to_progids ($extension, $old_file_type); + if ($old_file_type ne $reg_unknown) { + debug ("Moving $old_file_type to OpenWithProgIds\n"); + add_to_progids ($extension, $old_file_type); + } $regkey = {'/' => $file_type}; do_write_regkey("Software/Classes/$extension/", $regkey, $remove_cu); } -- cgit v1.2.3