From e9c518ce04efe33a05059645ced3fa4942fa8068 Mon Sep 17 00:00:00 2001 From: Siep Kroonenberg Date: Fri, 1 Aug 2008 19:25:30 +0000 Subject: TLWinGoo: warn, don't die if file cannot be opened git-svn-id: svn://tug.org/texlive/trunk@9989 c570f23f-e606-0410-a88d-b1316a301751 --- Master/tlpkg/TeXLive/TLWinGoo.pm | 40 +++++++++++++++++++++++++--------------- 1 file changed, 25 insertions(+), 15 deletions(-) (limited to 'Master/tlpkg/TeXLive/TLWinGoo.pm') 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 <$tdwfw/tlpkg/installer/uninst.bat") { + print UNINST <$tdwfw/tlpkg/installer/uninst2.bat"; - print UNINST2 <$tdwfw/tlpkg/installer/uninst2.bat") { + print UNINST2 <