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.