在WIX升级过程中重新启动Windows服务 [英] Restarting windows service during WIX upgrade

查看:121
本文介绍了在WIX升级过程中重新启动Windows服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们已将Windows服务安装为msi WIX安装程序的一部分.在升级过程中,我们试图重新启动服务,而不是执行完全重新安装,以保护服务用户的信誉.

We have a windows service installed as a part of our msi WIX installer . During upgrade we are trying to just restart service instead of doing complete reinstall to safe guard the service user creds.

在这方面讨论了很多帖子,但没有定论.

A lot of posts discussed in this regard but nothing is conclusive.

尝试通过以下操作禁用升级期间的DeleteServices,

Tried out disabling DeleteServices during upgrade by doing below,

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

注意:上面的代码同样在旧版MSI中

Note: The above code is in old MSI as well

但是仍然看到服务实际上已被删除并重新安装.尝试在升级期间禁用installservice,如下所示:

But still saw service getting actually deleted and reinstalled. Tried disabling installservice during upgrade as below

<InstallServices>NOT WIX_UPGRADE_DETECTED</InstallServices>

但是服务处于停止状态并且安装程序无法运行,因为服务未处于运行状态,所以代码为1603的ExecServiceConfig.

But service is in stopped state and installer fails in action, ExecServiceConfig with code 1603 since service is not in running state.

任何有关此的指针都会有所帮助

Any pointers on this will be helpful

推荐答案

我写了一个类似的答案(我认为):

I wrote an answer for something similar (I think) a while back: Wix: Windows Service sometimes uninstalled when upgrading. Please read that link for several, different suggestions.

次要升级 :除了链接答案中的选项之外,您还可以使用次要升级-如果这完全可行的话.在次要升级中,不会先卸载产品,然后再重新安装,而是就地"升级.要使次要升级生效,您需要遵循组件规则,这很难做到,但是您可以在不失去服务信誉的情况下进行绝对升级. 请参见底部,了解如何应用次要升级.而且我将链接到答案为后期REP的一些信息.

Minor Upgrade: In addition to the options in the linked answer, you can use a minor upgrade as well - if that is at all a viable option. In a minor upgrade the product is not uninstalled and then reinstalled, but rather upgraded "in-place". For minor upgrades to work you need to follow the component rules to the letter - which can be hard to do, but you can then definitely upgrade without losing your service creds. See bottom here for how a minor upgrade is applied. And I will just link to an answer with a little bit of info on late REP.

永久组件 :如上述链接的回答所述,您可以将具有服务配置设置的组件设置为永久组件.在这种情况下,将永远不会在升级过程中将其卸载,但也不会在真正的卸载过程中将其卸载.因此,您必须在真实"卸载时手动清理服务安装和文件安装(与设置UPGRADINGPRODUCTCODE的主要升级启动卸载相反).我不太喜欢这种简单的方法.

Permanent Component: As the linked answer above states, you can set the component with the service configuration settings to be permanent. In this case it will never be uninstalled during upgrade, but not during a real uninstall either. Accordingly you have to manually clean out the service installation and file installation on "real" uninstall (as opposed to a major upgrade initiated uninstall which sets UPGRADINGPRODUCTCODE). Sort of an easy approach that I don't really like that much.

(托管)服务帐户 :不是我使用过的东西,而是更新的逐步.

(Managed) Service Accounts: Not something I have used, but the newer concept of managed service accounts as described in the above, linked answer could be investigated? Step-by-step.

后期REP/服务MSI :正确安排RemoveExistingProducts的时间太晚意味着您不应在升级方案期间卸载服务(有关详细信息,请参阅链接的答案).遵循所有组成部分的规则可能很困难,但是您可以通过将服务放入其自己的,最小的服务安装MSI,然后通过WiX Burn捆绑包安装(依次安装MSI文件)来减轻这种麻烦.

Late REP / Service MSI: Scheduling RemoveExistingProducts correctly late means your service should not be uninstalled during upgrade scenarios (see the linked answer for details). It can be hard to follow all component rules to the letter, but you can ease that by putting your service in its own, minimal service installation MSI, and then installing via a WiX Burn bundle (installing MSI files in sequence).

如前所述,请务必阅读类似的答案: Wix:升级时有时会卸载Windows Service .

As stated several times, please do read this similar answer: Wix: Windows Service sometimes uninstalled when upgrading.

这篇关于在WIX升级过程中重新启动Windows服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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