How do you register a Windows Service during installation?

徘徊边缘 提交于 2020-01-01 16:51:10

问题


I have built a windows service application in VB.net 2008, and used the Setup Wizard to add an installation process.

The installer works, in that it adds the app to add/remove programs and copies all of the files etc, but it's missing the final (required) step of actually installing the service.

I have added the primary output of the Project as a custom action for Install and Uninstall, without success.

what's the secret?


回答1:


You need to create a custom install task; MSDN has everything you need to know




回答2:


You can do two things:

1) Use custom actions in your setup project to register the service using the "installutil" .Net Framework command line utility, or simply register it yourself using installutil.

2) Add an Installer class to your Windows service. This link should give you all of the information you need, just skip past the beginning parts about creating the service. This is the way I recommend.



来源:https://stackoverflow.com/questions/208575/how-do-you-register-a-windows-service-during-installation

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