在wix中进行重大升级时如何只停止而不卸载Windows服务? [英] How to only stop and not uninstall windows services when major upgrade in wix?

查看:35
本文介绍了在wix中进行重大升级时如何只停止而不卸载Windows服务?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个应该在 wix v3.8 中安装 Windows 服务的安装程序.问题是我们需要在不卸载服务的情况下进行重大升级才能停止它.

I'm working on an installer that is supposed to install Windows services in wix v3.8. The problem is that we need to make a major upgrade without uninstalling the service only to stop it.

我们在包含服务 exe 文件的组件中使用 ServiceInstall 和 ServiceControl.有没有办法使 ServiceInstall 的执行有条件(使用 REMOVE="ALL" AND NOT UPGRADINGPRODUCTCODE 之类的条件),以便在升级时不卸载服务(只是停止以便我们可以升级文件)?

We're using ServiceInstall and ServiceControl inside the component that holds the service exe file. Is there a way to make the execution of ServiceInstall conditional (using a condition like REMOVE="ALL" AND NOT UPGRADINGPRODUCTCODE) so the service is not uninstalled when upgrading (just stopped so we can upgrade the files)?

一种解决方案是使用自定义操作,但也许有更好的方法?

One solution would be to use custom actions, but maybe there is a better way?

谢谢!

推荐答案

您必须重写处理这些元素的操作.如果适用于您的 MSI 软件包中的所有服务(如果您只有一项服务,那么对您来说很好),只要您没问题,以下内容可能会起作用:

You would have to override the action that process those elements. The following may work as long as you are okay if it applies to all services in your MSI package (if you only have one service then good on ya):

<InstallExecuteSequence>
   <DeleteServices>NOT UPGRADINGPRODUCTCODE</DeleteServices>
</InstallExecuteSequence>

您不需要为删除设置条件,因为 DeleteServices 已经考虑了组件的状态.

You don't need to condition for remove since the DeleteServices would already factor in the state of the Component.

这篇关于在wix中进行重大升级时如何只停止而不卸载Windows服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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