forked from yacy/yacy_search_server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
installYaCyWindowsService.bat
49 lines (37 loc) · 1.65 KB
/
installYaCyWindowsService.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
@Echo Off
title YaCy Windows Service Install
:STARTJAVA
REM set the Java options
set javaopts=-Xss256k;-XX:MaxPermSize=256m;-Djava.awt.headless=true;-Dfile.encoding=UTF-8
REM set max Java heap memory (in MB)
set jmx=800
set jms=180
set servicedesc="P2P SearchEngine"
Rem This target is used to read java runtime parameters out of the yacy config file
:GETSTARTOPTS
REM for /F "tokens=1,2 delims==" %%i in (DATA\SETTINGS\yacy.conf) do (
REM if "%%i"=="javastart_Xmx" set jmx=%%j
REM )
Rem choose service runner executable according to processor architecture
set exepath=addon\windowsService
if /I "%PROCESSOR_ARCHITECTURE%"=="AMD64" set exepath=addon\windowsService\amd64
if /I "%PROCESSOR_ARCHITECTURE%"=="IA64" set exepath=addon\windowsService\ia64
Echo JRE Parameters:%javacmd%
Echo Startpath %~dp0
REM Install YaCy as Windows Service
%exepath%\prunsrv.exe //IS//YaCy --Jvm=auto --StartMode=jvm --StartClass=net.yacy.yacy --Classpath=lib/yacycore.jar --StartPath=%~dp0 --JvmOptions=%javaopts% --Startup=auto --JvmMx=%jmx% --JvmMs=%jms% --StopMode=jvm --StopClass=net.yacy.yacy --StopParams=-shutdown --Description=%servicedesc%
if not errorlevel 1 goto installed
Echo Failed installing YaCy service
Echo maybe it is already installed
Echo opening the service manager to edit the settings now.
addon\windowsService\prunmgr.exe //ES//YaCy
goto end
:installed
REM Start Service manager to check/edit YaCy Service settings
REM start addon\windowsService\prunmgr.exe //ES//YaCy
Echo start the YaCy service
%exepath%\prunsrv.exe //ES//YaCy
Echo wait some seconds for YaCy to startup
timeout /T 10
explorer http://localhost:8090/
:end