我可以使用 Wixsharp 安装 Windows 服务吗

Bre*_*... 4 wixsharp

我一直在使用 WIX# (wixsharp) 创建 MSI,但我不知道如何安装 Windows 服务。我已经浏览了整个 CHM 文件,但没有看到任何特定于 Windows 服务的内容。

TIA,

布伦特...

Dal*_*oem 5

从版本 1.0.4(2015-01-18 发布)开始,WiX# 支持安装 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,
};
Run Code Online (Sandbox Code Playgroud)