Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/variables/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
Service 卸载时未删除windows服务(WIX 3)_Service_Wix_Uninstallation - Fatal编程技术网

Service 卸载时未删除windows服务(WIX 3)

Service 卸载时未删除windows服务(WIX 3),service,wix,uninstallation,Service,Wix,Uninstallation,我已经用安装windows服务的WIX installer 3创建了安装程序 它可以很好地安装服务,但是当我卸载它时,服务没有被删除 我正在使用ServiceInstall和ServiceControl 我使用servicecontrol仅用于卸载服务,而不用于启动 尽管卸载过程运行顺利,但不会删除该服务 日志不显示错误 完成后,文件夹中没有文件 卸载 卸载期间服务未运行-因此没有问题 过程卡住了 安装程序在我预先保存的干净环境中运行 我已尝试替换设置中所有组件的所有GUID 我可以在代码中

我已经用安装windows服务的WIX installer 3创建了安装程序

它可以很好地安装服务,但是当我卸载它时,服务没有被删除

  • 我正在使用ServiceInstall和ServiceControl

    我使用servicecontrol仅用于卸载服务,而不用于启动

  • 尽管卸载过程运行顺利,但不会删除该服务
  • 日志不显示错误
  • 完成后,文件夹中没有文件 卸载
  • 卸载期间服务未运行-因此没有问题 过程卡住了
  • 安装程序在我预先保存的干净环境中运行
  • 我已尝试替换设置中所有组件的所有GUID
我可以在代码中指出我做错了什么,或者提出另一种解决方案

代码如下:

Component Id="ServiceComponentMain" Guid="{B652D08C-B99D-4CAC-9BCB-A48DF2356C9B}">
    <File Id="ApiProxy.Service.exe" KeyPath="yes" Source="$(var.BasePath)\ApiProxy.Service.exe" />        
    <ServiceInstall
      Id="ServiceComponentMain"
      Type="ownProcess"
      Vital="yes"
      Name="ApiProxy"
      DisplayName="ApiProxy"
      Start="auto"
      Account="LocalSystem"
      ErrorControl="critical"
      Interactive="no"/>
    <ServiceControl Id="StartService" Name="ServiceComponentMain" Stop="both" Remove="uninstall" Wait="yes" />
</Component>

ServiceControl元素中给出的名称应与ServiceInstall元素中给出的服务名称相匹配

Action ended 13:51:46: InstallInitialize. Return value 1.
MSI (s) (84:18) [13:51:46:547]: Doing action: ProcessComponents
Action 13:51:46: ProcessComponents. Updating component registration
Action start 13:51:46: ProcessComponents.
1: Updating component registration 
Action ended 13:51:46: ProcessComponents. Return value 1.
MSI (s) (84:18) [13:51:46:563]: Doing action: UnpublishFeatures
Action 13:51:46: UnpublishFeatures. Unpublishing Product Features
Action start 13:51:46: UnpublishFeatures.
UnpublishFeatures: Feature: Unpublishing Product Features
Action ended 13:51:46: UnpublishFeatures. Return value 1.
MSI (s) (84:18) [13:51:46:568]: Doing action: StopServices
Action 13:51:46: StopServices. Stopping services
Action start 13:51:46: StopServices.
StopServices: Service: Stopping services
Action ended 13:51:46: StopServices. Return value 1.
MSI (s) (84:18) [13:51:46:577]: Doing action: DeleteServices
Action 13:51:46: DeleteServices. Deleting services
Action start 13:51:46: DeleteServices.
DeleteServices: Service: Deleting services
Action ended 13:51:46: **DeleteServices. Return value 1**.
MSI (s) (84:18) [13:51:46:662]: Doing action: RemoveFiles
Action 13:51:46: RemoveFiles. Removing files
Action start 13:51:46: RemoveFiles.
MSI (s) (84:18) [13:51:46:664]: Note: 1: 2205 2:  3: RemoveFile 
RemoveFiles: File: Removing files, Directory: 
MSI (s) (84:18) [13:51:46:677]: Note: 1: 2205 2:  3: RemoveFile 
Action ended 13:51:46: RemoveFiles. Return value 0.
MSI (s) (84:18) [13:51:46:678]: Doing action: RemoveFolders
Action 13:51:46: RemoveFolders. Removing folders
Action start 13:51:46: RemoveFolders.
RemoveFolders: Folder: Removing folders
Action ended 13:51:46: RemoveFolders. Return value 1.