Exemplo n.º 1
0
        static void Main(string[] args)
        {
            //SetProcessDPIAware();

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

            //exception handler
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);

            //if the exe was passed a filename argument then run the script
            if (args.Length > 0)
            {
                string filePath = args[0];


                if (!System.IO.File.Exists(filePath))
                {
                    using (System.Diagnostics.EventLog eventLog = new System.Diagnostics.EventLog("Application"))
                    {
                        eventLog.Source = "Application";
                        eventLog.WriteEntry("An attempt was made to run a taskt script file from '" + filePath + "' but the file was not found.  Please verify that the file exists at the path indicated.", System.Diagnostics.EventLogEntryType.Error, 101, 1);
                    }

                    Application.Exit();
                    return;
                }

                Application.Run(new UI.Forms.frmScriptEngine(filePath, null, null, true));
            }
            else
            {
                //clean up updater
                var updaterExecutableDestination = Application.StartupPath + "\\taskt-updater.exe";

                if (System.IO.File.Exists(updaterExecutableDestination))
                {
                    System.IO.File.Delete(updaterExecutableDestination);
                }

                SplashForm = new UI.Forms.Supplemental.frmSplash();
                SplashForm.Show();

                Application.DoEvents();

                //Sergey added
                System.Threading.Thread.Sleep(5000);
                SplashForm.Close();

                Application.Run(new UI.Forms.frmScriptBuilder());
            }
        }
Exemplo n.º 2
0
        static void Main(string[] args)
        {
            //SetProcessDPIAware();

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

            //exception handler
            Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);

            //if the exe was passed a filename argument then run the script
            if (args.Length > 0)
            {
                string filePath = args[0];


                if (!System.IO.File.Exists(filePath))
                {
                    using (System.Diagnostics.EventLog eventLog = new System.Diagnostics.EventLog("Application"))
                    {
                        eventLog.Source = "Application";
                        eventLog.WriteEntry("An attempt was made to run a taskt script file from '" + filePath + "' but the file was not found.  Please verify that the file exists at the path indicated.", System.Diagnostics.EventLogEntryType.Error, 101, 1);
                    }

                    Application.Exit();
                    return;
                }

                Application.Run(new UI.Forms.frmScriptEngine(filePath, null, null, true));
            }
            else
            {
                //clean up updater
                var updaterExecutableDestination = Application.StartupPath + "\\taskt-updater.exe";

                if (System.IO.File.Exists(updaterExecutableDestination))
                {
                    System.IO.File.Delete(updaterExecutableDestination);
                }

                SplashForm = new UI.Forms.Supplemental.frmSplash();
                SplashForm.Show();

                Application.DoEvents();

                string baseAddress = "http://*****:*****@"     

  _                          _  
 | \  _     |\ |  _ _|_  _  |C| 
 |_/ (/_ \/ | \| (_) |_ (/_ `-' 
                               
";


                    Console.WriteLine(banner);

                    //STEP_.INIT CONFIGURATION
                    FileEndPointManager.SyncCustomConfig();
                    FileEndPointManager.SyncLogConfig();
                    FileEndPointManager.SyncDatabaseConfig();


                    Application.Run(new UI.Forms.frmScriptBuilder());
                }
            }
        }