Stop service when uninstalling on Win 7 with UAC from WIX

How can I stop my service when uninstalling in Win7 or Vista with UAC from WIX? When I delete my service from the control panel in Win7 or Vista using UAC, I always get the message "File in use". How can I stop it so that the message does not appear? I have this code on Wix:

     <ServiceInstall Id='MyServiceInstall' DisplayName='OnPremises Gateway' Name='OPGatewayService'
  ErrorControl='normal' Start='auto' Type='ownProcess' Vital='yes' Account='NT AUTHORITY\NetworkService'   />
          <ServiceControl Id="StartOPGatewayServiceControl" Name="OPGatewayService" Wait="no" Start="install"  />
          <ServiceControl Id="StopOPGatewayServiceControl" Name="OPGatewayService" Stop="both" Wait="yes" Remove="uninstall"/>

Thanks Adriana

+3
source share
2 answers

(, Uninstall.exe), , (, ). MsiExec.exe/X [MsiProductId]

-1

Source: https://habr.com/ru/post/1726423/


All Articles