diff options
Diffstat (limited to 'Master/tlpkg/TeXLive/TLWinGoo.pm')
-rw-r--r-- | Master/tlpkg/TeXLive/TLWinGoo.pm | 63 |
1 files changed, 28 insertions, 35 deletions
diff --git a/Master/tlpkg/TeXLive/TLWinGoo.pm b/Master/tlpkg/TeXLive/TLWinGoo.pm index 26fdaf42d56..8a4cc591f96 100644 --- a/Master/tlpkg/TeXLive/TLWinGoo.pm +++ b/Master/tlpkg/TeXLive/TLWinGoo.pm @@ -53,7 +53,7 @@ C<TeXLive::TLWinGoo> -- Additional utilities for Windows TeXLive::TLWinGoo::unregister_extension($mode, $extension); TeXLive::TLWinGoo::register_file_type($file_type, $command); TeXLive::TLWinGoo::unregister_file_type($file_type); - TeXLive::TLWinGoo::register_application($prog, $path, $exts); + TeXLive::TLWinGoo::register_application($prog, $cmd, $exts); TeXLive::TLWinGoo::unregister_application($prog); TeXLive::TLWinGoo::add_to_openwithlist($ext, $prog); TeXLive::TLWinGoo::remove_from_openwithlist($ext, $prog); @@ -559,9 +559,9 @@ sub adjust_reg_path_for_texlive { sub getans { my $prompt = shift; my $ans; - print STDERR "$prompt\n"; + print STDERR "$prompt "; $ans = <STDIN>; - if ($ans =~ /^y/i) {return 1;} + if ($ans =~ /^y/i) {print STDERR "\n"; return 1;} die "Aborting as requested"; } @@ -736,8 +736,8 @@ sub do_remove_regkey { } if (!$parentkey) { $do_remove = 0; - tlwarn "Unable to open $roothive/$parentpath for writing\n"; - return 0; + debug "$hivename/$parentpath not present or not writable so not removed\n"; + return 1; } if ($mode == 1) { $k = $parentkey->{$keyname}; @@ -759,7 +759,7 @@ sub do_remove_regkey { #getans("Deleting $parentpath$keyname regkey? "); reg_delete_recurse($parentkey, $keyname); if ($parentkey->{$keyname}) { - tlwarn "Failure to delete $roothive/$keypath\n"; + tlwarn "Failure to delete $hivename/$keypath\n"; return 0; } if ($is_admin and $cu_key->{$parentpath}) { @@ -862,7 +862,7 @@ sub unregister_file_type { =pod -=item C<register_application($prog, $path, $exts)> +=item C<register_application($prog, $cmd, $exts)> Add registry entry to set full path of $prog to $path and optionally specify which extensions it handles @@ -870,14 +870,14 @@ specify which extensions it handles =cut sub register_application { - my $prog = shift; # redundant, but more natural than just $path - my $path = shift; + my $prog = shift; + my $cmd = shift; my $exts = shift; my $hsh; foreach my $e (@$exts) {$hsh->{"/$e"} = "";} #my $prog = TeXLive::TLUtils::basename($path); - $cmd = "\"$path\" \"%1\""; + # $cmd = "\"$path\" \"%1\""; # done by caller $cmd =~ s!/!\\!g; my $keyhash = { "shell/" => { @@ -902,7 +902,7 @@ Reversal of register_application sub unregister_application { my $prog = shift; - do_remove_regkey(2, "Software/Classes/Applications/$prog/"); + do_remove_regkey(2, "Software/Classes/Applications/$prog"); } =pod @@ -1204,41 +1204,34 @@ UNEND warn "Cannot open $tdfw/tlpkg/installer/uninst.bat for append"; } + # We could simply delete everything under the root at one go, + # but this might be catastrophic if TL doesn't have its own root. if (open UNINST2, ">$tdfw/tlpkg/installer/uninst2.bat") { print UNINST2 <<UNEND2; -rmdir /s /q \"$td\\texmf-dist\" -rmdir /s /q \"$td\\texmf-doc\" -rmdir /s /q \"$td\\texmf\" +rmdir /s /q \"$td\\bin\" rmdir /s /q \"$td\\readme-html.dir\" rmdir /s /q \"$td\\readme-txt.dir\" -rmdir /s /q \"$td\\bin\" +rem rmdir /s /q \"$td\\temp\" +rmdir /s /q \"$td\\texmf\" +rmdir /s /q \"$td\\texmf-dist\" rmdir /s /q \"$td\\tlpkg\" +rmdir /s /q \"$tdsc\" +rmdir /s /q \"$tdsv\" del /q \"$td\\README.*\" del /q \"$td\\LICENSE.*\" -del /q \"$td\\doc.html\" -del \"$td\\index.html\" -del \"$td\\texmf.cnf\" -del \"$td\\install-tl\" -del \"$td\\tl-portable\" -del \"$td\\tl-portable.bat\" -del \"$td\\install-tl.bat\" -del \"$td\\install-tl-advanced.bat\" -UNEND2 -; - print UNINST2 <<UNEND2; -rmdir /s /q \"$tdsv\" -rmdir /s /q \"$tdsc\" -rmdir /s /q \"$td\\temp\" -rmdir /s /q \"$td\\tlpkg\" -del \"$td\\install-tl.log\" -del \"$td\\texlive.profile\" 2>nul -del \"$td\\release-texlive.txt\" +rem del /q \"$td\\doc.html\" +del /q \"$td\\index.html\" +del /q \"$td\\texmf.cnf\" +del /q \"$td\\install-tl*.*\" +del /q \"$td\\tl-portable.*\" +rem del /q \"$td\\texlive.profile\" +del /q \"$td\\release-texlive.txt\" set test= for \%\%f in (\"$td\\*.*\") do \@set test=nonempty if x\%test\%==x rd \"$td\" \@echo Done uninstalling TeXLive. -rem \@pause -del %0 +\@pause +del \"%0\" UNEND2 ; close UNINST2; |