即使重新启动,服务仍然存在,即使可执行文件不存在。我正在使用WIX版本3.0.5419.0为什么我的服务在卸载时被删除? (WIX)
<Component Id="IdiomServer.exe" Guid="7a751e1e-5e9e-41d2-be60-dc905ab1ccad">
<File Id="IdiomServer.exe" Source="$(var.IdiomServer.TargetDir)IdiomServer.exe" KeyPath="yes" />
<ServiceInstall Id="IdiomServer_Service" Name="IdiomServer 4.0" Account="LocalSystem" Description="Idiom Repository Server" ErrorControl="normal" Start="auto" Type="ownProcess" Vital="yes" />
<ServiceControl Id="IdiomServer_Service" Name="IdiomServer 4.0" Remove="uninstall" Stop="uninstall" Wait="yes" />
</Component>
安装Windows服务工作正常。卸载它似乎什么都不做。从卸载日志文件部分:
MSI (s) (D8:5C) [09:43:58:033]: Doing action: StopServices
MSI (s) (D8:5C) [09:43:58:033]: Note: 1: 2205 2: 3: ActionText
Action start 9:43:58: StopServices.
Action ended 9:43:58: StopServices. Return value 1.
MSI (s) (D8:5C) [09:43:58:033]: Doing action: DeleteServices
MSI (s) (D8:5C) [09:43:58:033]: Note: 1: 2205 2: 3: ActionText
Action start 9:43:58: DeleteServices.
Action ended 9:43:58: DeleteServices. Return value 1.
任何帮助将不胜感激。
关闭。问题不是ID,而是Component/@ Guid。一旦我改变了这一点,卸载工作正常。 在创建产品的新版本时,服务组件的Guid显然需要随Product/@ Id一起更改。 – 2009-09-16 00:29:19
这是不正确的。更改Component/@ Guid意味着组件中包含的所有资源也必须更改。这是通常称为“组件规则”的MSI限制。更改Component/@ Guids时,您会看到非常奇怪的升级和卸载行为。 原始卸载的详细日志文件应显示为什么ServiceControl不会删除您的服务。 – 2009-09-16 19:33:10
请参阅Rob的博客条目http://robmensching.com/blog/posts/2003/10/18/Component-Rules-101,了解为什么在不更改资源的情况下更改Component Id是一件坏事。 – Martin 2009-09-23 01:26:38