using System.Collections;
using System.Configuration.Install;
using System.ServiceProcess;
using System.ComponentModel;

namespace WindowsService1
{
 /// <summary>
 /// myInstall 的摘要说明。
 /// </summary>
 ///
 [RunInstaller(true)]
 public class myInstall : Installer
 {

  private ServiceInstaller serviceInstaller;
  private ServiceProcessInstaller processInstaller;
  public myInstall()
  {
   processInstaller = new ServiceProcessInstaller();
   serviceInstaller = new ServiceInstaller();

   processInstaller.Account = ServiceAccount.LocalSystem;
   serviceInstaller.StartType = ServiceStartMode.Automatic;
   serviceInstaller.ServiceName = "WindowsService1";

   Installers.Add(serviceInstaller);
   Installers.Add(processInstaller);
  }
 }
}

相关文章:

  • 2022-12-23
  • 2021-12-23
  • 2021-07-16
  • 2021-06-29
  • 2021-04-15
  • 2021-11-09
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-27
  • 2021-05-19
相关资源
相似解决方案