I have exposed SGW_HOME variable on windows nanoserver and trying to use it in the xml file
<service>
<!-- ID of the service. It should be unique across the Windows system-->
<id>SGWJavaService</id>
<name>SGWJavaService</name>
<description>SGW Java service</description>
<env name="SGW_HOME" value="%SGW_HOME%"/>
<!-- Path to the executable, which should be started -->
<!-- CAUTION: Don't put arguments here. Use <arguments> instead. -->
<executable>java</executable>
<arguments>-jar %SGW_HOME%\\lib\\mgmt-node-1.0.0.jar</arguments>
</service>
I can create service with command
WinSW-x64.exe install sgw.xml
but service failed to start
C:\program-files>sc query SGWJavaService
SERVICE_NAME: SGWJavaService
TYPE : 10 WIN32_OWN_PROCESS
STATE : 1 STOPPED
WIN32_EXIT_CODE : 1067 (0x42b)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
C:\program-files>
How do I use env variable into xml file?