59 lines
1.4 KiB
Batchfile
Raw Normal View History

@ECHO OFF
setlocal ENABLEEXTENSIONS
@ECHO Detecting Java version installed.
2019-07-09 12:37:25 +03:00
:CHECK_JAVA
for /f tokens^=2-5^ delims^=.-_^" %%j in ('java -fullversion 2^>^&1') do set "jver=%%j%%k"
@ECHO CurrentVersion %jver%
2019-07-09 12:37:25 +03:00
if %jver% NEQ 18 GOTO JAVA_NOT_INSTALLED
:JAVA_INSTALLED
@ECHO Java 1.8 found!
2019-07-09 12:37:25 +03:00
@ECHO Installing thingsboard ...
SET loadDemo=false
if "%1" == "--loadDemo" (
SET loadDemo=true
)
SET BASE=%~dp0
SET LOADER_PATH=%BASE%\conf,%BASE%\extensions
2017-07-05 12:25:46 +03:00
SET SQL_DATA_FOLDER=%BASE%\data\sql
2019-07-09 12:37:25 +03:00
SET jarfile=%BASE%\lib\thingsboard.jar
SET installDir=%BASE%\data
2019-07-09 12:37:25 +03:00
PUSHD "%BASE%\conf"
2019-07-09 12:37:25 +03:00
java -cp "%jarfile%" -Dloader.main=org.thingsboard.server.ThingsboardInstallApplication^
-Dinstall.data_dir="%installDir%"^
-Dinstall.load_demo=%loadDemo%^
-Dspring.jpa.hibernate.ddl-auto=none^
-Dinstall.upgrade=false^
2019-07-09 12:37:25 +03:00
-Dlogging.config="%BASE%\install\logback.xml"^
org.springframework.boot.loader.PropertiesLauncher
if errorlevel 1 (
@echo ThingsBoard installation failed!
POPD
exit /b %errorlevel%
)
POPD
2019-07-09 12:37:25 +03:00
%BASE%thingsboard.exe install
@ECHO ThingsBoard installed successfully!
GOTO END
:JAVA_NOT_INSTALLED
2019-07-09 12:37:25 +03:00
@ECHO Java 1.8 is not installed. Only Java 1.8 is supported
@ECHO Please go to https://adoptopenjdk.net/index.html and install Java 1.8. Then retry installation.
PAUSE
GOTO END
:END