【发布时间】:2017-01-09 19:25:36
【问题描述】:
我正在尝试让 Wix 在卸载时删除 Windows 服务。它在安装过程中添加了该服务,但在卸载过程中,它并没有删除该服务,而是将其禁用。此外,我无法使用命令行 sc 工具将其删除,因为它说指定的服务不作为已安装的服务存在。如果我再次尝试运行安装程序,它会告诉我我没有足够的权限来安装系统服务。我可以摆脱它的唯一方法是从注册表中删除它并重新启动机器。必须有更好的方法来做到这一点。这是我的 wxs 文件中的组件块:
<Component Id="MyService.exe" Guid="5187d4cf-c7b7-4f9e-9f2c-2d0557ecdf5e">
<File Id="MyService.exe" Name="MyService.exe" DiskId="1" Source="$(var.MyService.TargetDir)\MyService.exe" KeyPath="yes" />
<ServiceInstall Id="MyService.exe" Type="ownProcess" Name="MyService.exe" DisplayName="MyService" Description="MyService"
Start="auto" Account="LocalSystem" ErrorControl="normal" Vital="yes" />
<ServiceControl Id="MyService.exe" Stop="both" Remove="uninstall" Name="MyService.exe" Wait="yes" />
</Component>
这里有什么我遗漏的吗?
【问题讨论】:
标签: wix windows-services