简体   繁体   English

C#:使安装程序同时安装WPF应用程序(ClickOnce)和Windows服务

[英]C#: Making an Installer that installs both a WPF application (ClickOnce) and a Windows Service

I currently have a VS Solution with 2 projects: a WPF application and a Windows Service. 我目前有一个包含2个项目的VS解决方案:WPF应用程序和Windows服务。

Now, I have managed to get ClickOnce working in installing my WPF application, but I also want a Windows Service to be installed (the one in the project) during this installation. 现在,我已经设法让ClickOnce在安装我的WPF应用程序时工作,但我也希望在安装期间安装Windows服务(项目中的那个)。

I have found ways how to programmatically start a windows service with C# code, but is there any way to incorporate this in my ClickOnce installation (because I need ClickOnce's benefit of automatic updates and such)? 我已经找到了如何使用C#代码以编程方式启动Windows服务的方法,但有没有办法将其合并到我的ClickOnce安装中(因为我需要ClickOnce的自动更新等的好处)?

请检查DDay更新库,它可能会为您提供ClickOnce更新的东西,但首先安装你也必须使用另一个。

Can you execute a process during the ClickOnce install? 您可以在ClickOnce安装期间执行流程吗? You might be able to write the service using Topshelf and then execute MyService.exe /install from ClickOnce. 您可以使用Topshelf编写服务,然后从ClickOnce执行MyService.exe / install。

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM