diff options
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Updater')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Updater/MainWindow.xaml.cs | 16 |
1 files changed, 13 insertions, 3 deletions
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); } - /// <summary> - /// Forces UI rendering. - /// </summary> private void DoEvents() { Application.Current.Dispatcher.Invoke(DispatcherPriority.Background, new Action(delegate { })); |
