2、将 WinSW.NET4.exe 重命名为与 Jar 包和 XML 文件相同的名称,XML文件内容如下:
<service><!-- ID of the service. It should be unique across the Windows system--><id>MyAPP</id><!-- Display name of the service --><name>MyApp</name><!-- Service description --><description>自启动Java程序</description><!-- Path to the executable, which should be started --><executable>java</executable><arguments>-jar "%BASE%"\MyApp.jar</arguments><logpath>%BASE%\logs</logpath><logmode="roll-by-time"><pattern>yyyyMMdd</pattern></log></service>