From 774da535e732ecd5a3737550ef1d35819a1e7fc6 Mon Sep 17 00:00:00 2001 From: Roy Ben-Shabat Date: Wed, 22 Aug 2018 18:40:34 +0300 Subject: Remove old dll files on machine studio update. --- .../Tango.MachineStudio.Updater/MainWindow.xaml.cs | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'Software/Visual_Studio/MachineStudio') diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Updater/MainWindow.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Updater/MainWindow.xaml.cs index a0c6928d2..4e6a8ad63 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Updater/MainWindow.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Updater/MainWindow.xaml.cs @@ -47,6 +47,7 @@ namespace Tango.MachineStudio.Updater private void Update() { EnsureMachineStudioIsDown(); + RemoveOldDLLFiles(); ReplaceFiles(); StartMachineStudio(); Environment.Exit(0); @@ -65,6 +66,18 @@ namespace Tango.MachineStudio.Updater p.Start(); } + private void RemoveOldDLLFiles() + { + foreach (string dll in Directory.GetFiles(_appPath, "*.dll")) + { + try + { + File.Delete(dll); + } + catch { } + } + } + private void ReplaceFiles() { int maxProgress = Directory.GetFiles(_sourceFolder, "*.*", SearchOption.AllDirectories).Length; @@ -133,9 +146,6 @@ namespace Tango.MachineStudio.Updater } while (appProcess != null); } - /// - /// Forces UI rendering. - /// private void DoEvents() { Application.Current.Dispatcher.Invoke(DispatcherPriority.Background, new Action(delegate { })); -- cgit v1.3.1