0

我有一个想要作为服务运行的 Kofax 组件 exe。早期的 srvany.exe 用于手动将 exe 注册为服务。我正在创建一个 wix msi 安装程序,它将作为服务安装。安装后,当我以管理员身份手动运行 exe 时,它​​运行完美并进行了适当的更新,否则管理员不会给出一些 activex 错误。因此,我在 exe 属性中选中了“以管理员身份运行此程序”。我的问题是 msi 安装的服务没有自动执行 exe,也没有发生更新。但是,如果服务启动并运行,然后我将尝试手动运行 exe,那么它会给出“它已经在运行”的消息,这意味着服务正在运行 exe,但没有更新任何东西。我应该在下面的代码中进行什么更改,以便服务可以选择 exe 并运行。

<Component Id="comp_KofaxCaptureQCRoute_exe" Guid="F7C1EBE7-3D7B-4E6D-8098-81EDDFD156EF" Permanent="no" Transitive="no">
            <File Id="file_KofaxCaptureQCRoute_exe" DiskId="1" Hidden="no" ReadOnly="no" TrueType="no" System="no" Vital="yes" Name="KofaxCaptureQCRoute.exe" Source="..\QC Route\KofaxCaptureQCRoute\bin\debug\KofaxCaptureQCRoute.exe" KeyPath="yes" />
        </Component>
        <Component Id="comp_file_srvany" Guid="D9CA373B-66B9-4FC5-A88D-E97FDDBBD526">
          <File Id="file_srvany" Source="..\QC Route\srvany.exe" KeyPath="yes" />

        <ServiceInstall 
        Id="QCRouteService"
        Type="ownProcess"
        Name="QCRouteService"
        DisplayName="Kofax_QCRoute_Service"
        Start="auto"
        Account="[SERVICEACCOUNT]"
        Password="[SERVICEPASSWORD]"
        ErrorControl="normal"
        Vital="yes"
         />
        <ServiceControl Id="Kofax_QCRoute_Service" Stop="both" Remove="uninstall" Name="QCRouteService" Wait="yes" />
        <RegistryKey Root="HKLM"
                 Key="SYSTEM\CurrentControlSet\Services\QCRouteService\Parameters"
          Action="createAndRemoveOnUninstall">
              <RegistryValue Type="string" Name="Application" Value="&quot;[#file_KofaxCaptureQCRoute_exe]&quot;"  />                 
        </RegistryKey>
          <RegistryKey Root="HKLM"
                 Key="SYSTEM\CurrentControlSet\Services\QCRouteService\Enum"
          Action="createAndRemoveOnUninstall">
              <RegistryValue Type="string" Name="0" Value="Root\LEGACY_QCROUTESERVICE\0000"  />
              <RegistryValue Type="integer" Name="Count" Value="1" />
              <RegistryValue Type="integer" Name="NextInstance" Value="1" />
          </RegistryKey>
      </Component>
4

1 回答 1

0

我相信在您的服务安装中,您正试图在属性 SERVICEACCOUNT、SERVICEPASSWORD 指定的帐户下运行它,可能取自其他地方看到的示例。

如果您没有设置这些属性,那么您应该使用接近此属性的 ServiceInstall

<ServiceInstall 
    Id="QCRouteService"
    Type="ownProcess"
    Name="QCRouteService"
    DisplayName="Kofax_QCRoute_Service"
    Start="auto"
    Account="LocalSystem"
    ErrorControl="normal"
    Vital="yes"/>

另请注意,您的 ServiceControl 省略了Start内部文本

<ServiceControl Id="Kofax_QCRoute_Service" Start="install" Stop="both" Remove="uninstall" Name="QCRouteService" Wait="yes" />
于 2016-08-29T20:24:14.813 回答