aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2013-04-14 11:14:23 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2013-04-14 11:14:23 -0400
commit81d38ba3975e513c3aa00b1186ec43da49947f28 (patch)
treeff6505fb2456b4c8a8ca5f5db62cd400cebc2db6
parent07d8649f975db04a166cb29ead04e89a38063639 (diff)
parentb2f47735cc84f4b9a5fcd555dd1308ec61d36c01 (diff)
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
-rw-r--r--MediaBrowser.Installer/MainWindow.xaml.cs32
1 files changed, 20 insertions, 12 deletions
diff --git a/MediaBrowser.Installer/MainWindow.xaml.cs b/MediaBrowser.Installer/MainWindow.xaml.cs
index ee87e9bf2..a3becf631 100644
--- a/MediaBrowser.Installer/MainWindow.xaml.cs
+++ b/MediaBrowser.Installer/MainWindow.xaml.cs
@@ -269,22 +269,13 @@ namespace MediaBrowser.Installer
{
ExtractPackage(archive);
// We're done with it so delete it (this is necessary for update operations)
- try
- {
- File.Delete(archive);
- }
- catch (FileNotFoundException)
- {
- }
- catch (Exception e)
- {
- SystemClose("Error Removing Archive - " + e.GetType().FullName + "\n\n" + e.Message);
- return;
- }
+ TryDelete(archive);
}
catch (Exception e)
{
SystemClose("Error Extracting - " + e.GetType().FullName + "\n\n" + e.Message);
+ // Delete archive even if failed so we don't try again with this one
+ TryDelete(archive);
return;
}
@@ -337,6 +328,23 @@ namespace MediaBrowser.Installer
}
+ private bool TryDelete(string file)
+ {
+ try
+ {
+ File.Delete(file);
+ }
+ catch (FileNotFoundException)
+ {
+ }
+ catch (Exception e)
+ {
+ return false;
+ }
+
+ return true;
+ }
+
private void PismoInstall()
{
// Kick off the Pismo installer and wait for it to end