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

a 夏天 提交于 2019-12-19 09:02:01

问题


I currently have a VS Solution with 2 projects: a WPF application and a Windows Service.

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.

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)?


回答1:


I don't think you can deploy a windows service via ClickOnce in a normal fashion.

http://social.msdn.microsoft.com/Forums/en-US/winformssetup/thread/1bb64760-9622-4ca6-a1a6-3ce53e641f21

ClickOnce deploy a Windows Service?




回答2:


Please check DDay Update library it might give you ClickOnce stuff for updates, but first install you've got to do using another too.




回答3:


Can you execute a process during the ClickOnce install? You might be able to write the service using Topshelf and then execute MyService.exe /install from ClickOnce.



来源:https://stackoverflow.com/questions/765457/c-making-an-installer-that-installs-both-a-wpf-application-clickonce-and-a-w

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!