aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/TEMP/Tango.Scripting/Tango.Scripting.IDE/Properties/Resources.Designer.cs
blob: ec92331cbc549b62a21db78775b1c7d5022fa5f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.42000
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace Tango.Scripting.IDE.Properties {
    
    
    /// <summary>
    ///   A strongly-typed resource class, for looking up localized strings, etc.
    /// </summary>
    // This class was auto-generated by the StronglyTypedResourceBuilder
    // class via a tool like ResGen or Visual Studio.
    // To add or remove a member, edit your .ResX file then rerun ResGen
    // with the /str option, or rebuild your VS project.
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    internal class Resources {
        
        private static global::System.Resources.ResourceManager resourceMan;
        
        private static global::System.Globalization.CultureInfo resourceCulture;
        
        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
        internal Resources() {
        }
        
        /// <summary>
        ///   Returns the cached ResourceManager instance used by this class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Resources.ResourceManager ResourceManager {
            get {
                if ((resourceMan == null)) {
                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Tango.Scripting.IDE.Properties.Resources", typeof(Resources).Assembly);
                    resourceMan = temp;
                }
                return resourceMan;
            }
        }
        
        /// <summary>
        ///   Overrides the current thread's CurrentUICulture property for all
        ///   resource lookups using this strongly typed resource class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Globalization.CultureInfo Culture {
            get {
                return resourceCulture;
            }
            set {
                resourceCulture = value;
            }
        }
    }
}
pan>InitializeComponent(); ContentRendered += MainWindow_ContentRendered; } private void MainWindow_ContentRendered(object sender, EventArgs e) { Update(); } private void Update() { EnsureMachineStudioIsDown(); //RemoveOldDLLFiles(); ReplaceFiles(); StartMachineStudio(); Environment.Exit(0); } private void StartMachineStudio() { txtStatus.Text = "Update completed. Starting Machine Studio..."; DoEvents(); Thread.Sleep(1000); Process p = new Process(); p.StartInfo.FileName = _appPath + "\\" + _msProcessName + ".exe"; p.StartInfo.LoadUserProfile = true; p.StartInfo.UseShellExecute = true; p.Start(); } //private void RemoveOldDLLFiles() //{ // foreach (string dll in Directory.GetFiles(_appPath, "*.dll")) // { // try // { // File.Delete(dll); // } // catch // { // ShowError($"The file '{Path.GetFileName(dll)}' could not be removed. Please close all instances of Machine Studio and press OK."); // RemoveOldDLLFiles(); // return; // } // } //} private void ReplaceFiles() { int maxProgress = Directory.GetFiles(_sourceFolder, "*.*", SearchOption.AllDirectories).Length; int progress = 0; foreach (string dirPath in Directory.GetDirectories(_sourceFolder, "*", SearchOption.AllDirectories)) { try { Directory.CreateDirectory(dirPath.Replace(_sourceFolder, _appPath)); } catch (Exception ex) { ShowError("Could not create directory " + Path.GetFileName(dirPath) + Environment.NewLine + ex.Message); } } foreach (string newPath in Directory.GetFiles(_sourceFolder, "*.*", SearchOption.AllDirectories)) { try { txtStatus.Text = "Copying file " + Path.GetFileName(newPath); DoEvents(); File.Copy(newPath, newPath.Replace(_sourceFolder, _appPath), true); prog.Maximum = maxProgress; prog.Value = progress++; DoEvents(); Thread.Sleep(10); } catch (Exception ex) { if (!newPath.ToLower().Contains("updater.exe")) { ShowError("Could not create file " + Path.GetFileName(newPath) + Environment.NewLine + ex.Message); } } } } private void EnsureMachineStudioIsDown() { Process appProcess = null; int tries = 0; 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++; try { appProcess.Kill(); } catch { } try { p.Start(); } catch { } Thread.Sleep(1000); } if (tries > 10) { ShowError("The main Machine Studio process seems to in a frozen state. Please restart your computer and try again."); Environment.Exit(0); } } while (appProcess != null); } private void DoEvents() { Application.Current.Dispatcher.Invoke(DispatcherPriority.Background, new Action(delegate { })); } private void ShowError(String error) { MessageBox.Show(error, "Machine Studio Update", MessageBoxButton.OK, MessageBoxImage.Error); } } }