15 changed files with 401 additions and 62 deletions
@ -0,0 +1,79 @@ |
|||
<!-- |
|||
|
|||
Copyright © 2016-2017 The Thingsboard Authors |
|||
|
|||
Licensed under the Apache License, Version 2.0 (the "License"); |
|||
you may not use this file except in compliance with the License. |
|||
You may obtain a copy of the License at |
|||
|
|||
http://www.apache.org/licenses/LICENSE-2.0 |
|||
|
|||
Unless required by applicable law or agreed to in writing, software |
|||
distributed under the License is distributed on an "AS IS" BASIS, |
|||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|||
See the License for the specific language governing permissions and |
|||
limitations under the License. |
|||
|
|||
--> |
|||
<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3" |
|||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|||
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.3 http://maven.apache.org/xsd/assembly-1.1.3.xsd"> |
|||
<id>windows</id> |
|||
|
|||
<formats> |
|||
<format>zip</format> |
|||
</formats> |
|||
|
|||
<!-- Workaround to create logs directory --> |
|||
<fileSets> |
|||
<fileSet> |
|||
<directory>${pkg.win.dist}</directory> |
|||
<outputDirectory>logs</outputDirectory> |
|||
<excludes> |
|||
<exclude>*/**</exclude> |
|||
</excludes> |
|||
</fileSet> |
|||
<fileSet> |
|||
<directory>${pkg.win.dist}/conf</directory> |
|||
<outputDirectory>conf</outputDirectory> |
|||
<lineEnding>windows</lineEnding> |
|||
</fileSet> |
|||
<fileSet> |
|||
<directory>${project.build.directory}/extensions</directory> |
|||
<outputDirectory>extensions</outputDirectory> |
|||
</fileSet> |
|||
<fileSet> |
|||
<directory>${project.build.directory}/data</directory> |
|||
<outputDirectory>data</outputDirectory> |
|||
</fileSet> |
|||
</fileSets> |
|||
|
|||
<files> |
|||
<file> |
|||
<source>${project.build.directory}/${project.build.finalName}-boot.${project.packaging}</source> |
|||
<outputDirectory>lib</outputDirectory> |
|||
<destName>${pkg.name}.jar</destName> |
|||
</file> |
|||
<file> |
|||
<source>${pkg.win.dist}/service.exe</source> |
|||
<outputDirectory/> |
|||
<destName>${pkg.name}.exe</destName> |
|||
</file> |
|||
<file> |
|||
<source>${pkg.win.dist}/service.xml</source> |
|||
<outputDirectory/> |
|||
<destName>${pkg.name}.xml</destName> |
|||
<lineEnding>windows</lineEnding> |
|||
</file> |
|||
<file> |
|||
<source>${pkg.win.dist}/install.bat</source> |
|||
<outputDirectory/> |
|||
<lineEnding>windows</lineEnding> |
|||
</file> |
|||
<file> |
|||
<source>${pkg.win.dist}/uninstall.bat</source> |
|||
<outputDirectory/> |
|||
<lineEnding>windows</lineEnding> |
|||
</file> |
|||
</files> |
|||
</assembly> |
|||
@ -0,0 +1 @@ |
|||
pkg.logFolder=${pkg.unixLogFolder} |
|||
@ -0,0 +1,2 @@ |
|||
pkg.logFolder=${BASE}\\logs |
|||
pkg.winWrapperLogFolder=%BASE%\\logs |
|||
@ -0,0 +1,90 @@ |
|||
@ECHO OFF |
|||
|
|||
setlocal ENABLEEXTENSIONS |
|||
|
|||
IF %PROCESSOR_ARCHITECTURE%==AMD64 GOTO CHECK_JAVA_64 |
|||
IF %PROCESSOR_ARCHITECTURE%==x86 GOTO CHECK_JAVA_32 |
|||
|
|||
@ECHO Detecting Java version installed. |
|||
:CHECK_JAVA_64 |
|||
@ECHO Detecting if it is 64 bit machine |
|||
set KEY_NAME="HKEY_LOCAL_MACHINE\Software\Wow6432Node\JavaSoft\Java Runtime Environment" |
|||
set VALUE_NAME=CurrentVersion |
|||
|
|||
FOR /F "usebackq skip=2 tokens=1-3" %%A IN (`REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul`) DO ( |
|||
set ValueName=%%A |
|||
set ValueType=%%B |
|||
set ValueValue=%%C |
|||
) |
|||
@ECHO CurrentVersion %ValueValue% |
|||
|
|||
SET KEY_NAME="%KEY_NAME:~1,-1%\%ValueValue%" |
|||
SET VALUE_NAME=JavaHome |
|||
|
|||
if defined ValueName ( |
|||
FOR /F "usebackq skip=2 tokens=1,2*" %%A IN (`REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul`) DO ( |
|||
set ValueName2=%%A |
|||
set ValueType2=%%B |
|||
set JRE_PATH2=%%C |
|||
|
|||
if defined ValueName2 ( |
|||
set ValueName = %ValueName2% |
|||
set ValueType = %ValueType2% |
|||
set ValueValue = %JRE_PATH2% |
|||
) |
|||
) |
|||
) |
|||
|
|||
IF NOT "%JRE_PATH2%" == "" GOTO JAVA_INSTALLED |
|||
IF "%JRE_PATH2%" == "" GOTO JAVA_NOT_INSTALLED |
|||
|
|||
:CHECK_JAVA_32 |
|||
@ECHO Detecting if it is 32 bit machine |
|||
set KEY_NAME="HKEY_LOCAL_MACHINE\Software\JavaSoft\Java Runtime Environment" |
|||
set VALUE_NAME=CurrentVersion |
|||
|
|||
FOR /F "usebackq skip=2 tokens=1-3" %%A IN (`REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul`) DO ( |
|||
set ValueName=%%A |
|||
set ValueType=%%B |
|||
set ValueValue=%%C |
|||
) |
|||
@ECHO CurrentVersion %ValueValue% |
|||
|
|||
SET KEY_NAME="%KEY_NAME:~1,-1%\%ValueValue%" |
|||
SET VALUE_NAME=JavaHome |
|||
|
|||
if defined ValueName ( |
|||
FOR /F "usebackq skip=2 tokens=1,2*" %%A IN (`REG QUERY %KEY_NAME% /v %VALUE_NAME% 2^>nul`) DO ( |
|||
set ValueName2=%%A |
|||
set ValueType2=%%B |
|||
set JRE_PATH2=%%C |
|||
|
|||
if defined ValueName2 ( |
|||
set ValueName = %ValueName2% |
|||
set ValueType = %ValueType2% |
|||
set ValueValue = %JRE_PATH2% |
|||
) |
|||
) |
|||
) |
|||
|
|||
IF "%JRE_PATH2%" == "" GOTO JAVA_NOT_INSTALLED |
|||
|
|||
:JAVA_INSTALLED |
|||
|
|||
@ECHO Java 1.8 found! |
|||
@ECHO Installing ${pkg.name} ... |
|||
${pkg.name}.exe install |
|||
|
|||
@ECHO DONE. |
|||
|
|||
GOTO END |
|||
|
|||
:JAVA_NOT_INSTALLED |
|||
@ECHO Java 1.8 or above is not installed |
|||
@ECHO Please go to https://java.com/ and install Java. Then retry installation. |
|||
PAUSE |
|||
GOTO END |
|||
|
|||
:END |
|||
|
|||
|
|||
@ -0,0 +1,12 @@ |
|||
<service> |
|||
<id>${pkg.name}</id> |
|||
<name>${project.name}</name> |
|||
<description>${project.description}</description> |
|||
<workingdirectory>%BASE%\conf</workingdirectory> |
|||
<logpath>${pkg.winWrapperLogFolder}</logpath> |
|||
<logmode>rotate</logmode> |
|||
<env name="LOADER_PATH" value="%BASE%\conf,%BASE%\extensions" /> |
|||
<executable>java</executable> |
|||
<startargument>-jar</startargument> |
|||
<startargument>%BASE%\lib\${pkg.name}.jar</startargument> |
|||
</service> |
|||
@ -0,0 +1,9 @@ |
|||
@ECHO OFF |
|||
|
|||
@ECHO Stopping ${pkg.name} ... |
|||
net stop ${pkg.name} |
|||
|
|||
@ECHO Uninstalling ${pkg.name} ... |
|||
${pkg.name}.exe uninstall |
|||
|
|||
@ECHO DONE. |
|||
File diff suppressed because one or more lines are too long
Loading…
Reference in new issue