Files
duplicati/Duplicati/WindowsService/ServiceProcessInstaller.cs
T

30 lines
809 B
C#
Raw Normal View History

2016-04-13 11:44:21 +02:00
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Duplicati.WindowsService
{
public class ServiceProcessInstaller : System.ServiceProcess.ServiceProcessInstaller
{
public ServiceProcessInstaller()
{
this.Account = System.ServiceProcess.ServiceAccount.LocalSystem;
}
2016-09-23 14:11:53 +02:00
public override void Install(System.Collections.IDictionary stateSaver)
{
var localuser = Context.Parameters["localuser"];
if (localuser != null)
{
this.Account = System.ServiceProcess.ServiceAccount.User;
this.Username = localuser;
}
2016-09-23 14:11:53 +02:00
base.Install(stateSaver);
}
2016-04-13 11:44:21 +02:00
}
}