diff options
| author | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-08-23 13:25:37 +0300 |
|---|---|---|
| committer | Roy Ben-Shabat <Roy@Twine-s.com> | 2018-08-23 13:25:37 +0300 |
| commit | 658d3d07ed46c6fdb7276b614a93b78c3e02060f (patch) | |
| tree | 17f5ad6851a497d1af97f239cc48268638d7e08e /Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Updater | |
| parent | 44f71ccd29edeeb13621996659232fca4554faf1 (diff) | |
| download | Tango-658d3d07ed46c6fdb7276b614a93b78c3e02060f.tar.gz Tango-658d3d07ed46c6fdb7276b614a93b78c3e02060f.zip | |
Fixed some issues with MS 3.0
Diffstat (limited to 'Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Updater')
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Updater/MainWindow.xaml.cs | 25 | ||||
| -rw-r--r-- | Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Updater/Properties/AssemblyInfo.cs | 2 |
2 files changed, 22 insertions, 5 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 4e6a8ad63..759f5d8d1 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Updater/MainWindow.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Updater/MainWindow.xaml.cs @@ -23,13 +23,13 @@ namespace Tango.MachineStudio.Updater /// </summary> public partial class MainWindow : Window { - private String _appPath = AppDomain.CurrentDomain.BaseDirectory; + private String _sourceFolder = AppDomain.CurrentDomain.BaseDirectory; private String _msProcessName = "Tango.MachineStudio.UI"; - private String _sourceFolder = App.StartupArgs.FirstOrDefault(); + private String _appPath = String.Join(" ", App.StartupArgs); public MainWindow() { - if (!Directory.Exists(_sourceFolder)) + if (!Directory.Exists(_appPath)) { ShowError("This update utility can only be executed by Machine Studio."); Environment.Exit(0); @@ -74,7 +74,12 @@ namespace Tango.MachineStudio.Updater { File.Delete(dll); } - catch { } + catch + { + ShowError($"The file '{Path.GetFileName(dll)}' could not be removed. Please close all instances of Machine Studio and press OK."); + RemoveOldDLLFiles(); + return; + } } } @@ -129,11 +134,23 @@ namespace Tango.MachineStudio.Updater do { appProcess = Process.GetProcessesByName(_msProcessName).FirstOrDefault(); + Process p = new Process(); + p.StartInfo.CreateNoWindow = true; + p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; + p.StartInfo.FileName = "wmic"; + p.StartInfo.Arguments = String.Format("process where name='{0}' delete", _msProcessName); if (appProcess != null) { tries++; appProcess.Kill(); + + try + { + p.Start(); + } + catch { } + Thread.Sleep(1000); } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Updater/Properties/AssemblyInfo.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Updater/Properties/AssemblyInfo.cs index e9a89a0ee..10e0e252e 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Updater/Properties/AssemblyInfo.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Updater/Properties/AssemblyInfo.cs @@ -5,7 +5,7 @@ using System.Runtime.InteropServices; using System.Windows; [assembly: AssemblyTitle("Tango - Machine Studio Updater Utility")] -[assembly: AssemblyVersion("2.0.7.1633")] +[assembly: AssemblyVersion("2.0.8.1159")] [assembly: ComVisible(false)] [assembly:ThemeInfo( |
