0

I am changing the xml node in config file. After I do that, the service does not start automatically.

Service component

<Component Id="cmp1" Guid="{guid1}">
          <File Id="fil1" KeyPath="yes" Source="$(var.SourceDir)\Service1.exe" />
          <ServiceInstall Id="ServiceInstall1"
                          Type="ownProcess"
                          Name="SCService1"
                          DisplayName="xyz"
                          Description="abc"
                          Start="auto"
                          Account="NT Authority\NetworkService"
                          ErrorControl="normal"
                          Vital="yes" >
            <util:ServiceConfig FirstFailureActionType="restart" SecondFailureActionType="restart" ThirdFailureActionType="none" ResetPeriodInDays="1" />
            <ServiceConfig DelayedAutoStart="yes" OnInstall="yes" OnReinstall="yes" />
          </ServiceInstall>
          <ServiceControl Id="ServiceControl1" Name="SCService1" Start="install" Stop="uninstall" Remove="uninstall" Wait="no" />

Config Component

<Component Id="cmp2" Guid="{guid2}">
     <File Id="fil2" KeyPath="yes" Source="$(var.SourceDir)\Service1.exe.config"/>
</Component>


<!--XML config file upgrade change-->
<Component Id="ServiceConfigUpgrades" Guid="{guid3}">
                  <Condition><![CDATA[(INSTALLDIR <> "") AND NOT REMOVE]]></Condition>
                  <CreateFolder />
                  <util:XmlFile Id="UpdateServiceVersion"
                           File="[#fil2]"
                           Action="setValue"
                           Name="sku"
                           Value=".NETFramework,Version=v4.6.2"                                
                           ElementPath="configuration/startup/supportedRuntime" />
</Component>

I get the following error message and same in logs: Error 1920. Service 'Service' (ServiceSvc) failed to start. Verify that you have sufficient privileges to start system services. MSI (s) (B4:18) [14:59:16:380]: Product: XYZ -- Error 1920. Service 'Service' (ServiceSvc) failed to start. Verify that you have sufficient privileges to start system services.

I have to start service manually in this case, unlike the ideal case where the installer should be able to start the service on its own. And also, this is a fresh install where I experience this error and not on upgrades.

Atihska
  • 4,803
  • 10
  • 56
  • 98
  • Try "NT AUTHORITY\NetworkService" Maybe AUTHORITY being all caps makes a difference. From here https://msdn.microsoft.com/en-us/library/windows/desktop/ms684272%28v=vs.85%29.aspx?f=255&MSPPError=-2147217396 "the name of the account must be NT AUTHORITY\NetworkService" from this question 2nd answer https://stackoverflow.com/questions/1606361/wix-serviceinstall-setting-the-service-to-run-under-the-networkservice-account – Brian Sutherland Sep 27 '17 at 14:47
  • Your ServiceInstall and ServiceControl refer to SCService1 with a display name of xyz. The message refers to 'Service' and 'ServiceSvc' so have you changed the names? Or is there another service you're trying to start? – PhilDW Sep 27 '17 at 18:36
  • @PhilDW Yeah I have changed names, all refer to same service. Error in changing them! – Atihska Sep 27 '17 at 19:36

1 Answers1

0

This problem was solved by using INSTALDIR instead of INSTALLDIR. I misspelled it.

Atihska
  • 4,803
  • 10
  • 56
  • 98