Skip to content

Commit

Permalink
Fixes issue with batch script while using bundled jdk to execute the …
Browse files Browse the repository at this point in the history
…demo install script

Signed-off-by: Darshit Chanpura <[email protected]>
  • Loading branch information
DarshitChanpura committed Dec 1, 2023
1 parent 3754512 commit 1dcd596
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions tools/install_demo_configuration.bat
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
@echo off
set DIR=%~dp0

set CUR_DIR=%DIR%

rem set opensearch home for instances when using bundled jdk
if not defined OPENSEARCH_HOME (
for %%I in ("%DIR%..\..\..") do set "OPENSEARCH_HOME=%%~dpfI"
)
cd %CUR_DIR%

if not "%OPENSEARCH_JAVA_HOME%" == "" (
set "JAVA=%OPENSEARCH_JAVA_HOME%\bin\java.exe"
set JAVA_TYPE=OPENSEARCH_JAVA_HOME
Expand All @@ -13,9 +21,9 @@ if not "%OPENSEARCH_JAVA_HOME%" == "" (
set JAVA_TYPE=bundled jdk
)

if not exist !JAVA! (
echo "could not find java in !JAVA_TYPE! at !JAVA!" >&2
if not exist "%JAVA%" (
echo "could not find java in %JAVA_TYPE% at %JAVA%" >&2
exit /b 1
)

%JAVA% -Dorg.apache.logging.log4j.simplelog.StatusLogger.level=OFF -cp "%DIR%\..\*;%DIR%\..\..\..\lib\*;%DIR%\..\deps\*" org.opensearch.security.tools.democonfig.Installer %DIR% %* 2> nul
"%JAVA%" -Dorg.apache.logging.log4j.simplelog.StatusLogger.level=OFF -cp "%DIR%\..\*;%DIR%\..\..\..\lib\*;%DIR%\..\deps\*" org.opensearch.security.tools.democonfig.Installer %DIR% %* 2> nul

0 comments on commit 1dcd596

Please sign in to comment.