-
Notifications
You must be signed in to change notification settings - Fork 81
/
start.bat
41 lines (33 loc) · 1.06 KB
/
start.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
@echo off
cls
title Petpet
setlocal enableDelayedExpansion
set "config_file=%~dp0\start-config.properties"
set "jar_file=%~dp0\petpet-*.jar"
if not exist "%jar_file%" (
echo Cannot find petpet jar file.
pause
exit /b 1
)
if exist "%config_file%" (
set /p "user_option=" < %config_file% || set "user_option=0"
echo Start Config: !user_option!
) else (
set /p "user_option=Enter the option (0: WebServer, 1: GoCQ Plugin)[0]: " || set "user_option=0"
set /p=!user_option!<nul >%config_file%
)
if "!user_option!" == "1" (
set "args=-gocq"
) else (
set "args="
)
for /f "delims=" %%a in ('dir /b /a-d %jar_file%') do (
set "jar_file=%%a"
)
echo Running %jar_file%
if exist %SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe (
start powershell.exe -Command "Set-ItemProperty HKCU:\Console VirtualTerminalLevel -Type DWORD 1; cd '%~dp0'; java -jar -Xms16M "%jar_file%" %args%"
) else (
cmd /c "reg add HKCU\Console /v VirtualTerminalLevel /t REG_DWORD /d 1 /f && cd /d %~dp0 && java -jar -Xms16M "%jar_file%" %args%"
)
endlocal