简体   繁体   English

安装使用VS2010创建的服务

[英]Install a service created with VS2010

I've to create a service in Visual Studio for one customer. 我必须在Visual Studio中为一位客户创建服务。

The customer IT service indicate me that they don't want any installer, only one exe that can be installed with instsrv.exe. 客户IT服务告诉我,他们不需要任何安装程序,只能使用instsrv.exe安装一个exe。

So I created a Service project on VS2010, compilated it(in 64 bits, it's an application that has to be ran in 64bits). 因此,我在VS2010上创建了一个Service项目,并对其进行了编译(64位,这是一个必须以64位运行的应用程序)。

First problem: I didn't found any instsrv.exe, so I used InstallUtil.exe, the 64 bits version : 第一个问题:我没有找到任何instsrv.exe,因此我使用了64位版本的InstallUtil.exe:

C:\Windows\Microsoft.Net\Framework64\v4.0.xxxx\InstallUtil.exe "PathToMyGeneratedExe"

It says me that " The commit phase completed successfully. " and " The transacted install has completed. ". 它告诉我“ The commit phase completed successfully. ”和“ The transacted install has completed. ”。

So I assume that the install completed successfully. 因此,我认为安装成功完成。

But if I go in the service console, I can't find the created service. 但是,如果进入服务控制台,则无法找到创建的服务。

So what am I missing? 那我想念什么呢?

InstallUtil is intended for usage with a service installer (which is really easy to make, but a bit buried) I imagine your client wasnt after a gui installer but I think it may be worth your while putting in the base serviceinstaller. InstallUtil旨在与服务安装程序一起使用(这确实很容易制作,但有点埋没了)我想您的客户端不是在gui安装程序之后的,但我认为放置基础serviceinstaller可能值得您这样做。

Normally InstallUtil will also prompt for a user to run the service under as well. 通常,InstallUtil还会提示用户在其下运行服务。 if you havent got this you probably arent installed 如果您没有安装此软件,则可能已安装了arent

Take a read of http://arcanecode.com/2007/05/23/windows-services-in-c-adding-the-installer-part-3/ for details of how to do this 阅读有关http://arcanecode.com/2007/05/23/windows-services-in-c-adding-the-installer-part-3/的详细信息

(TLDR right click on your service design surface and add installer) (TLDR右键单击您的服务设计图并添加安装程序)

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

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