static void Main(string[] args)
        {
            //BootStrapper.Boot();
            ProjectInstaller.ServiceName = "Workflow Engine Example";

            if (!Environment.UserInteractive && args.Length == 0)
            {
                ServiceBase.Run(new WorkflowEngineExampleService());
            }
            else
            {
                string argument = GetArgument(args);

                switch (argument)
                {
                    case "install":
                        WindowsServiceController.Install();
                        System.Console.WriteLine();
                        System.Console.WriteLine("Install command executed. Press enter to quit.");
                        System.Console.ReadLine();
                        break;

                    case "installandstart":
                        WindowsServiceController.InstallAndStart();
                        break;

                    case "restart":
                        WindowsServiceController.Restart();
                        break;

                    case "start":
                        WindowsServiceController.Start();
                        break;

                    case "stop":
                        WindowsServiceController.Stop();
                        break;

                    case "uninstall":
                        WindowsServiceController.EnsureStoppedAndUninstall();
                        System.Console.WriteLine();
                        System.Console.WriteLine("Uninstall command executed. Press enter to quit.");
                        System.Console.ReadLine();
                        break;

                    case "run":
                        WorkflowEngineExampleService service = new WorkflowEngineExampleService();
                        service.Start();
                        System.Console.WriteLine("Running. Press enter to stop.");
                        System.Console.ReadLine();
                        break;

                    default:
                        PrintUsage(argument);
                        break;
                }
            }
        }
Exemple #2
0
        static void Main(string[] args)
        {
            //BootStrapper.Boot();
            ProjectInstaller.ServiceName = "Workflow Engine Example";

            if (!Environment.UserInteractive && args.Length == 0)
            {
                ServiceBase.Run(new WorkflowEngineExampleService());
            }
            else
            {
                string argument = GetArgument(args);

                switch (argument)
                {
                case "install":
                    WindowsServiceController.Install();
                    System.Console.WriteLine();
                    System.Console.WriteLine("Install command executed. Press enter to quit.");
                    System.Console.ReadLine();
                    break;

                case "installandstart":
                    WindowsServiceController.InstallAndStart();
                    break;

                case "restart":
                    WindowsServiceController.Restart();
                    break;

                case "start":
                    WindowsServiceController.Start();
                    break;

                case "stop":
                    WindowsServiceController.Stop();
                    break;

                case "uninstall":
                    WindowsServiceController.EnsureStoppedAndUninstall();
                    System.Console.WriteLine();
                    System.Console.WriteLine("Uninstall command executed. Press enter to quit.");
                    System.Console.ReadLine();
                    break;

                case "run":
                    WorkflowEngineExampleService service = new WorkflowEngineExampleService();
                    service.Start();
                    System.Console.WriteLine("Running. Press enter to stop.");
                    System.Console.ReadLine();
                    break;

                default:
                    PrintUsage(argument);
                    break;
                }
            }
        }