在 WIX 升级期间重新启动 Windows 服务 [英] Restarting windows service during WIX upgrade

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

问题描述

我们在我们的 msi WIX 安装程序中安装了一个 Windows 服务.在升级过程中,我们只是尝试重新启动服务,而不是完全重新安装,以保护服务用户的信誉.

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>

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

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

推荐答案

不久前我写了一个类似(我认为)的答案:Wix:升级时有时会卸载 Windows 服务.请阅读该链接以获得几个不同的建议.

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 的信息.

永久组件:正如上面链接的答案所述,您可以将具有服务配置设置的组件设置为永久.在这种情况下,它永远不会在升级期间被卸载,但也不会在真正的卸载期间被卸载.因此,您必须在真正"卸载时手动清除服务安装和文件安装(与设置 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 服务.

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

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

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