【问题标题】:WIX: Can't stop windows service during upgradeWIX:升级期间无法停止 Windows 服务
【发布时间】:2015-10-27 13:32:49
【问题描述】:

我有两个程序版本:

  • V0.0.1 - 我使用 Visual Studio 2005 和 wix v3.5 创建 MSI 安装程序。
  • V0.0.2 - 我使用 Visual Studio 2013 和 wix v3.9 创建 MSI 安装程序。

我想在这两个版本中都安装一个 Windows 服务。问题是当我在 V0.0.1 之上安装 V0.0.2 时,V0.0.1 的服务不会停止并且安装以错误结束。我很确定 V0.0.2 的 msiexec 根本不会通过 controlservice 发送停止消息(据我设法使用 Windbg 对其进行调试)。 在 V0.0.1 上安装 V0.0.1 可以正常工作,并且成功发送停止消息。


这是来自 InstallationFiles.wxi 的 ServiceControl 的代码。与两个版本相同。借助本站http://wixtoolset.org/documentation/manual/v3/xsd/wix/servicecontrol.html

编写
     <ServiceControl Id="MyService.exe.Control" Name="MyService" Remove="uninstall" Stop="both" Start="install" Wait="yes">
    <ServiceArgument>InstallerStart</ServiceArgument>
  </ServiceControl>

CustomAction 在这种情况下无关紧要

【问题讨论】:

  • 正如 Chris 所说,您需要播种组件并确保它们正在安装,并显示您的 ServiceInstall 代码。人们在 ServiceInstall 中使用一个名称,在 ServiceControl 中使用另一个名称并不罕见,但这是行不通的。

标签: winapi service wix windows-installer upgrade


【解决方案1】:

请注意安装时删除/停止/启动 |卸载 |两者都是指组件的安装状态而不是产品。我看不到这些元素与哪个组件/功能相关联,但如果这些组件没有作为升级的一部分安装,则不会发生停止。

【讨论】:

  • 感谢您的回答。我不知道如何检查组件是否已安装
  • 记录升级将表明。您需要阅读诸如 Minor vs Major Upgrades 和 Default File Versioning Rules 等主题。 (MSDN 主题)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2010-12-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多