diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-04-14 14:09:46 -0400 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2013-04-14 14:09:46 -0400 |
| commit | 92af49d8103d0bb7a6101479c0a49c1a392f3d57 (patch) | |
| tree | 067b7fc21b82a9025c4533f898e0ffe8d9ca2953 | |
| parent | b3cb0fd835ab675397b18391f025004ac49da494 (diff) | |
| parent | a2447f3edcbd8d9d2226634c4dc0e04eea3fa643 (diff) | |
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
| -rw-r--r-- | MediaBrowser.Installer/MainWindow.xaml.cs | 26 |
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)); } } } |
