Example #1
0
        static void Main()
        {
            // *******************************************************************
            // Set some default application configuration
            // *******************************************************************
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            /*while (!System.Diagnostics.Debugger.IsAttached)
                System.Threading.Thread.Sleep(100);*/

            // *******************************************************************
            // Load correct Windows form
            // *******************************************************************
            Form oForm = null;
            string[] asArgv = Environment.GetCommandLineArgs();



            int parIdx = Math.Max(Math.Max(Math.Max(Array.IndexOf(asArgv, "--install"),
                Array.IndexOf(asArgv, "--upgrade-inplace")),
                Array.IndexOf(asArgv, "--configure")),
                Array.IndexOf(asArgv, "--uninstall"));

            if (parIdx >= 0)
            {
                if (asArgv[parIdx] == "--configure")
                {
                    oForm = new ConfigureWindow();
                }
                else if (asArgv[parIdx] == "--upgrade-inplace")
                {
                    oForm = new InstallWindow(true);
                }
                else if (asArgv[parIdx] == "--install")
                {
                    oForm = new InstallWindow();
                }
                else if (asArgv[parIdx] == "--uninstall")
                {
                    oForm = new UninstallWindow();
                }
            }
            else
            {
                int debugIdx = Array.IndexOf(asArgv, "--debug");
                oForm = new MainWindow(debugIdx >= 0);
            }

            if (oForm != null)
            {
                Application.Run(oForm);
            }
        }
Example #2
0
        static void Main()
        {
            // *******************************************************************
            // Set some default application configuration
            // *******************************************************************
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // *******************************************************************
            // Variables
            // *******************************************************************
            string[] asArgv = Environment.GetCommandLineArgs();

            // *******************************************************************
            // Load correct Windows form
            // *******************************************************************
            ExchangeServer oExchange = new ExchangeServer();
            Form oForm = null;

            if (Array.IndexOf(asArgv, "--install") >= 0)
            {
                oForm = new InstallWindow(null);
            }
            else if(Array.IndexOf(asArgv, "--upgrade") >= 0)
            {
                int parIdx = Array.IndexOf(asArgv, "--upgrade");
                string updateZipUrl = null;
                if (asArgv.Length > parIdx + 1)
                    updateZipUrl = asArgv[parIdx + 1];
                oForm = new InstallWindow(updateZipUrl);
            }
            //else if (Array.IndexOf(asArgv, "--uninstall") >= 0)
            //{
            //    // Delete Itself
            //    ProcessStartInfo Info=new ProcessStartInfo();
            //    Info.Arguments="/C choice /C Y /N /D Y /T 5 & Del "+ Application.ExecutablePath;
            //    Info.WindowStyle=ProcessWindowStyle.Hidden;
            //    Info.CreateNoWindow=true;
            //    Info.FileName="cmd.exe";
            //    Process.Start(Info); 
            //}
            else
            {
                oForm = new MainWindow();    
            }

            Application.Run(oForm);
        }
Example #3
0
        static void Main()
        {
            // *******************************************************************
            // Set some default application configuration
            // *******************************************************************
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            // *******************************************************************
            // Load correct Windows form
            // *******************************************************************
            Form oForm = null;
            string[] asArgv = Environment.GetCommandLineArgs();

            int parIdx = Math.Max(Math.Max(Array.IndexOf(asArgv, "--install"), Array.IndexOf(asArgv, "--upgrade")), Array.IndexOf(asArgv, "--configure"));
            if (parIdx >= 0)
            {
                if (asArgv[parIdx] == "--configure")
                {
                    oForm = new ConfigureWindow();
                }
                else if (asArgv[parIdx] == "--install" || asArgv[parIdx] == "--upgrade")
                {
                    string installZipUrl = null;
                    if (asArgv.Length > parIdx + 1)
                    {
                        installZipUrl = asArgv[parIdx + 1];
                    }

                    oForm = new InstallWindow(installZipUrl);
                }
                //else if (asArgv[parIdx] == "--uninstall") { }
                else
                {
                    Application.Exit();
                }
            }
            else
            {
                int debugIdx = Array.IndexOf(asArgv, "--debug");
                oForm = new MainWindow(debugIdx >= 0);
            }

            Application.Run(oForm);
        }