aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Reed <ebr@mediabrowser3.com>2013-04-14 11:41:27 -0400
committerEric Reed <ebr@mediabrowser3.com>2013-04-14 11:41:27 -0400
commit078e813d253d986f3290c198c39a1efb7a0cfbd3 (patch)
tree26298cb39e16791e332b67b5ed73882bd9b14dfe
parentb2f47735cc84f4b9a5fcd555dd1308ec61d36c01 (diff)
Better error messages on extract failures
-rw-r--r--MediaBrowser.Installer/MainWindow.xaml.cs26
1 files changed, 21 insertions, 5 deletions
diff --git a/MediaBrowser.Installer/MainWindow.xaml.cs b/MediaBrowser.Installer/MainWindow.xaml.cs
index a3becf631..16cde9592 100644
--- a/MediaBrowser.Installer/MainWindow.xaml.cs
+++ b/MediaBrowser.Installer/MainWindow.xaml.cs
@@ -449,8 +449,24 @@ namespace MediaBrowser.Installer
var backupDir = Path.Combine(RootPath, "System.old");
if (Directory.Exists(systemDir))
{
- if (Directory.Exists(backupDir)) Directory.Delete(backupDir,true);
- Directory.Move(systemDir, backupDir);
+ try
+ {
+ if (Directory.Exists(backupDir)) Directory.Delete(backupDir,true);
+
+ }
+ catch (Exception e)
+ {
+ throw new ApplicationException("Could not delete previous backup directory.\n\n"+e.Message);
+ }
+
+ try
+ {
+ Directory.Move(systemDir, backupDir);
+ }
+ catch (Exception e)
+ {
+ throw new ApplicationException("Could not move system directory to backup.\n\n"+e.Message);
+ }
}
// And extract
@@ -469,7 +485,7 @@ namespace MediaBrowser.Installer
}
}
}
- catch
+ catch (Exception e)
{
if (retryCount < 3)
{
@@ -480,8 +496,8 @@ namespace MediaBrowser.Installer
{
//Rollback
RollBack(systemDir, backupDir);
- File.Delete(archive); // so we don't try again if its an update
- throw;
+ TryDelete(archive); // so we don't try again if its an update
+ throw new ApplicationException(string.Format("Could not extract {0} to {1} after {2} attempts.\n\n{3}", archive, RootPath, retryCount, e.Message));
}
}
}