diff options
-rw-r--r-- | Master/tlpkg/TeXLive/TLWinGoo.pm | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/Master/tlpkg/TeXLive/TLWinGoo.pm b/Master/tlpkg/TeXLive/TLWinGoo.pm index d41cb4b10bb..e0c9f623cba 100644 --- a/Master/tlpkg/TeXLive/TLWinGoo.pm +++ b/Master/tlpkg/TeXLive/TLWinGoo.pm @@ -841,11 +841,13 @@ sub add_desktop_shortcut { $shc->Save($shfile); # update batchfile for uninstalling shortcuts - open UNSHORT, ">>$texdir/tlpkg/installer/unshort.bat" || - die "Cannot open $texdir/tlpkg/installer/unshort.bat for appending: $!"; - $shfile =~ s!/!\\!g; - print UNSHORT 'del "'.$shfile."\" 2>nul\n"; - close UNSHORT; + if (open UNSHORT, ">>$texdir/tlpkg/installer/unshort.bat") { + $shfile =~ s!/!\\!g; + print UNSHORT 'del "'.$shfile."\" 2>nul\n"; + close UNSHORT; + } else { + warn "Cannot open $texdir/tlpkg/installer/unshort.bat for appending: $!"; + } } =cut @@ -899,10 +901,12 @@ sub init_unshortbat { $menupath =~ s!/!\\!g; # batchfile for uninstalling shortcuts - open UNSHORT, ">$texdirw/tlpkg/installer/unshort.bat" || - die "Cannot create $texdirw/tlpkg/installer/unshort.bat: $!"; - print UNSHORT 'rmdir /s /q "'.$menupath."\\TeX Live 2008\" 2>nul\n"; - close UNSHORT; + if (open UNSHORT, ">$texdirw/tlpkg/installer/unshort.bat") { + print UNSHORT 'rmdir /s /q "'.$menupath."\\TeX Live 2008\" 2>nul\n"; + close UNSHORT; + } else { + warn "Cannot create $texdirw/tlpkg/installer/unshort.bat: $!"; + } } =cut @@ -980,8 +984,8 @@ sub create_uninstaller { $k->{'/URLInfoAbout'} = "http://www.tug.org/texlive"; mkdirhier("$tdwfw/tlpkg/installer"); # wasn't this done yet? - open UNINST, ">$tdwfw/tlpkg/installer/uninst.bat"; - print UNINST <<UNEND; + if (open UNINST, ">$tdwfw/tlpkg/installer/uninst.bat") { + print UNINST <<UNEND; \@echo off rem This should not be necessary, but sometimes it is: path $td\\bin\\win32;%path% @@ -994,9 +998,12 @@ rem pause UNEND ; close UNINST; + } else { + warn "Cannot open uninstaller for append"; + } - open UNINST2, ">$tdwfw/tlpkg/installer/uninst2.bat"; - print UNINST2 <<UNEND2 if $td eq $tdw; + if (open UNINST2, ">$tdwfw/tlpkg/installer/uninst2.bat") { + print UNINST2 <<UNEND2 if $td eq $tdw; rmdir /s /q \"$td\\texmf-dist\" rmdir /s /q \"$td\\texmf-doc\" rmdir /s /q \"$td\\texmf\" @@ -1008,7 +1015,7 @@ del /s /q \"$tl\\LICENSE.*\" del /q \"$tl\\index.html\" UNEND2 ; - print UNINST2 <<UNEND2; + print UNINST2 <<UNEND2; rmdir /s /q \"$tdsv\" rmdir /s /q \"$tdsc\" rmdir /s /q \"$tdw\\temp\" @@ -1023,7 +1030,10 @@ rem \@pause del %0 UNEND2 ; - close UNINST2; + close UNINST2; + } else { + warn "Cannot open unist2.bat for writing"; + } } =pod |