welsonjs/WelsonJS.Toolkit/WelsonJS.Service/Program.cs

33 lines
824 B
C#
Raw Normal View History

2024-07-22 07:04:40 +00:00
using System;
using System.ServiceProcess;
namespace WelsonJS.Service
{
internal static class Program
{
/// <summary>
2024-07-28 16:35:46 +00:00
/// entry point
2024-07-22 07:04:40 +00:00
/// </summary>
2024-07-22 11:15:31 +00:00
static void Main(string[] args)
2024-07-22 07:04:40 +00:00
{
2024-07-28 16:35:46 +00:00
ServiceMain svc = new ServiceMain();
2024-07-22 11:15:31 +00:00
if (Environment.UserInteractive)
2024-07-22 07:04:40 +00:00
{
2024-07-28 16:35:46 +00:00
Console.WriteLine("Welcome to WelsonJS Scripting Service...");
Console.WriteLine("https://github.com/gnh1201/welsonjs");
2024-07-22 11:15:31 +00:00
svc.TestStartupAndStop(args);
}
else
{
ServiceBase[] ServicesToRun;
ServicesToRun = new ServiceBase[]
{
2024-07-28 16:35:46 +00:00
svc
2024-07-22 11:15:31 +00:00
};
ServiceBase.Run(ServicesToRun);
}
2024-07-22 07:04:40 +00:00
}
}
}