如何使用 NSIS 脚本将应用程序安装为 Windows 服务 [英] How to install application as windows service using NSIS script

查看:42
本文介绍了如何使用 NSIS 脚本将应用程序安装为 Windows 服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用 NSIS 脚本将应用程序安装为 Windows 服务?

How to install application as windows service using NSIS script?

我在脚本 Exec '"sc.exe" 中使用了这个命令,但安装后我在 Windows 服务中找不到任何与之相关的服务,所以请帮帮我,谢谢.

I used this command in the script Exec '"sc.exe" but after installation i couldn't find any service in windows services related to it so help me thanks.

推荐答案

也许是 NSIS Simple Service 插件 可以帮助你.语法很简单

Maybe that the NSIS Simple Service plugin can help you. The syntax is as simple as

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 + 作为系统帐户登录.请参阅随附的帮助以了解幻数的含义.

Here the example install the service as ServiceType own process + StartType automatic + NoDependencies + Logon as System Account. Please refer to the accompanying help for the meaning of the magic numbers.

维基显示了 5 种其他方法来处理 NSIS 的服务.

The wiki shows the 5 other methods to handle services with NSIS.

这篇关于如何使用 NSIS 脚本将应用程序安装为 Windows 服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆