diff options
Diffstat (limited to 'Master/tlpkg/TeXLive/TLWinGoo.pm')
-rw-r--r-- | Master/tlpkg/TeXLive/TLWinGoo.pm | 12 |
1 files changed, 8 insertions, 4 deletions
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); } |