aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs')
-rw-r--r--Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs25
1 files changed, 14 insertions, 11 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs
index 57c3c9f34..2d6ffeb04 100644
--- a/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs
+++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs
@@ -310,7 +310,7 @@ namespace Tango.PPC.Common.MachineUpdate
_isUpdating = false;
}
- private async void OnCompleted(MachineUpdateResult result, TaskCompletionSource<MachineUpdateResult> completionSource, DownloadUpdateResponse response, String tempDbName, String backupsFolder, Core.DataSource localDataSource, PublishInfo tupPublishInfo = null)
+ private async void OnCompleted(MachineUpdateResult result, TaskCompletionSource<MachineUpdateResult> completionSource, DownloadUpdateResponse response, String tempDbName, String backupsFolder, Core.DataSource localDataSource, PublishInfo tupPublishInfo = null, bool deleteBackupsFolder = false)
{
await Task.Factory.StartNew(() =>
{
@@ -332,14 +332,17 @@ namespace Tango.PPC.Common.MachineUpdate
}
}
- //try
- //{
- // Directory.Delete(backupsFolder, true);
- //}
- //catch (Exception ex)
- //{
- // LogManager.Log(ex, $"Error deleting backups folder '{backupsFolder}'.");
- //}
+ if (deleteBackupsFolder)
+ {
+ try
+ {
+ Directory.Delete(backupsFolder, true);
+ }
+ catch (Exception ex)
+ {
+ LogManager.Log(ex, $"Error deleting backups folder '{backupsFolder}'.");
+ }
+ }
if (!result.RequiresBinariesUpdate)
{
@@ -1469,7 +1472,7 @@ namespace Tango.PPC.Common.MachineUpdate
{
UpdatePackagePath = _newPackageTempFolder,
RequiresBinariesUpdate = replaceBinaries,
- }, result, null, tempDbName, backupsFolder, localDataSource, publishInfo);
+ }, result, null, tempDbName, backupsFolder, localDataSource, publishInfo, true);
};
handler.Canceled += (_, __) =>
{
@@ -1487,7 +1490,7 @@ namespace Tango.PPC.Common.MachineUpdate
{
UpdatePackagePath = _newPackageTempFolder,
RequiresBinariesUpdate = replaceBinaries,
- }, result, null, tempDbName, backupsFolder, localDataSource, publishInfo);
+ }, result, null, tempDbName, backupsFolder, localDataSource, publishInfo, true);
}
}
catch (Exception ex)