Beispiel #1
0
        private void toolStripDownloading_Click(object sender, EventArgs e)
        {
            if (this.toolStripDownloading.IsLink == true)
            {
                DialogResult dlgVisitPage = MessageBox.Show(this.m_clocLanguage.GetLocalized("frmMain.MessageBox.RestartProcon"), "PRoCon Frostbite", MessageBoxButtons.YesNo, MessageBoxIcon.Information);

                if (dlgVisitPage == DialogResult.Yes)
                {
                    AutoUpdater.BeginUpdateProcess(this.m_paProcon);

                    //System.Diagnostics.Process.Start(AppDomain.CurrentDomain.BaseDirectory + "PRoConUpdater.exe", String.Format("\"{0}\" \"{1}\"", this.m_strReleaseNotesLink, this.m_strDownloadSourceLink));
                    //this.Close();
                }
            }
        }
Beispiel #2
0
        static void Main(string[] args)
        {
            Program.Args = args;

            bool dotNetCheck = CheckNetVersion("3.5");

            if (PRoConApplication.IsProcessOpen() == false && dotNetCheck == true)
            {
                if (Directory.Exists(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Updates")) == true)
                {
                    AutoUpdater.Arguments = args;
                    AutoUpdater.BeginUpdateProcess(null);
                }
                else
                {
                    try
                    {
                        bool isBasicConsole = false;
                        bool isGspUpdater   = false;

                        if (args != null && args.Length >= 2)
                        {
                            for (int i = 0; i < args.Length; i = i + 2)
                            {
                                int value;

                                if (String.Compare("-console", args[i], System.StringComparison.OrdinalIgnoreCase) == 0 && int.TryParse(args[i + 1], out value) == true && value == 1)
                                {
                                    isBasicConsole = true;
                                }
                                if (String.Compare("-gspupdater", args[i], System.StringComparison.OrdinalIgnoreCase) == 0 && int.TryParse(args[i + 1], out value) == true && value == 1)
                                {
                                    isGspUpdater = true;
                                }
                                if (String.Compare("-use_core", args[i], System.StringComparison.OrdinalIgnoreCase) == 0 && int.TryParse(args[i + 1], out value) == true && value > 0)
                                {
                                    System.Diagnostics.Process.GetCurrentProcess().ProcessorAffinity = (System.IntPtr)value;
                                }
                            }
                        }

                        Application.EnableVisualStyles();
                        Application.SetCompatibleTextRenderingDefault(false);

                        if (isGspUpdater == true)
                        {
                            Application.Run(new GspUpdater());
                        }
                        else
                        {
                            if (isBasicConsole == true)
                            {
                                BasicConsole basicWindow = new BasicConsole();
                                basicWindow.WindowLoaded += new BasicConsole.WindowLoadedHandler(procon_WindowLoaded);

                                Application.Run(basicWindow);
                            }
                            else
                            {
                                frmMain mainWindow = new frmMain(args);
                                mainWindow.WindowLoaded += new frmMain.WindowLoadedHandler(procon_WindowLoaded);
                                Application.Run(mainWindow);
                            }
                        }
                    }
                    catch (Exception e)
                    {
                        FrostbiteConnection.LogError("Application error", String.Empty, e);
                        MessageBox.Show("Procon ran into a critical error, but hopefully it logged that error in DEBUG.txt. Please post this to the forums at https://myrcon.net/");
                    }
                    finally
                    {
                        if (Program.ProconApplication != null)
                        {
                            Program.ProconApplication.Shutdown();
                        }
                    }
                }
            }
            else
            {
                // Possible prevention of a cpu consumption bug I can see at the time of writing.
                // TCAdmin: Start procon.exe
                // procon.exe has an update to install
                // procon.exe loads proconupdater.exe
                // procon.exe unloads
                // proconupdater.exe begins update
                // TCAdmin detects procon.exe shutdown - attempts to reload
                Thread.Sleep(50);
            }
        }
Beispiel #3
0
        static void Main(string[] args)
        {
            Program.m_Args = args;

            if (PRoConApplication.IsProcessOpen() == false)
            {
                if (Directory.Exists(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Updates")) == true)
                {
                    AutoUpdater.m_strArgs = args;
                    AutoUpdater.BeginUpdateProcess(null);
                }
                else
                {
                    //PRoConApplication paProcon = null;

                    try {
                        bool blBasicConsole = false;
                        bool blGspUpdater   = false;

                        int iValue;
                        if (args != null && args.Length >= 2)
                        {
                            for (int i = 0; i < args.Length; i = i + 2)
                            {
                                if (String.Compare("-console", args[i], true) == 0 && int.TryParse(args[i + 1], out iValue) == true && iValue == 1)
                                {
                                    blBasicConsole = true;
                                }
                                if (String.Compare("-gspupdater", args[i], true) == 0 && int.TryParse(args[i + 1], out iValue) == true && iValue == 1)
                                {
                                    blGspUpdater = true;
                                }
                            }
                        }

                        //Thread.Sleep(5000);
                        Application.EnableVisualStyles();
                        Application.SetCompatibleTextRenderingDefault(false);

                        if (blGspUpdater == true)
                        {
                            Application.Run(new GspUpdater());
                        }
                        else
                        {
                            if (blBasicConsole == true)
                            {
                                BasicConsole basicWindow = new BasicConsole();
                                basicWindow.WindowLoaded += new BasicConsole.WindowLoadedHandler(procon_WindowLoaded);

                                Application.Run(basicWindow);
                            }
                            else
                            {
                                frmMain mainWindow = new frmMain(args);
                                mainWindow.WindowLoaded += new frmMain.WindowLoadedHandler(procon_WindowLoaded);
                                Application.Run(mainWindow);
                            }
                        }
                    }
                    catch (Exception e) {
                        FrostbiteConnection.LogError("Application error", String.Empty, e);
                        MessageBox.Show("PRoCon ran into a critical error, but hopefully it logged that error in DEBUG.txt.  Please post/pm/email this to phogue at www.phogue.net.");
                    }
                    finally {
                        if (Program.m_application != null)
                        {
                            Program.m_application.Shutdown();
                        }
                    }
                }
            }
            else
            {
                // Possible prevention of a cpu consumption bug I can see at the time of writing.
                // TCAdmin: Start procon.exe
                // procon.exe has an update to install
                // procon.exe loads proconupdater.exe
                // procon.exe unloads
                // proconupdater.exe begins update
                // TCAdmin detects procon.exe shutdown - attempts to reload
                Thread.Sleep(50);
            }
        }