简体   繁体   中英

Wix Installer hangs - verify that you have enough privileges to start system services

I'm trying to install a windows service using windows setup. Halfway through the setup hangs and never completes.

在此处输入图像描述

After a few minutes (4-5 mins) it throws the following error.

verify that you have enough privileges to start system services

在此处输入图像描述

The install.log is stuck at here.

在此处输入图像描述

Service1.cs class

public partial class Service1 : ServiceBase
    {

        public Service1()
        {
            InitializeComponent();
            ServiceName = "MSPmateAgentService";
        }

        protected override void OnStart(string[] args)
        {

        }

        protected override void OnStop()
        {

        }
        
    }

product.wxs file

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
  <Product Id="*" Name="MSPmate Agent" Language="1033" Version="1.0.0.1" Manufacturer="MSPmate" UpgradeCode="2a2faae2-115e-4b45-aeeb-422663a2e357">
    <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
    <MajorUpgrade DowngradeErrorMessage="A newer version of MSPmate agent is already installed." />
    <MediaTemplate />
    <Feature Id="ProductFeature" Title="WixSetUpProject" Level="1">
      <ComponentGroupRef Id="ProductComponents" />
    </Feature>
    <InstallExecuteSequence>
      <Custom Action="CustomActionFormId" Before="InstallFinalize">NOT Installed</Custom>
    </InstallExecuteSequence>
  </Product>
  <Fragment>
    <Binary Id="CustomActionBinary" SourceFile="$(var.WixCustomForms.TargetDir)$(var.WixCustomForms.TargetName).CA.dll" />
    <CustomAction Id="CustomActionFormId" Execute="immediate" Impersonate="no" BinaryKey="CustomActionBinary" DllEntry="PerformAuthentication" Return="check" />
    <Directory Id="TARGETDIR" Name="SourceDir">
      <Directory Id="ProgramFilesFolder">
        <Directory Id="MSPMATEAGENT" Name="MSPMATE AGENT" />
      </Directory>
    </Directory>
  </Fragment>
  <Fragment>
    <ComponentGroup Id="ProductComponents" Directory="MSPMATEAGENT">
      <Component Id="ProductComponent">
       <!-- <File Source="$(var.RMMSetUp.TargetPath)" /> -->

        <File Id='MSPmateAgentService' Name='MSPmateAgentService' DiskId='1' Source='$(var.RMMSetUp.TargetPath)' KeyPath='yes' Vital="yes"/>
        <ServiceInstall
          Id="ServiceInstaller"
          Type="ownProcess"
          Name="MSPmateAgentService"
          DisplayName="MSPmate Agent Service"
          Description="Agent service"
          Start="auto"
          Account="LocalSystem"
          Vital="yes"
          Interactive="no"
          ErrorControl="normal" />         
     
            <ServiceControl Id="StartService"
            Name="MSPmateAgentService"
            Start="install"
            Wait="no" />
        
            <ServiceControl Id="StopService"
            Name="MSPmateAgentService"
            Stop="uninstall"
            Remove="uninstall"
            Wait="yes" />

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

am I missign anything here?

In Brief : Service startup errors tend to be caused by missing runtimes , little misconfigurations in the config files or incomplete installation (some of your own files are missing), bitness issues (32 vs 64) and not-elevated MSI running (no UAC elevation for install). And a few other things.


A recent question on services with solution: Wix installer package containing a C++ Builder Windows service


Suggestions :

  • Go Manual : If you deploy this service manually (copy files in place manually), does it run properly on a clean box? To test for missing runtimes or misconfiguration. Configure service . VBScript: install service , other service tasks .
  • Verbose Log : It looks like you have one, but for others: make a proper verbose MSI log of the installation. Here is how: Different logging approaches . Symantec KDB .
  • No Wait : Have you tried to set the ServiceControl attribute "Wait" to "no" to allow the MSI to finish installing even if your service startup failed?
    • This should allow you to manually test the service startup via the Service control applet.
    • You can then also try Procmon.exe to check what happens during launch.
  • Debug Binaries : Could you deploy debug binaries and attach the debugger? I haven't tried this for years. There could be new obstacles: Interactive Services Detection Service Removed in Windows 10 (so no more Switching to Session 0) .
  • Folder Diff : A quick trick: diff the folder that is working with the deployed folder that is not. For example between your main box and a virtual that has failed after clean installation.

Samples : WiX Service Installation samples:


Links:

Further Links:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM