<configuration>
  <id>{{ service_name }}</id>
  <name>{{ service_display_name }}</name>
  <description>{{ service_description }}</description>
  <executable>{{ service_binary }}</executable>
  <arguments>{{ service_arguments }}</arguments>
  <logpath>{{ log_dir }}</logpath>
  <priority>Normal</priority>
  <stoptimeout>20 sec</stoptimeout>
  <stopparentprocessfirst>false</stopparentprocessfirst>
  <startmode>Automatic</startmode>
  <waithint>15 sec</waithint>
  <sleeptime>1 sec</sleeptime>
  <log mode="roll">
    <sizeThreshold>10240</sizeThreshold>
    <keepFiles>8</keepFiles>
  </log>
</configuration>

<configuration>
  <id>{{ service_name }}</id>
  <name>{{ service_display_name }}</name>
  <description>{{ service_description }}</description>
  <executable>{{ service_binary }}</executable>
  <arguments>{{ service_arguments }}</arguments>
  <logpath>{{ log_dir }}</logpath>
  <priority>Normal</priority>
  <stoptimeout>20 sec</stoptimeout>
  <stopparentprocessfirst>false</stopparentprocessfirst>
  <startmode>Automatic</startmode>
  <waithint>15 sec</waithint>
  <sleeptime>1 sec</sleeptime>
  <log mode="roll">
    <sizeThreshold>10240</sizeThreshold>
    <keepFiles>8</keepFiles>
  </log>
{% for var in env_vars -%}
  <env name="{{ var.name }}" value="{{ var.value }}"/>
{% endfor -%}
</configuration>

Add environment variables to the WinSW xml template
Add environment variables to the WinSW xml template
