@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem      https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@rem SPDX-License-Identifier: Apache-2.0
@rem

@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem  timmam startup script for Windows
@rem
@rem ##########################################################################

@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%..

@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi

@rem Add default JVM options here. You can also use JAVA_OPTS and TIMMAM_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="--add-exports" "java.desktop/com.sun.java.swing.plaf.windows=ALL-UNNAMED"

@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

:execute
@rem Setup the command line

set CLASSPATH=%APP_HOME%\lib\clientmodule_timmam.jar;%APP_HOME%\lib\jargs-1.0.jar;%APP_HOME%\lib\jide-charts-3.7.01.jar;%APP_HOME%\lib\jide-common-3.7.01.jar;%APP_HOME%\lib\jide-components-3.7.01.jar;%APP_HOME%\lib\jide-diff-3.7.01.jar;%APP_HOME%\lib\jide-dock-3.7.01.jar;%APP_HOME%\lib\jide-grids-3.7.01.jar;%APP_HOME%\lib\jide-properties-3.7.01.jar;%APP_HOME%\lib\clientmodule_tim.jar;%APP_HOME%\lib\commons-logging-1.0.4.jar;%APP_HOME%\lib\joc-pro-3.0.2.jar;%APP_HOME%\lib\moyocore-3.0.2.jar;%APP_HOME%\lib\clientmodule_base-bpmn.jar;%APP_HOME%\lib\clientmodule_icons.jar;%APP_HOME%\lib\clientmodule_sso.jar;%APP_HOME%\lib\clientmodule_base.jar;%APP_HOME%\lib\clientmodule_core.jar;%APP_HOME%\lib\iris_client-8.5.60.jar;%APP_HOME%\lib\iris_webservice_client-8.5.60.jar;%APP_HOME%\lib\iris_tools-8.5.60.jar;%APP_HOME%\lib\jakarta.servlet-api-6.1.0.jar;%APP_HOME%\lib\catalina-ant-6.0.45.jar;%APP_HOME%\lib\jersey-client-3.1.11.jar;%APP_HOME%\lib\jdom2-2.0.6.1.jar;%APP_HOME%\lib\poi-5.4.1.jar;%APP_HOME%\lib\pdfbox-1.7.1.jar;%APP_HOME%\lib\fontbox-1.7.1.jar;%APP_HOME%\lib\commons-codec-1.18.0.jar;%APP_HOME%\lib\jersey-hk2-3.1.11.jar;%APP_HOME%\lib\jakarta.activation-api-2.1.4.jar;%APP_HOME%\lib\log4j-1.2.17.jar;%APP_HOME%\lib\forms-1.1.0.jar;%APP_HOME%\lib\looks-2.1.4.jar;%APP_HOME%\lib\gson-2.13.2.jar;%APP_HOME%\lib\jose4j-0.9.6.jar;%APP_HOME%\lib\jersey-common-3.1.11.jar;%APP_HOME%\lib\jakarta.ws.rs-api-3.1.0.jar;%APP_HOME%\lib\jakarta.inject-api-2.0.1.jar;%APP_HOME%\lib\commons-collections4-4.4.jar;%APP_HOME%\lib\commons-math3-3.6.1.jar;%APP_HOME%\lib\commons-io-2.18.0.jar;%APP_HOME%\lib\SparseBitSet-1.3.jar;%APP_HOME%\lib\log4j-api-2.24.3.jar;%APP_HOME%\lib\jempbox-1.7.1.jar;%APP_HOME%\lib\commons-logging-1.1.1.jar;%APP_HOME%\lib\hk2-locator-3.0.6.jar;%APP_HOME%\lib\javassist-3.30.2-GA.jar;%APP_HOME%\lib\slf4j-reload4j-2.0.17.jar;%APP_HOME%\lib\slf4j-api-2.0.17.jar;%APP_HOME%\lib\jakarta.annotation-api-2.1.1.jar;%APP_HOME%\lib\error_prone_annotations-2.41.0.jar;%APP_HOME%\lib\osgi-resource-locator-1.0.3.jar;%APP_HOME%\lib\hk2-api-3.0.6.jar;%APP_HOME%\lib\aopalliance-repackaged-3.0.6.jar;%APP_HOME%\lib\hk2-utils-3.0.6.jar;%APP_HOME%\lib\reload4j-1.2.22.jar


@rem Execute timmam
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %TIMMAM_OPTS%  -classpath "%CLASSPATH%" com.iris.client.Starter %*

:end
@rem End local scope for the variables with windows NT shell
if %ERRORLEVEL% equ 0 goto mainEnd

:fail
rem Set variable TIMMAM_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%TIMMAM_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%

:mainEnd
if "%OS%"=="Windows_NT" endlocal

:omega
