diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2021-01-13 13:44:21 +0200 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2021-01-13 13:44:21 +0200 |
| commit | 626251b432517f9c1dd82997f061763e86bbe8df (patch) | |
| tree | cc4b9776dccd505e2ae57c6a423c1c56fb047ded /Software/Visual_Studio/PPC/Tango.PPC.Common/MachineUpdate/MachineUpdateManager.cs | |
| parent | 38d2b46c7ca963a31ee43ae5bb1623dca2bc3e7c (diff) | |
| parent | cba294511ce2d7a3b2792632703b671e20263061 (diff) | |
| download | Tango-626251b432517f9c1dd82997f061763e86bbe8df.tar.gz Tango-626251b432517f9c1dd82997f061763e86bbe8df.zip | |
software merge.
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.cs | 25 |
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) |
