예제 #1
0
파일: Console.cs 프로젝트: benbon/SharpKit
        public void Main()
        {
            installer = new Installer();
            installer.OnLog += Log;
            installer.OnFinished += () =>
            {
                Environment.Exit(0);
            };

            installer.EnsureInited();

            Log(string.Format("Welcome to SharpKit {0} Installation!", installer.ProductVersion));

            while (true)
            {
                Console.WriteLine("Press 'i' for install/upgrade/repair");
                Console.WriteLine("Press 'u' for uninstall");
                Console.WriteLine("Press 'q' for quit");
                switch (Console.ReadKey().Key)
                {
                    case ConsoleKey.I:
                        installer.Install();
                        break;
                    case ConsoleKey.U:
                        installer.Uninstall();
                        break;
                    case ConsoleKey.Q:
                        Environment.Exit(0);
                        break;
                }
            }
        }
예제 #2
0
파일: FormMain.cs 프로젝트: benbon/SharpKit
        private void FormMain_Load(object sender, EventArgs e)
        {
            installer = new Installer();
            installer.OnLog += LogAsync;
            installer.OnFinished += () => Invoke(new Action(() =>
            {
                buttonAction = ButtonAction.Close;
                butInstall.Text = "Close";
            }));

            installer.EnsureInited();

            Log(string.Format("Welcome to SharpKit {0} Installation!", installer.ProductVersion));

            butInstall.Focus();

            var args = Environment.GetCommandLineArgs();
            if (args.Length >= 2 && args[1] == "/uninstall") radioUninstall.Checked = true;
        }