I'm trying to build an MSI installer for a nodejs application that needs to run on a windows machine as a service. The issue is I have multiple environment variables that need to be set for the service to start like a database uri. This is why I've written a small batch file that sets the environment variables and starts my node application. I don't want the service to start immediatly, so the batch file can be edited to point the environment variables to the correct values. This is the WiX component I used to create the service:
<ComponentGroup Id="ServiceComponent">
<Component Directory="MYAPPLICATIONFOLDER">
<File KeyPath="yes" Name="start.bat" Source="src\start.bat" />
<ServiceInstall
Id="ServiceInstaller"
Name="MyTool"
DisplayName="My Tool"
Description="My awesome tool by ACME Inc."
Type="ownProcess"
Vital="yes"
Start="auto"
Interactive="no"
ErrorControl="ignore"
/>
<ServiceControl Id="StartService"
Stop="both"
Remove="uninstall"
Name="MyTool"
Wait="yes"
/>
</Component>
</ComponentGroup>
<Feature Id="MyAwesomeToolFeature">
<ComponentGroupRef Id="ProductComponent" />
<ComponentGroupRef Id="ServiceComponent" />
</Feature>
The Product Component only contains the js files that are necessary to start the application.
When I try to run the service from the Windows Service Manager I get this error:
I've tried different options but only could get it to the Error 1053.