如何创建安装Windows服务以卸载然后安装服务? [英] How Do I Create The Setup Windows Service To Uninstall Then Install Service?

查看:92
本文介绍了如何创建安装Windows服务以卸载然后安装服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我用C#开发一个Windows服务。我的项目有Installer和Setup项目。安装项目,安装服务非常好,它没有任何问题,但当我更改项目并创建其他设置时,新安装程序不会安装新服务,因为它已经存在!是否可以创建卸载服务然后安装它的设置?

解决方案

在安装项目属性中(通过使用属性窗口),有一个名为的属性 RemovePreviousVersions ,所以你必须在 True 上设置它。



详见 MSDN [ ^ ]

Hi,
i develop a windows service in C#. and my project has Installer, and Setup project. the setup project, installs service very well and it doesn't have any problem, but when i change project and create other setup, the new setup doesn't install new service, because it's already exist!!! is any way to create setup that it uninstalls the service then install it?

解决方案

In the "Setup Project"properties (by using Properties window) there is a property named "RemovePreviousVersions", so you have to set it on True.

See details in MSDN[^]


这篇关于如何创建安装Windows服务以卸载然后安装服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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