From 4f4dbabf8b18a1fab35412cd20eb9bdfabbfa66d Mon Sep 17 00:00:00 2001 From: Gary Sharp Date: Tue, 26 Nov 2013 17:30:05 +1100 Subject: [PATCH] Bug Fix: Bootstrapper crash if previously failed Updated bootstrapper correctly cleans up temporary files left by a previous run which failed. --- Disco.ClientBootstrapper/BootstrapperLoop.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Disco.ClientBootstrapper/BootstrapperLoop.cs b/Disco.ClientBootstrapper/BootstrapperLoop.cs index 3dec66fa..beba5a08 100644 --- a/Disco.ClientBootstrapper/BootstrapperLoop.cs +++ b/Disco.ClientBootstrapper/BootstrapperLoop.cs @@ -149,8 +149,10 @@ namespace Disco.ClientBootstrapper // Unzip Client statusUI.UpdateStatus(null, "Extracting", "Retrieving Preparation Client, Please wait...", true, -1); string clientLocation = Path.Combine(tempWorkingDirectory, "PreparationClient"); - if (!Directory.Exists(clientLocation)) - Directory.CreateDirectory(clientLocation); + if (Directory.Exists(clientLocation)) + Directory.Delete(clientLocation, true); + + Directory.CreateDirectory(clientLocation); using (var clientSource = Ionic.Zip.ZipFile.Read(clientSourceLocation)) { clientSource.ExtractAll(clientLocation, Ionic.Zip.ExtractExistingFileAction.OverwriteSilently);