Windows服务

新建Windows服务项目

1、右键 添加安装程序

2、将serviceProcessInstaller1   Account 设置为LocalSystem

3、修改serviceInstaller1 服务名称和服务描述,并将StartType改为Automatic

4、编写程序逻辑

安装卸载服务

管理员身份运行 命令提示符

cd  C:\Windows\Microsoft.NET\Framework64\v4.0.30319(64位) C:\Windows\Microsoft.NET\Framework\v4.0.30319(32位)

安装:InstallUtil.exe  目录/xxx.exe

卸载:InstallUtil.exe  /u  目录/xxx.exe

 

posted @ 2022-01-10 15:33  李国将  阅读(403)  评论(0)    收藏  举报