From 2392ed0b12abd476b55ca01e30ce3d5062b51740 Mon Sep 17 00:00:00 2001 From: Siep Kroonenberg Date: Fri, 6 May 2011 20:27:58 +0000 Subject: Postaction appreg git-svn-id: svn://tug.org/texlive/trunk@22331 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/TeXLive/TLWinGoo.pm | 63 ++++++++++++++++++---------------------- 1 file changed, 28 insertions(+), 35 deletions(-) (limited to 'Master/tlpkg/TeXLive/TLWinGoo.pm') 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 -- 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 = ; - 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 +=item C 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 <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; -- cgit v1.2.3