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
Windows services 从Wix启动Windows服务的多个实例_Windows Services_Wix - Fatal编程技术网

Windows services 从Wix启动Windows服务的多个实例

Windows services 从Wix启动Windows服务的多个实例,windows-services,wix,Windows Services,Wix,我目前在一个msi上工作,在从wix项目启动服务时面临一些问题。这是用于复制exe文件(即服务)和安装服务的xml <Component Id='MatcherService' Guid='{81EC2888-DFA6-49BA-829A-5A8354D89310}' Directory='MATCHERDIR'> <File Id='MatchingServer.exe' Source='$(var.Matcher.TargetDir)\Match

我目前在一个msi上工作,在从wix项目启动服务时面临一些问题。这是用于复制exe文件(即服务)和安装服务的xml

    <Component Id='MatcherService' Guid='{81EC2888-DFA6-49BA-829A-5A8354D89310}' Directory='MATCHERDIR'>
          <File Id='MatchingServer.exe' Source='$(var.Matcher.TargetDir)\MatchingServer.exe'/>
          <ServiceInstall
             Id="ServiceInstaller1"
             Type="ownProcess"
             Name="Matcher1"
             DisplayName="Matching Service 1"
             Description="test"
             Start="auto"
             Account="NT AUTHORITY\NETWORK SERVICE"
             Interactive="no"
             ErrorControl="normal"
             Vital="yes">
            <util:PermissionEx
               User="Everyone"
               GenericAll="yes"
               ServiceChangeConfig="yes"
               ServiceEnumerateDependents="yes"
               ChangePermission="yes"
               ServiceInterrogate="yes"
               ServicePauseContinue="yes"
               ServiceQueryConfig="yes"
               ServiceQueryStatus="yes"
               ServiceStart="yes"
               ServiceStop="yes" />
          </ServiceInstall>
 <ServiceControl Id="StartService1" Stop="both" Remove="uninstall" Name="Matcher1" Wait="yes"/>
</Component>
以及执行自定义操作以执行此批处理文件。但是我想在wix里面做这个


我如何才能生成同一个.exe文件的30个服务实例,这些实例的名称与wix不同,而不必绕过批处理文件?Windows服务并不是专门为此而设计的。如果需要同一服务器的30个实例,则需要在windows中创建30个唯一的服务

不过,我可能会建议,如果每个服务都是一个副本,那么您可以通过在应用程序中启动多个线程来实现这一点。如果您有静态类,您可能需要对应用程序域进行一些奇特的操作,或者您可以生成30个由主exe(您的服务)管理的exe

<Component Id='MatcherService' Guid='{81EC2888-DFA6-49BA-829A-5A8354D89310}' Directory='MATCHERDIR'>
      <File Id='MatchingServer.exe' Source='$(var.Matcher.TargetDir)\MatchingServer.exe'/>
      <ServiceInstall
         Id="ServiceInstaller1"
         Type="ownProcess"
         Name="Matcher1"
         DisplayName="Matching Service 1"
         Description="test"
         Start="auto"
         Account="NT AUTHORITY\NETWORK SERVICE"
         Interactive="no"
         ErrorControl="normal"
         Vital="yes">
        <util:PermissionEx
           User="Everyone"
           GenericAll="yes"
           ServiceChangeConfig="yes"
           ServiceEnumerateDependents="yes"
           ChangePermission="yes"
           ServiceInterrogate="yes"
           ServicePauseContinue="yes"
           ServiceQueryConfig="yes"
           ServiceQueryStatus="yes"
           ServiceStart="yes"
           ServiceStop="yes" />
      </ServiceInstall>

      <ServiceInstall
        Id="ServiceInstaller2"
        Type="ownProcess"
        Name="Matcher2"
        DisplayName="Matching Service 2"
        Description="test"
        Start="auto"
        Account="NT AUTHORITY\NETWORK SERVICE"
        Interactive="no"
        ErrorControl="normal"
        Vital="yes">
        <util:PermissionEx
           User="Everyone"
           GenericAll="yes"
           ServiceChangeConfig="yes"
           ServiceEnumerateDependents="yes"
           ChangePermission="yes"
           ServiceInterrogate="yes"
           ServicePauseContinue="yes"
           ServiceQueryConfig="yes"
           ServiceQueryStatus="yes"
           ServiceStart="yes"
           ServiceStop="yes" />
      </ServiceInstall>

      <ServiceControl Id="StartService1" Stop="both" Remove="uninstall" Name="Matcher1" Wait="yes"/>
      <ServiceControl Id="StartService2" Stop="both" Remove="uninstall" Name="Matcher2" Wait="yes"/>
    </Component>
MatchingServer.exe -i 1 -l "NT AUTHORITY\NETWORKSERVICE"
MatchingServer.exe -i 2 -l "NT AUTHORITY\NETWORKSERVICE"
MatchingServer.exe -i 3 -l "NT AUTHORITY\NETWORKSERVICE"
MatchingServer.exe -i 4 -l "NT AUTHORITY\NETWORKSERVICE"
MatchingServer.exe -i 5 -l "NT AUTHORITY\NETWORKSERVICE"
MatchingServer.exe -i 6 -l "NT AUTHORITY\NETWORKSERVICE"
MatchingServer.exe -i 7 -l "NT AUTHORITY\NETWORKSERVICE"
MatchingServer.exe -i 8 -l "NT AUTHORITY\NETWORKSERVICE"
MatchingServer.exe -i 9 -l "NT AUTHORITY\NETWORKSERVICE"
MatchingServer.exe -i 10 -l "NT AUTHORITY\NETWORKSERVICE"
MatchingServer.exe -i 11 -l "NT AUTHORITY\NETWORKSERVICE"
MatchingServer.exe -i 12 -l "NT AUTHORITY\NETWORKSERVICE"
MatchingServer.exe -i 13 -l "NT AUTHORITY\NETWORKSERVICE"
MatchingServer.exe -i 14 -l "NT AUTHORITY\NETWORKSERVICE"
MatchingServer.exe -i 15 -l "NT AUTHORITY\NETWORKSERVICE"
MatchingServer.exe -i 16 -l "NT AUTHORITY\NETWORKSERVICE"
MatchingServer.exe -i 17 -l "NT AUTHORITY\NETWORKSERVICE"
MatchingServer.exe -i 18 -l "NT AUTHORITY\NETWORKSERVICE"
MatchingServer.exe -i 19 -l "NT AUTHORITY\NETWORKSERVICE"
MatchingServer.exe -i 20 -l "NT AUTHORITY\NETWORKSERVICE"
MatchingServer.exe -i 21 -l "NT AUTHORITY\NETWORKSERVICE"
MatchingServer.exe -i 22 -l "NT AUTHORITY\NETWORKSERVICE"
MatchingServer.exe -i 23 -l "NT AUTHORITY\NETWORKSERVICE"
MatchingServer.exe -i 24 -l "NT AUTHORITY\NETWORKSERVICE"
MatchingServer.exe -i 25 -l "NT AUTHORITY\NETWORKSERVICE"
MatchingServer.exe -i 26 -l "NT AUTHORITY\NETWORKSERVICE"
MatchingServer.exe -i 27 -l "NT AUTHORITY\NETWORKSERVICE"
MatchingServer.exe -i 28 -l "NT AUTHORITY\NETWORKSERVICE"
MatchingServer.exe -i 29 -l "NT AUTHORITY\NETWORKSERVICE"
MatchingServer.exe -i 30 -l "NT AUTHORITY\NETWORKSERVICE"