【问题标题】:How can I use SimpleSC with Dependencies in NSIS如何在 NSIS 中将 SimpleSC 与依赖项一起使用
【发布时间】:2019-02-15 18:53:14
【问题描述】:

我的项目结构如下(示例):
Installer\Dependencies\Myservice.exe
Installer\Dependencies\dependenci.dll
Installer\Dependencies\js\file.js
Installer\Dependencies\resources\folder\file.js
在每个文件夹中,我的服务依赖项都安装得很好。
如果依赖项,我如何使用 simpleSC 安装服务?

我知道声明:

SimpleSC::InstallService [name_of_service] [display_name] [service_type][start_type] [binary_path] [dependencies] [account] [password]

我已经尝试过了,但是没有用:

SimpleSC::InstallService "LprService" "LprService" "272" "2" "$INSTDIR\GeneteLPRService.exe" "Dependencies" "" ""

P.s.:使用InstallUtil.exe,它可以工作

【问题讨论】:

    标签: windows-services installation nsis


    【解决方案1】:

    SimpleSC 依赖项是在您的服务可以启动之前必须启动的其他服务的列表。

    The Wiki page 有一个例子:

    ; Depends on "Windows Time Service" (w32time) and "WWW Publishing Service" (w3svc):
    SimpleSC::InstallService "MyService" "My Display Name" "16" "2" "$InstDir\MyService.exe" "w32time/w3svc" "" ""
    Pop $0
    

    如果您没有任何服务依赖项,那么您可以像其他未使用的参数一样使用空字符串。

    你的服务需要的文件可以用File或者File /r正常安装。

    【讨论】:

    • 嗨,安德斯,非常感谢。看起来你在这里帮助我处理所有这些请求!大声笑
    猜你喜欢
    • 1970-01-01
    • 2014-06-01
    • 2015-06-08
    • 2019-09-16
    • 2017-11-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多