@ollit.1
Hi Olli,
That link uses winsw and is basically what I have already tried.
From the windows system log it appears that windows starts the Spring Boot Jar but shuts down after the code starts to run.
@ollit.1
I will check that out in detail.
Do you have contact info for Stephane Nicolle?
As a matter of interest, I have set up same system in linux and it works well as a service.
Maybe you have had success the last day and there is no value in this post. However I will share my setup anyway. I did not call a script but java directly from the service. I think that will work in your case also.
I ran a Spring Boot Application with WinSW over many months with daily machine restarts and without any problems. Since then the application is moved over to Linux.
scrubb.xml
<!-- WinSW config file -->
<service>
<id>scrubb</id>
<name>scrubb</name>
<description>This service runs Scrubb. Detect usb, zip content and send email. User downloads.</description>
<executable>java</executable>
<arguments>-jar scrubb.jar</arguments>
<!-- Cannot contain password here. Define as system environment variable instead -->
<!-- <env name="SCRUBB_PASSWORD" value="******"/>-->
</service>
README.md
# WinSW
_Windows Service Wrapper_ helps us install services inside Windows.
## WinSW commands
On Windows name of `exe` and `xml` must match.
* `scrubb.exe install scrubb.xml`
* `scrubb.exe uninstall scrubb.xml`
* `scrubb.exe start scrubb.xml`
* `scrubb.exe stop scrubb.xml`
* `scrubb.exe restart scrubb.xml`
## Config
The `scrubb.xml` contains the configuration for how to set up the service correctly.
## Commands in order
### Prerequisite
1. Go into directory WinSW: `cd WinSW`
2. Install service: `scrubb.exe install scrubb.xml`
### Build and deploy
1. Build executable: `mvn clean package`
2. Copy executable to directory WinSW: `cp target\scrubb-0.0.1-SNAPSHOT.jar WinSW\scrubb.jar`
3. `cd WinSW`
4. Restart service: `scrubb.exe restart scrubb.xml`
@avec112 No, John, I have not yet solved my problem and I look forward to trying your approach.
Thanks for passing on your info, I will report back my results.
Paul Fraser
The failure I have had is related to something in my project code (not yet found) as I have successfully used winsw with a flow starter project.
Even though winsw is much larger than nssm (17+ mb) it is much better as it handles the requirement for administrator for windows service install much better from a user viewpoint . This is because the required .Net code is available in one of the binary downloads of winsw.
I contacted Stephane about his winsw repo and he is aware that it is out of date but had no current plans to update it.
Thank you both for your contributions to this topic.