WIX 在安装前停止 Windows 服务

时间:2021-04-14 14:17:30

标签: wix windows-installer wix3.7 serviceinstall

我的 WIX 设置中有以下代码。现在我确实想停止该服务,当我再次安装它时。

<Component Id="CMP_Service" Feature="Core" Guid="8926df5e-89b3-47b0-875e-b5c4d14ab0b4">
        <File Source="$(var.Service.TargetPath)" KeyPath="yes">
          <fire:FirewallException Id="ServiceException" Name="Service Exception" Protocol="tcp" Port="[PORTProperty]" Scope="any" />
        </File>
        <ServiceInstall Id="ServiceInstallELS"
          Name="Service"
          Description="Service"
          Start="auto"
          Account="NT AUTHORITY\LocalService"
          ErrorControl="critical"
          Type="ownProcess"
          Vital="yes" Arguments=" /start AtledService" />
        <ServiceControl Id="ServiceControllELS"
          Name="Service"
          Start="install"
          Stop="both"
          Remove="uninstall"
          Wait="yes" />
      </Component>

0 个答案:

没有答案