Example #1
0
 static void Main(string[] args)
 {
     try
     {
         if (args.Length > 0)
         {
             if (args[0] == "/i")
             {
                 Log1.Logger("Patcher").Info("Installing PatchServer as service...");
                 InstallService(Assembly.GetExecutingAssembly().Location);
             }
             else if (args[0] == "/u")
             {
                 Log1.Logger("Patcher").Info("UnInstalling PatchServer as service...");
                 WispServiceTools.ServiceInstaller.Uninstall("Patchy");
             }
             else if (args[0] == "standalone")
             {
                 Log1.Logger("Patcher").Info("Running PatchServer in standalone...");
                 PatchServer MyService = new PatchServer();
                 MyService.Setup();
                 System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);
             }
         }
         else
         {
             ServiceBase[] ServicesToRun;
             ServicesToRun = new ServiceBase[] { new PatchServer() };
             Log1.Logger("Patcher").Info("Starting Patch server as service.");
             ServiceBase.Run(ServicesToRun);
         }
     }
     catch (Exception e)
     {
         Log1.Logger("Patcher").Info("Fatal error: " + e.Message);
     }
 }
Example #2
0
 static void Main(string[] args)
 {
     try
     {
         if (args.Length > 0)
         {
             if (args[0] == "/i")
             {
                 Log1.Logger("Patcher").Info("Installing PatchServer as service...");
                 InstallService(Assembly.GetExecutingAssembly().Location);
             }
             else if (args[0] == "/u")
             {
                 Log1.Logger("Patcher").Info("UnInstalling PatchServer as service...");
                 WispServiceTools.ServiceInstaller.Uninstall("Patchy");
             }
             else if (args[0] == "standalone")
             {
                 Log1.Logger("Patcher").Info("Running PatchServer in standalone...");
                 PatchServer MyService = new PatchServer();
                 MyService.Setup();
                 System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);
             }
         }
         else
         {
             ServiceBase[] ServicesToRun;
             ServicesToRun = new ServiceBase[] { new PatchServer() };
             Log1.Logger("Patcher").Info("Starting Patch server as service.");
             ServiceBase.Run(ServicesToRun);
         }
     }
     catch (Exception e)
     {
         Log1.Logger("Patcher").Info("Fatal error: " + e.Message);
     }
 }