gpt4 book ai didi

c - 安装/卸载 C Windows 服务

转载 作者:太空宇宙 更新时间:2023-11-04 07:37:11 25 4
gpt4 key购买 nike

我用 C 编写了一个 Windows 服务。我想安装/卸载它而不使用 .NET Framework (installutil) 或 visual studio 安装程序(因为我是用 C 编写的)。

我正在使用 NSIS 安装我的应用程序,其中包含此服务以及许多其他内容。 NSIS 可以安装/卸载 Windows 服务吗?如果不能,我如何以编程方式在 C 中安装/卸载 Windows 服务。我已经看到了 C# 和 VB 的示例,但没有看到 C 的示例。

最佳答案

NSIS documentation lists the various possibilities .您只需选择最适合您需求的一种即可。

让 NSIS 执行此操作比通过调用服务控制管理器 API 自己编写脚本要容易得多。

关于c - 安装/卸载 C Windows 服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7807306/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com