简体   繁体   English

如何使用 wix 安装程序安装和启动 Windows 服务?

[英]How to install and start a windows service with wix installer?

How can I install a windows service with WiX?如何使用 WiX 安装 Windows 服务? I already did everything on the setup to install a normal .exe but what musst I do to install and start a service?我已经做了所有设置来安装普通的 .exe 但是我必须做什么才能安装和启动服务?
Do I only need to copy this in my product.wxs and everything will work?我只需要在我的 product.wxs 中复制它,一切都会起作用吗?

I want to install it via the Setup and set the Service to autostart on Windows Startup.我想通过安装程序安装它并将服务设置为在 Windows 启动时自动启动。 And I want to delete the Service with the Setup mean it will stop the Service and uninstall it.我想用安装程序删除服务意味着它将停止服务并卸载它。 It would be great to if I can update the Service too with a new Setup mean it will stop the Service, uninstall it, install the new one and start it.如果我也可以使用新的安装程序更新服务,这将是很棒的,这意味着它将停止服务,卸载它,安装新的并启动它。

Is all this possible with the Code from the answere I linked?我链接的答案中的代码是否可以实现这一切?

"Hello Service" : The markup you link to should generally work, but it is a bit involved and complex. “Hello Service” :您链接到的标记通常应该可以工作,但它有点复杂。 You can normally get away with fewer constructs.您通常可以使用较少的构造。 Here is a full-featured, self-contained practical example on github: How to create a Windows Service MSI Installer Using WiX (I didn't actually test it, but it looks good).这是 github 上一个功能齐全、自包含的实际示例: How to create a Windows Service MSI Installer Using WiX (我没有实际测试它,但看起来不错)。

IsWiX : Chris Painter also has a sample on how to install services: https://github.com/iswix-llc/iswix-tutorials/tree/master/windows-service IsWiX :Chris Painter 还有一个关于如何安装服务的示例: https : //github.com/iswix-llc/iswix-tutorials/tree/master/windows-service

Documentation : ServiceInstall , ServiceControl .文档ServiceInstallServiceControl

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Windows Service无法在安装WiX / IsWix上启动。 验证您是否具有足够的特权。 InstallShield转Wix安装程序 - Windows Service fails to start on install WiX/IsWix. Verify that you have sufficient privileges. InstallShield to Wix installer 基于 Wix 安装程序的 TopShelf Windows 服务无法启动 - Wix installer based TopShelf windows service fails to start 如何在不扩展安装程序的情况下安装Windows服务? - How to install Windows service without extending Installer? WiX安装程序中的Parameterise服务启动选项 - Parameterise Service start option in WiX installer 如何使用 wix 安装程序启用 windows 功能 - How to enable windows features using wix installer WiX - 安装Windows服务并授予权限 - WiX - Install Windows Service and give permissions 如何使用 Visual Studio 安装程序项目安装 .NET 6 Windows 服务(Worker Service)? - How do you install a .NET 6 Windows Service (Worker Service) using a Visual Studio Installer project? 安装时自动启动Windows服务 - Automatically Start Windows Service on Install 使用 WiX 安装程序打开 Windows 功能 - Turning Windows Features on with WiX Installer 一个程序集中的多个服务。 安装程序如何知道要安装和启动哪个服务? - Multiple services in one assembly. How installer knows which service to install and start?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM