Installing a windows service from a Visual Studio Installer project

依然范特西╮ 提交于 2019-11-28 15:46:51

问题


A colleague has written a Windows Application and left me to do the installers. I have created the installer project through Visual Studio and added the primary output of the service project to the new project.

When I run the installer it creates the correct folders and copies the dlls, exe and config file in, but it doesn't do the actual install of the service.

The service isn't listed in the Services window, and if I double click on the exe I'm told I need to run installutil to install the service.

How do I make the installer do this bit for me? I found this article:

http://www.codeproject.com/KB/install/InstallService.aspx

but that seems overly complex for what I would expect to be pretty basic.


回答1:


I used this article:

How to create a Setup project for a Windows Service in Visual Basic .NET or in Visual Basic 2005

Felt pretty dumb that I couldn't figure it all out until I went through all of the steps in this article. It's not a trivial exercise by any means.




回答2:


For those who are looking for updated instructions for Visual Studio 2010 (instructions in answer are for VS 2005) check the following link:

Walkthrough: Creating a Windows Service Application in the Component Designer (note that "other versions" [VS 2005, VS2008] are available from the same link)




回答3:


I had this issue in my case the problem was I neglected to add the custom actions for the installer project. To find these right click project->"view"->"custom actions" under there it needs the primary output added to the folders.



来源:https://stackoverflow.com/questions/407109/installing-a-windows-service-from-a-visual-studio-installer-project

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