本文整理汇总了C#中System.ServiceProcess.ServiceInstaller类的典型用法代码示例。如果您正苦于以下问题:C# ServiceInstaller类的具体用法?C# ServiceInstaller怎么用?C# ServiceInstaller使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ServiceInstaller类属于System.ServiceProcess命名空间,在下文中一共展示了ServiceInstaller类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PollServerInstaller
public PollServerInstaller()
{
InitializeComponent();
ServiceProcessInstaller serviceProcessInstaller =
new ServiceProcessInstaller();
ServiceInstaller serviceInstaller = new ServiceInstaller();
//# Service Account Information
serviceProcessInstaller.Account = ServiceAccount.LocalSystem;
//# Service Information
serviceInstaller.DisplayName = "ILS PollServer";
serviceInstaller.StartType = ServiceStartMode.Automatic;
//# This must be identical to the WindowsService.ServiceBase name
//# set in the constructor of WindowsService.cs
serviceInstaller.ServiceName = "PollServer";
this.Installers.Add( serviceProcessInstaller );
this.Installers.Add( serviceInstaller );
}
示例2: Install
public void Install()
{
if (ServiceExists())
{
logger.Warn("The service is already installed!");
}
else
{
var installer = new ServiceProcessInstaller
{
Account = ServiceAccount.LocalSystem
};
var serviceInstaller = new ServiceInstaller();
var exePath = Path.Combine(configService.ApplicationFolder(), SERVICEEXE);
if (!File.Exists(exePath) && Debugger.IsAttached)
{
exePath = Path.Combine(configService.ApplicationFolder(), "..\\..\\..\\Jackett.Service\\bin\\Debug", SERVICEEXE);
}
string[] cmdline = { @"/assemblypath=" + exePath};
var context = new InstallContext("jackettservice_install.log", cmdline);
serviceInstaller.Context = context;
serviceInstaller.DisplayName = NAME;
serviceInstaller.ServiceName = NAME;
serviceInstaller.Description = DESCRIPTION;
serviceInstaller.StartType = ServiceStartMode.Automatic;
serviceInstaller.Parent = installer;
serviceInstaller.Install(new ListDictionary());
}
}
示例3: WindowsServiceInstaller
/// <summary>
/// Public Constructor for WindowsServiceInstaller.
/// - Put all of your Initialization code here.
/// </summary>
public WindowsServiceInstaller()
{
SpaceEngineersGame.SetupPerGameSettings();
ServiceProcessInstaller serviceProcessInstaller =
new ServiceProcessInstaller();
m_serviceInstaller = new ServiceInstaller();
//# Service Account Information
serviceProcessInstaller.Account = ServiceAccount.LocalSystem;
serviceProcessInstaller.Username = null;
serviceProcessInstaller.Password = null;
m_serviceInstaller.DisplayName = MyPerServerSettings.GameName + " dedicated server";
//# This must be identical to the WindowsService.ServiceBase name
//# set in the constructor of WindowsService.cs
m_serviceInstaller.ServiceName = m_serviceInstaller.DisplayName;
m_serviceInstaller.Description = MyPerServerSettings.GameDSDescription;
this.Installers.Add(m_serviceInstaller);
//# Service Information
m_serviceInstaller.StartType = ServiceStartMode.Automatic;
this.Installers.Add(serviceProcessInstaller);
}
示例4: NDockServiceInstaller
public NDockServiceInstaller()
{
InitializeComponent();
processInstaller = new ServiceProcessInstaller();
serviceInstaller = new ServiceInstaller();
processInstaller.Account = ServiceAccount.LocalSystem;
serviceInstaller.StartType = ServiceStartMode.Automatic;
serviceInstaller.ServiceName = ConfigurationManager.AppSettings["ServiceName"];
var serviceDescription = ConfigurationManager.AppSettings["ServiceDescription"];
if (!string.IsNullOrEmpty(serviceDescription))
serviceInstaller.Description = serviceDescription;
var servicesDependedOn = new List<string> { "tcpip" };
var servicesDependedOnConfig = ConfigurationManager.AppSettings["ServicesDependedOn"];
if (!string.IsNullOrEmpty(servicesDependedOnConfig))
servicesDependedOn.AddRange(servicesDependedOnConfig.Split(new char[] { ',', ';' }));
serviceInstaller.ServicesDependedOn = servicesDependedOn.ToArray();
Installers.Add(serviceInstaller);
Installers.Add(processInstaller);
}
示例5: TfsDeployerInstaller
public TfsDeployerInstaller()
{
_processInstaller = new ServiceProcessInstaller();
this._eventLogInstaller = new System.Diagnostics.EventLogInstaller();
this._tfsIntegratorInstaller = new System.ServiceProcess.ServiceInstaller();
//
// _eventLogInstaller
//
this._eventLogInstaller.CategoryCount = 0;
this._eventLogInstaller.CategoryResourceFile = null;
this._eventLogInstaller.Log = "Application";
this._eventLogInstaller.MessageResourceFile = null;
this._eventLogInstaller.ParameterResourceFile = null;
this._eventLogInstaller.Source = "Readify.TfsDeployer";
//
// _tfsIntegratorInstaller
//
this._tfsIntegratorInstaller.DisplayName = "TFS Deployer";
this._tfsIntegratorInstaller.ServiceName = "TfsDeployer";
this._tfsIntegratorInstaller.Description = "Performs Deployment for Team Foundation Server";
this._tfsIntegratorInstaller.StartType = System.ServiceProcess.ServiceStartMode.Automatic;
_processInstaller.Account = ServiceAccount.LocalSystem;
this.Installers.Add(_eventLogInstaller);
this.Installers.Add(_tfsIntegratorInstaller);
this.Installers.Add(_processInstaller);
}
示例6: InstallerSrv
public InstallerSrv()
{
string logname = "GranityLog";
InitializeComponent();
//��װ��־
if (EventLog.Exists(logname))
EventLog.Delete(logname);
if (EventLog.SourceExists(logname))
EventLog.DeleteEventSource(logname);
EventLogInstaller log = new EventLogInstaller();
log.Source = logname;
log.Log = logname;
this.Installers.Add(log);
//��װ����
ServiceProcessInstaller prsInstaller = new ServiceProcessInstaller();
ServiceInstaller srvInstall = new ServiceInstaller();
// The services run under the system account.
prsInstaller.Account = ServiceAccount.LocalSystem;
prsInstaller.Username = null;
prsInstaller.Password = null;
// The services are started manually.
srvInstall.StartType = ServiceStartMode.Automatic;
srvInstall.ServiceName = "Granity�ļ�����";
srvInstall.Description = "�Ϻ�����˾��ͣ����ץ��ͼƬ�ļ�����";
// Add installers to collection. Order is not important.
Installers.Add(srvInstall);
Installers.Add(prsInstaller);
}
示例7: WindowsServiceInstaller
/// <summary>
/// Public Constructor for WindowsServiceInstaller.
/// - Put all of your Initialization code here.
/// </summary>
public WindowsServiceInstaller()
{
var serviceProcessInstaller =
new ServiceProcessInstaller();
var serviceInstaller
= new ServiceInstaller();
//# Service Account Information
serviceProcessInstaller.Account = ServiceAccount.LocalSystem;
serviceProcessInstaller.Username = null;
serviceProcessInstaller.Password = null;
//# Service Information
serviceInstaller.DisplayName = "NP2COMService";
serviceInstaller.StartType = ServiceStartMode.Automatic;
//# This must be identical to the WindowsService.ServiceBase name
//# set in the constructor of WindowsService.cs
serviceInstaller.ServiceName = "NP2COMService";
Installers.Add(serviceProcessInstaller);
Installers.Add(serviceInstaller);
}
示例8: ServiceDeploy
public ServiceDeploy()
{
string serviceName = Path.GetFileNameWithoutExtension(Assembly.GetExecutingAssembly().Location);
//string[] splitValues = serviceName.Split('.');
//string displayName = "RestServiceHost - " + splitValues[splitValues.Length - 1];
string displayName = "RestServiceHost - TestService";
var processInstaller = new ServiceProcessInstaller();
var serviceInstaller = new ServiceInstaller();
//set the privileges
processInstaller.Account = ServiceAccount.User;
serviceInstaller.DisplayName = displayName;
serviceInstaller.StartType = ServiceStartMode.Automatic;
serviceInstaller.DelayedAutoStart = true;
serviceInstaller.Description = "Seld Hosted Rest Service";
//must be the same as what was set in Program's constructor
serviceInstaller.ServiceName = serviceName;
this.Installers.Add(processInstaller);
this.Installers.Add(serviceInstaller);
}
示例9: ServiceBusInstaller
public ServiceBusInstaller()
{
process = new ServiceProcessInstaller {Account = ServiceAccount.LocalSystem};
service = new ServiceInstaller {ServiceName = "WCF Service Bus"};
Installers.Add(process);
Installers.Add(service);
}
示例10: InitializeComponent
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.serviceProcessInstaller1 = new System.ServiceProcess.ServiceProcessInstaller();
this.serviceInstaller1 = new System.ServiceProcess.ServiceInstaller();
//
// serviceProcessInstaller1
//
this.serviceProcessInstaller1.Account = System.ServiceProcess.ServiceAccount.LocalSystem;
this.serviceProcessInstaller1.Password = null;
this.serviceProcessInstaller1.Username = null;
//
// serviceInstaller1
//
this.serviceInstaller1.ServiceName = "XPLLogger";
this.serviceInstaller1.ServicesDependedOn = new string[] {
""};
this.serviceInstaller1.StartType = System.ServiceProcess.ServiceStartMode.Automatic;
this.serviceInstaller1.BeforeUninstall += new System.Configuration.Install.InstallEventHandler(this.serviceInstaller1_BeforeUninstall);
this.serviceInstaller1.AfterInstall += new System.Configuration.Install.InstallEventHandler(this.serviceInstaller1_AfterInstall);
//
// ProjectInstaller
//
this.Installers.AddRange(new System.Configuration.Install.Installer[] {
this.serviceProcessInstaller1,
this.serviceInstaller1});
}
示例11: InitializeComponent
private void InitializeComponent()
{
this.components = new Container();
this.serviceProcessInstaller = new ServiceProcessInstaller();
this.serviceInstaller = new ServiceInstaller();
// serviceProcessInstaller
this.serviceProcessInstaller.Account = ServiceAccount.LocalSystem;
this.serviceProcessInstaller.Password = null;
this.serviceProcessInstaller.Username = null;
// serviceInstaller
this.serviceInstaller.DisplayName = ServiceHostSettings.ServiceName;
this.serviceInstaller.ServiceName = ServiceHostSettings.ServiceName;
this.serviceInstaller.Description = ServiceHostSettings.ServiceDescription;
this.serviceInstaller.StartType = ServiceStartMode.Manual;
// ProjectInstaller
this.Installers.AddRange(new Installer[]
{
this.serviceProcessInstaller,
this.serviceInstaller
});
}
示例12: CassetteHostServiceInstaller
public CassetteHostServiceInstaller()
{
var process = new ServiceProcessInstaller { Account = ServiceAccount.LocalSystem };
var service = new ServiceInstaller { ServiceName = CassetteHostingService.CassetteServiceName };
Installers.Add(process);
Installers.Add(service);
}
示例13: InitializeComponent
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.spInstaller = new System.ServiceProcess.ServiceProcessInstaller();
this.srvcInstaller = new System.ServiceProcess.ServiceInstaller();
//
// spInstaller
//
this.spInstaller.Account = System.ServiceProcess.ServiceAccount.LocalSystem;
this.spInstaller.Password = null;
this.spInstaller.Username = null;
//
// srvcInstaller
//
this.srvcInstaller.ServiceName = "WMS 3.0 WCF Service";
this.srvcInstaller.Description = "Manage the WCF Service (Communication Foundation).";
this.srvcInstaller.DisplayName = "WMS 3.0 WCF Service";
this.srvcInstaller.StartType = System.ServiceProcess.ServiceStartMode.Automatic;
//
// ProjectInstaller
//
this.Installers.AddRange(new System.Configuration.Install.Installer[]
{ this.spInstaller, this.srvcInstaller });
}
示例14: Installer
public Installer()
{
InitializeComponent();
this.ServiceProcessInstaller1 = new System.ServiceProcess.ServiceProcessInstaller();
this.serviceInstaller1 = new System.ServiceProcess.ServiceInstaller();
//
// ServiceProcessInstaller1
//
this.ServiceProcessInstaller1.Account = System.ServiceProcess.ServiceAccount.LocalSystem;
this.ServiceProcessInstaller1.Password = null;
this.ServiceProcessInstaller1.Username = null;
//
// serviceInstaller1
//
this.serviceInstaller1.DisplayName = "dp2 Kernel Service";
this.serviceInstaller1.ServiceName = "dp2KernelService";
this.serviceInstaller1.Description = "dp2内核,数字平台北京软件有限责任公司 http://dp2003.com";
this.serviceInstaller1.StartType = ServiceStartMode.Automatic;
/*
this.serviceInstaller1.ServicesDependedOn = new string[] {
"W3SVC"};
* */
//
// ProjectInstaller
//
this.Installers.AddRange(new System.Configuration.Install.Installer[] {
this.ServiceProcessInstaller1,
this.serviceInstaller1});
this.serviceInstaller1.Committed += new InstallEventHandler(serviceInstaller1_Committed);
}
示例15: DefaultInstaller_BeforeInstall
private void DefaultInstaller_BeforeInstall(object sender, InstallEventArgs e)
{
ServiceInstaller serviceInstaller = new ServiceInstaller()
{
Description = "MSMQ Monitor",
StartType = ServiceStartMode.Automatic,
};
string name = Context.Parameters["name"];
if (!string.IsNullOrEmpty(name))
{
serviceInstaller.ServiceName = name;
}
else
{
serviceInstaller.ServiceName = "MSMQ.Monitor";
}
ServiceProcessInstaller processInstaller = new ServiceProcessInstaller()
{
Account = ServiceAccount.LocalSystem
};
Installers.Add(serviceInstaller);
Installers.Add(processInstaller);
}