如何使用 NSIS 脚本将应用程序安装为 Windows 服务?
我在脚本中使用了这个命令 Exec '"sc.exe"
但是安装后我在 Windows 服务中找不到任何与它相关的服务,所以请帮助我,谢谢。
最佳答案
也许是 NSIS Simple Service plugin能帮你。语法很简单
SimpleSC::InstallService "MyService" "My Service Display Name" "16" "2" "C:\MyPath\MyService.exe" "" "" ""
Pop $0 ; returns an errorcode (<>0) otherwise success (0)
这里的示例将服务安装为 ServiceType 自己的进程 + StartType 自动 + NoDependencies + 作为系统帐户登录。
请参阅随附的帮助以了解魔数(Magic Number)的含义。
维基显示 5 other methods使用 NSIS 处理服务。
关于windows-services - 如何使用 NSIS 脚本将应用程序安装为 Windows 服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17786875/