【发布时间】: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