@echo off
set JAVA_DIR=%~dp0..\java
set JAVA_VERSION=17.0.3
set JAVA_REVISION=7
rem note, you have to escape any '%' with a double '%%'
set JAVA_FILENAME=https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.3%%2B7/OpenJDK17U-jdk_x64_windows_hotspot_17.0.3_7.zip

echo Starting fusionauth-search ...
IF EXIST "%~dp0..\fusionauth-search" (
  Powershell.exe -executionpolicy ByPass -File "%~dp0..\fusionauth-search\elasticsearch\bin\install_java.ps1"
  START "fusionauth-search" /D "%~dp0..\fusionauth-search\elasticsearch\bin" elasticsearch
) ELSE (
  echo skipped, not installed.
)

echo Starting fusionauth-app ...
IF EXIST "%~dp0..\fusionauth-app" (
  Powershell.exe -executionpolicy ByPass -File "%~dp0..\fusionauth-app\apache-tomcat\bin\install_java.ps1"
  START "fusionauth-app" /D "%~dp0..\fusionauth-app\apache-tomcat\bin" catalina.bat start
) ELSE (
  echo skipped, not installed.
)
