@echo off
set FUSIONAUTH_JAVA_DIR=%~dp0..\java
set JAVA_VERSION=17.0.1
set JAVA_REVISION=12
rem note, you have to escape any '%' with a double '%%'
set JAVA_FILENAME=https://github.com/adoptium/temurin17-binaries/releases/download/jdk-17.0.1%%2B12/OpenJDK17U-jdk_x64_windows_hotspot_17.0.1_12.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.
)
