2014-10-30 1019 views

回答

3

随着1.0.4版本(发布2015年1月18日),维克斯#支持安装Windows服务。

https://wixsharp.codeplex.com/releases/view/610843

File service; 
var project = 
    new Project("My Product", 
     new Dir(@"%ProgramFiles%\My Company\My Product", 
      service = new File(@"..\SimpleService\MyApp.exe"))); 

service.ServiceInstaller = new ServiceInstaller 
{ 
    Name = "WixSharp.TestSvc", 
    StartOn = SvcEvent.Install, 
    StopOn = SvcEvent.InstallUninstall_Wait, 
    RemoveOn = SvcEvent.Uninstall_Wait, 
};