Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何让WiX删除windows服务?_Wix_Windows Services - Fatal编程技术网

如何让WiX删除windows服务?

如何让WiX删除windows服务?,wix,windows-services,Wix,Windows Services,我正在尝试让Wix在卸载时删除windows服务。它在安装过程中添加服务,但在卸载过程中,它只是禁用服务,而不是删除服务。此外,我不能用命令行sc工具删除它,因为它说指定的服务不作为已安装的服务存在。如果我再次尝试运行安装程序,它会告诉我没有足够的权限安装系统服务。我能摆脱它的唯一方法是从注册表中删除它并重新启动机器。必须有更好的方法来做到这一点。以下是wxs文件中的我的组件块: <Component Id="MyService.exe" Guid="5187d4cf-c7b7-4f9e-

我正在尝试让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>


这里有我遗漏的东西吗?

原来服务没有删除的原因是因为我打开了服务MMC。一旦我关闭并重新打开它,该服务将成功删除。

Good old“已标记为删除”,但在您关闭此窗口之前不会被删除。@BrianSutherland仍将在2020年底重新发布