我用Delphi为客户端服务器应用程序创建了一个Windows服务。
要安装它,我使用
c:\Test\MyService.exe /install (or /uninstall)
这将安装该服务,并在Windows服务中列出“MyService”名称和空描述。
如何定义不同的名称并插入描述(在运行时可以看到) services.msc
)?
注意: 我需要这个,因为在同一台机器上我需要安装更多次相同的服务(每个数据库1个)。
目前我唯一的解决方法是重命名服务exe,但我更愿意找到正确的命令行方式(因为我这样做 ShellExecute
)。
更新:
不知何故,我会寻找类似的东西(这当然只是出于解释原因! - InstallService.exe
是我刚刚发明的名字):
InstallService.exe c:\Test\MyService.exe /install /name='MyService1'
/description='This is my service for database 1'
而且更紧凑的版本会很好:
c:\Test\MyService.exe /install /name='MyService1'
/description='This is my service for database 1'