0

通过 cmd.exe 安装 af 服务时,安装程​​序需要与命令提示符交互。我必须按两次键才能继续。当我想自动安装时,这对我来说是个问题。

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

此时需要交互

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

此时需要再次交互

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

The Commit phase completed successfully.

The transacted install has completed.

c:\>

我该怎么做才能让安装程序继续?

4

1 回答 1

3

捂脸!

如果您在 HostFactory.Run() 中有这个,就会发生这种情况

x.BeforeInstall(() => Console.ReadKey());
x.AfterInstall(() => Console.ReadKey());
于 2013-11-12T12:37:48.157 回答