Windows服务与wix一起安装但未在服务列表中显示

时间:2015-07-02 23:34:00

标签: wix windows-services windows-installer

我已经使用wix和控制台应用程序创建了一个Windows服务安装包。两者都可以成功安装在Windows 7,8或服务器2012上。

但是当我尝试在另一个Windows Server 2012操作系统上安装时,似乎Windows服务已成功安装,没有显示错误消息,但是当我打开services.msc时,此Windows服务不在列表中。我检查了Windows日志,它已成功安装此服务。

可以对此产生什么影响?有没有人经历过这个?这是我用于Windows服务的wix xml,此服务映射到可执行应用程序

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
 xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">

<Product Id="*" Name="HyperionII.Server.Svc.Setup" Language="1033"
         Version="2.0.0.0" Manufacturer="EAE Technology"
         UpgradeCode="54fd1cf3-3646-40eb-b182-0ca4732b1f16">

    <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine"
             AdminImage="yes" InstallPrivileges="elevated"/>

    <MajorUpgrade DowngradeErrorMessage="A newer version of [HyperionII.Server.Svc] is
already installed." />

    <MediaTemplate EmbedCab="yes"/>

    <Feature Id="ServerProductFeature" Title="HyperionII.Server.Svc.Setup" Level="1">
        <ComponentGroupRef Id="ServerProductComponents" />
  <ComponentRef Id="ServerSvcComponent"/>
    </Feature>
</Product>

<?define SourceDir = "C:\Program Files (x86)\Hyperion\Server Svc" ?>

<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
  <Directory Id="ProgramFilesFolder">
    <Directory Id="HyperionFolder" Name="Hyperion">
      <Directory Id="ServerSvcFolder" Name="Server Svc">
        <Directory Id="StrongNameKeyFileFolder" Name="StrongNameKeyFile"/>
      </Directory>
    </Directory>
  </Directory>
 </Directory>
 </Fragment>

 <Fragment>
    <ComponentGroup Id="ServerProductComponents" Directory="ServerSvcFolder">
  <Component Id ="ServerSvcComponent" Guid="{35FB6173-9484-48CA-BA86-30B0A68B301D}">

    <File
      Id="HyperionII.Server.exe"
      Name="HyperionII.Server.exe"
      Source="$(var.SourceDir)\HyperionII.Server.exe"
      Vital="yes"
      KeyPath="yes"
      DiskId="1"/>

    <ServiceInstall
      Id="ServerSvcInstaller"
      Type="ownProcess"
      Vital="yes"
      Name="ServerSvc"
      DisplayName="HyperionII Server Service"
      Description="This service provides field operations, signal client"
      Start="auto"
      Account="LocalSystem"
      ErrorControl="ignore"
      Interactive="no">

      <util:ServiceConfig
        ServiceName="ServerSvc"
        FirstFailureActionType="restart"
        SecondFailureActionType="restart"
        ThirdFailureActionType="restart"
        RestartServiceDelayInSeconds="0"
        ResetPeriodInDays="1" />
    </ServiceInstall>

    <ServiceControl
      Id="StartService"
      Name="ServerSvc"
      Start="install"
      Stop="both"
      Remove="uninstall"
      Wait="no">
    </ServiceControl>

  </Component>
    </ComponentGroup>
   </Fragment>
 </Wix>

1 个答案:

答案 0 :(得分:0)

只是一个猜测。您是否刷新了服务控制管理器以验证服务确实没有显示?