Topshelf installer requires me to press enter twice - why?

烂漫一生 提交于 2019-12-25 01:56:22

问题


When installing af service through cmd.exe the installer requires interaction with the command prompt. Twice i have to press a key to get it to continue. This is a problem for me when I want to automate the install.

c:\>MyService.exe install
Configuration Result:
[Success] Name SFTP_Service
[Success] DisplayName SFTP Service
[Success] Description SFTP Service
[Success] ServiceName SFTP_Service
Topshelf v3.1.118.0, .NET Framework v4.0.30319.17929

Running a transacted installation.

Beginning the Install phase of the installation.
Installing SFTP Service service

At this point interaction is required

Installing service SFTP_Service...
Service SFTP_Service has been successfully installed.
Creating EventLog source SFTP_Service in log Application...

At this point interaction is required again

The Install phase completed successfully, and the Commit phase is beginning.

The Commit phase completed successfully.

The transacted install has completed.

c:\>

What can I do to make the installer continue?


回答1:


Facepalm!

This will happen if you have this in your HostFactory.Run()

x.BeforeInstall(() => Console.ReadKey());
x.AfterInstall(() => Console.ReadKey());


来源:https://stackoverflow.com/questions/19925979/topshelf-installer-requires-me-to-press-enter-twice-why

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