aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2013-04-10 17:03:48 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2013-04-10 17:03:48 -0400
commitc11a61e133c8172f823f24ccd2b6b7749364c866 (patch)
tree0b258939cbc9c8d8b3b673b0a9b2517cbd706ecc
parentbd07e2f063aa92008be389c5475afdb84859b062 (diff)
parent413fbca37eb56169f534af913506d799dbbe77dc (diff)
Merge branch 'master' of https://github.com/MediaBrowser/MediaBrowser
-rw-r--r--MediaBrowser.Installer/MainWindow.xaml.cs18
1 files changed, 8 insertions, 10 deletions
diff --git a/MediaBrowser.Installer/MainWindow.xaml.cs b/MediaBrowser.Installer/MainWindow.xaml.cs
index 0a30cc6a2..bb2612523 100644
--- a/MediaBrowser.Installer/MainWindow.xaml.cs
+++ b/MediaBrowser.Installer/MainWindow.xaml.cs
@@ -241,7 +241,6 @@ namespace MediaBrowser.Installer
}
catch (Exception e)
{
-
SystemClose("Error Removing Archive - " + e.GetType().FullName + "\n\n" + e.Message);
return;
}
@@ -399,17 +398,12 @@ namespace MediaBrowser.Installer
protected void ExtractPackage(string archive)
{
// Delete old content of system
- var systemDir = Path.Combine(RootPath, "system");
+ var systemDir = Path.Combine(RootPath, "System");
+ var backupDir = Path.Combine(RootPath, "System.old");
if (Directory.Exists(systemDir))
{
- try
- {
- Directory.Delete(systemDir, true);
- }
- catch
- {
- // we tried...
- }
+ if (Directory.Exists(backupDir)) Directory.Delete(backupDir,true);
+ Directory.Move(systemDir, backupDir);
}
// And extract
@@ -437,6 +431,10 @@ namespace MediaBrowser.Installer
}
else
{
+ //Rollback
+ if (Directory.Exists(systemDir)) Directory.Delete(systemDir);
+ Directory.Move(backupDir, systemDir);
+ File.Delete(archive); // so we don't try again if its an update
throw;
}
}