diff options
| author | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2021-01-13 13:50:08 +0200 |
|---|---|---|
| committer | Roy Ben Shabat <Roy.mail.net@gmail.com> | 2021-01-13 13:50:08 +0200 |
| commit | cba294511ce2d7a3b2792632703b671e20263061 (patch) | |
| tree | 44889c6900ed63dbd42218cd6aa2e9a407dbd7db /Software | |
| parent | 1a6633d7d5c55f87271bdd8957c923b5e9a7ec51 (diff) | |
| download | Tango-cba294511ce2d7a3b2792632703b671e20263061.tar.gz Tango-cba294511ce2d7a3b2792632703b671e20263061.zip | |
Fixed issue with UpdateFromTUP and backups folder removal.
Diffstat (limited to 'Software')
| -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) |
